X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2FNetconfDevice.java;h=2ed941851bb71852f06d8d1c0aa7d921e44937bb;hb=576170185844b9fbd7f522704ba36b13ce77abd1;hp=4ea0fa5645b6fe2a772b82a9b0dc72757a7c4edd;hpb=335821ba0e63f03416b15ac0902af326c2968671;p=controller.git diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java index 4ea0fa5645..2ed941851b 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java @@ -119,6 +119,9 @@ public class NetconfDevice implements Provider, // NetconfDeviceListener listener; + private boolean rollbackSupported; + + public NetconfDevice(String name) { this.name = name; this.logger = LoggerFactory.getLogger(NetconfDevice.class + "#" + name); @@ -172,7 +175,7 @@ public class NetconfDevice implements Provider, // } } - void bringUp(final SchemaSourceProvider delegate, final Set capabilities) { + void bringUp(final SchemaSourceProvider delegate, final Set capabilities, final boolean rollbackSupported) { // This has to be called from separate thread, not from netty thread calling onSessionUp in DeviceListener. // Reason: delegate.getSchema blocks thread when waiting for response // however, if the netty thread is blocked, no incoming message can be processed @@ -181,6 +184,7 @@ public class NetconfDevice implements Provider, // processingExecutor.submit(new Runnable() { @Override public void run() { + NetconfDevice.this.rollbackSupported = rollbackSupported; remoteSourceProvider = schemaSourceProvider.createInstanceFor(delegate); deviceContextProvider = new NetconfDeviceSchemaContextProvider(NetconfDevice.this, remoteSourceProvider); deviceContextProvider.createContextFromCapabilities(capabilities); @@ -218,7 +222,7 @@ public class NetconfDevice implements Provider, // logger.debug("Client capabilities {}", capabilities); for (QName capability : capabilities) { - it.addLeaf(NETCONF_INVENTORY_INITIAL_CAPABILITY, capability); + it.addLeaf(NETCONF_INVENTORY_INITIAL_CAPABILITY, capability.toString()); } logger.debug("Update device state transaction " + transaction.getIdentifier() @@ -285,7 +289,7 @@ public class NetconfDevice implements Provider, // @Override public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { - return listener.sendRequest(toRpcMessage(rpc, input, getSchemaContext())); + return listener.sendRequest(toRpcMessage(rpc, input, getSchemaContext()), rpc); } @Override @@ -363,7 +367,7 @@ public class NetconfDevice implements Provider, // public DataCommitTransaction requestCommit( DataModification modification) { NetconfDeviceTwoPhaseCommitTransaction twoPhaseCommit = new NetconfDeviceTwoPhaseCommitTransaction(this, - modification, true); + modification, true, rollbackSupported); try { twoPhaseCommit.prepare(); } catch (InterruptedException e) {