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%2FNetconfDeviceDataBroker.java;h=803b8ca524722019415ef5bb4d1f33c0d3b8cea6;hb=50351b4cb37a1998cfaef53ff584aeb767c25f50;hp=421e52da71978af327083e7f39b83aa3262015a7;hpb=c0488b3e5a8d1bbe2894eda5eb1254f6ced347a4;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceDataBroker.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceDataBroker.java index 421e52da71..803b8ca524 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceDataBroker.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceDataBroker.java @@ -24,6 +24,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain; import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences; import org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx; import org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadWriteTx; +import org.opendaylight.netconf.sal.connect.netconf.sal.tx.TxChain; import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateRunningTx; import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateTx; import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteRunningTx; @@ -38,10 +39,11 @@ public final class NetconfDeviceDataBroker implements DOMDataBroker { private final NetconfBaseOps netconfOps; private final boolean rollbackSupport; - private boolean candidateSupported; - private boolean runningWritable; + private final boolean candidateSupported; + private final boolean runningWritable; - public NetconfDeviceDataBroker(final RemoteDeviceId id, final SchemaContext schemaContext, final DOMRpcService rpc, final NetconfSessionPreferences netconfSessionPreferences) { + public NetconfDeviceDataBroker(final RemoteDeviceId id, final SchemaContext schemaContext, + final DOMRpcService rpc, final NetconfSessionPreferences netconfSessionPreferences) { this.id = id; this.netconfOps = new NetconfBaseOps(rpc, schemaContext); // get specific attributes from netconf preferences and get rid of it @@ -50,7 +52,8 @@ public final class NetconfDeviceDataBroker implements DOMDataBroker { runningWritable = netconfSessionPreferences.isRunningWritable(); rollbackSupport = netconfSessionPreferences.isRollbackSupported(); Preconditions.checkArgument(candidateSupported || runningWritable, - "Device %s has advertised neither :writable-running nor :candidate capability. At least one of these should be advertised. Failed to establish a session.", id.getName()); + "Device %s has advertised neither :writable-running nor :candidate capability." + + "At least one of these should be advertised. Failed to establish a session.", id.getName()); } @Override @@ -65,8 +68,8 @@ public final class NetconfDeviceDataBroker implements DOMDataBroker { @Override public DOMDataWriteTransaction newWriteOnlyTransaction() { - if(candidateSupported) { - if(runningWritable) { + if (candidateSupported) { + if (runningWritable) { return new WriteCandidateRunningTx(id, netconfOps, rollbackSupport); } else { return new WriteCandidateTx(id, netconfOps, rollbackSupport); @@ -77,13 +80,15 @@ public final class NetconfDeviceDataBroker implements DOMDataBroker { } @Override - public ListenerRegistration registerDataChangeListener(final LogicalDatastoreType store, final YangInstanceIdentifier path, final DOMDataChangeListener listener, final DataChangeScope triggeringScope) { + public ListenerRegistration registerDataChangeListener( + final LogicalDatastoreType store, final YangInstanceIdentifier path, final DOMDataChangeListener listener, + final DataChangeScope triggeringScope) { throw new UnsupportedOperationException(id + ": Data change listeners not supported for netconf mount point"); } @Override public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) { - throw new UnsupportedOperationException(id + ": Transaction chains not supported for netconf mount point"); + return new TxChain(this, listener); } @Override