2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.genius.infra;
10 import com.google.common.util.concurrent.FluentFuture;
11 import org.opendaylight.mdsal.binding.api.WriteTransaction;
12 import org.opendaylight.mdsal.common.api.CommitInfo;
15 * WriteTransaction which cannot be {@link WriteTransaction#cancel()},
16 * {@link WriteTransaction#commit()} or {@link WriteTransaction#submit()}.
18 * @author Michael Vorburger.ch
20 // intentionally package local, for now
21 class NonSubmitCancelableWriteTransaction extends WriteTrackingWriteTransaction {
23 // TODO if we could finally reach consensus on https://git.opendaylight.org/gerrit/#/c/46684/, then this could probably be removed?
24 // see also https://git.opendaylight.org/gerrit/#/c/46335/ for the earlier take on it - controller, mdsal, controller, mdsal... ;-)
26 NonSubmitCancelableWriteTransaction(WriteTransaction delegate) {
31 public boolean cancel() {
32 throw new UnsupportedOperationException("cancel() cannot be used inside a Managed[New]TransactionRunner");
36 public FluentFuture<? extends CommitInfo> commit() {
37 throw new UnsupportedOperationException("commit() cannot be used inside a Managed[New]TransactionRunner");