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%2Flistener%2FNetconfDeviceCommunicator.java;h=257cd464a996ebc4efd906dceb6fae8db3800da3;hb=07797c1f8e35731ca7dce1d4524f669a171b731e;hp=8553820b40095755d4ee82361d184cbf5590fc9e;hpb=3997099eb61b0f2adc47f7a85952c324e9de223f;p=controller.git diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/listener/NetconfDeviceCommunicator.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/listener/NetconfDeviceCommunicator.java index 8553820b40..257cd464a9 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/listener/NetconfDeviceCommunicator.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/listener/NetconfDeviceCommunicator.java @@ -86,7 +86,7 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, logger.trace("{}: Session advertised capabilities: {}", id, netconfSessionPreferences); if(overrideNetconfCapabilities.isPresent()) { - netconfSessionPreferences = netconfSessionPreferences.replaceModuleCaps(overrideNetconfCapabilities.get()); + netconfSessionPreferences = netconfSessionPreferences.addModuleCaps(overrideNetconfCapabilities.get()); logger.debug("{}: Session capabilities overridden, capabilities that will be used: {}", id, netconfSessionPreferences); } @@ -110,7 +110,7 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, @Override public void operationComplete(Future future) throws Exception { - if (!future.isSuccess()) { + if (!future.isSuccess() && !future.isCancelled()) { logger.debug("{}: Connection failed", id, future.cause()); NetconfDeviceCommunicator.this.remoteDevice.onRemoteSessionFailed(future.cause()); } @@ -197,9 +197,8 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, // Disconnect from device if(session != null) { session.close(); + // tear down not necessary, called indirectly by above close } - - tearDown(id + ": Netconf session closed"); } @Override @@ -248,6 +247,10 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, request.future.set( RpcResultBuilder.failed() .withRpcError( NetconfMessageTransformUtil.toRpcError( e ) ).build() ); + + //recursively processing message to eventually find matching request + processMessage(message); + return; } @@ -321,10 +324,8 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener, } private void processNotification(final NetconfMessage notification) { - logger.debug("{}: Notification received: {}", id, notification); - if(logger.isTraceEnabled()) { - logger.trace("{}: Notification received: {}", id, msgToS(notification)); + logger.trace("{}: Notification received: {}", id, notification); } remoteDevice.onNotification(notification);