@Override
public void operationComplete(Future<Object> future) throws Exception {
- if (!future.isSuccess()) {
+ if (!future.isSuccess() && !future.isCancelled()) {
logger.debug("{}: Connection failed", id, future.cause());
NetconfDeviceCommunicator.this.remoteDevice.onRemoteSessionFailed(future.cause());
}
// Disconnect from device
if(session != null) {
session.close();
+ // tear down not necessary, called indirectly by above close
}
-
- tearDown(id + ": Netconf session closed");
}
@Override
}
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);