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;
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
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
@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);
}
@Override
- public ListenerRegistration<DOMDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store, final YangInstanceIdentifier path, final DOMDataChangeListener listener, final DataChangeScope triggeringScope) {
+ public ListenerRegistration<DOMDataChangeListener> 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