X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2Fsal%2Ftx%2FWriteCandidateTx.java;h=23803f575129cebf226c0f98f891ef03d695574e;hb=74f902f0d61c2077a50c57f40c5f7b040fdddc29;hp=febbff6cec99aebe12942a64b0935ea64129a612;hpb=1815abee52990fee42a501da58a50d42e80463e7;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateTx.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateTx.java index febbff6cec..23803f5751 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateTx.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateTx.java @@ -15,8 +15,8 @@ import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; import javax.annotation.Nullable; -import org.opendaylight.controller.md.sal.common.api.TransactionStatus; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult; import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps; @@ -95,12 +95,12 @@ public class WriteCandidateTx extends AbstractWriteTx { @Override public synchronized CheckedFuture submit() { - final ListenableFuture commitFutureAsVoid = Futures.transform(commit(), - (Function, Void>) input -> { + final ListenableFuture commitFutureAsVoid = Futures.transform(commitConfiguration(), + (Function, Void>) input -> { Preconditions.checkArgument(input.isSuccessful() && input.getErrors().isEmpty(), "Submit failed with errors: %s", input.getErrors()); return null; - }); + }, MoreExecutors.directExecutor()); return Futures.makeChecked(commitFutureAsVoid, input -> new TransactionCommitFailedException( "Submit of transaction " + getIdentifier() + " failed", input)); @@ -115,13 +115,13 @@ public class WriteCandidateTx extends AbstractWriteTx { } @Override - public synchronized ListenableFuture> performCommit() { + public synchronized ListenableFuture> performCommit() { resultsFutures.add(netOps.commit(new NetconfRpcFutureCallback("Commit", id))); - final ListenableFuture> txResult = resultsToTxStatus(); + final ListenableFuture> txResult = resultsToTxStatus(); - Futures.addCallback(txResult, new FutureCallback>() { + Futures.addCallback(txResult, new FutureCallback>() { @Override - public void onSuccess(@Nullable final RpcResult result) { + public void onSuccess(@Nullable final RpcResult result) { cleanupOnSuccess(); } @@ -131,7 +131,7 @@ public class WriteCandidateTx extends AbstractWriteTx { // cleanup is trying to do unlock, but this will fail cleanup(); } - }); + }, MoreExecutors.directExecutor()); return txResult; }