X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2FNetconfDeviceTwoPhaseCommitTransaction.java;h=5f14c264edb4cac6ab3dc1b81ccd8f2b1744a598;hp=9ec3aa3bb00bff78762770203ae79f7b80a94f3f;hb=7f0272398ce3dab7ceddd998c7bb510df3b28838;hpb=bcdc6138d215d097b13510e08735808ed931aeda diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java index 9ec3aa3bb0..5f14c264ed 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java @@ -42,17 +42,18 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransaction { +class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransaction { private static final Logger LOG = LoggerFactory.getLogger(NetconfDeviceTwoPhaseCommitTransaction.class); - private final NetconfDevice device; private final DataModification modification; - private final boolean candidateSupported = true; + private final NetconfDevice device; + private final boolean candidateSupported; public NetconfDeviceTwoPhaseCommitTransaction(NetconfDevice device, - DataModification modification) { - super(); - this.device = device; - this.modification = modification; + DataModification modification, + boolean candidateSupported) { + this.device = Preconditions.checkNotNull(device); + this.modification = Preconditions.checkNotNull(modification); + this.candidateSupported = candidateSupported; } void prepare() throws InterruptedException, ExecutionException { @@ -62,7 +63,6 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac for(Entry toUpdate : modification.getUpdatedConfigurationData().entrySet()) { sendMerge(toUpdate.getKey(),toUpdate.getValue()); } - } private void sendMerge(InstanceIdentifier key, CompositeNode value) throws InterruptedException, ExecutionException { @@ -80,7 +80,6 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac RpcResult rpcResult = device.invokeRpc(NETCONF_EDIT_CONFIG_QNAME, builder.toInstance()).get(); Preconditions.checkState(rpcResult.isSuccessful(),"Rpc Result was unsuccessful"); - } private CompositeNodeBuilder configurationRpcBuilder() {