Netconf-connector called initialization code and cleanup code (after capability
changed notification was received) in wrong order. This caused the cleanup
Change-Id: I3ea2166c912e2b6775bf9493a95102d66b5ae8a2
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
messageTransformer = new NetconfMessageTransformer(result);
updateTransformer(messageTransformer);
messageTransformer = new NetconfMessageTransformer(result);
updateTransformer(messageTransformer);
- notificationHandler.onRemoteSchemaUp(messageTransformer);
+ // salFacade.onDeviceConnected has to be called before the notification handler is initialized
salFacade.onDeviceConnected(result, remoteSessionCapabilities, deviceRpc);
salFacade.onDeviceConnected(result, remoteSessionCapabilities, deviceRpc);
+ notificationHandler.onRemoteSchemaUp(messageTransformer);
logger.info("{}: Netconf connector initialized successfully", id);
}
logger.info("{}: Netconf connector initialized successfully", id);
}
this.notificationService = notificationService;
registration = mountBuilder.register();
this.notificationService = notificationService;
registration = mountBuilder.register();
+ logger.debug("{}: Mountpoint exposed into MD-SAL {}", id, registration);
}
@Deprecated
synchronized void onDeviceDisconnected() {
if(registration == null) {
}
@Deprecated
synchronized void onDeviceDisconnected() {
if(registration == null) {
+ logger.trace("{}: Not removing mountpoint from MD-SAL, mountpoint was not registered yet", id);
// Only log and ignore
logger.warn("Unable to unregister mount instance for {}. Ignoring exception", id.getPath(), e);
} finally {
// Only log and ignore
logger.warn("Unable to unregister mount instance for {}. Ignoring exception", id.getPath(), e);
} finally {
+ logger.debug("{}: Mountpoint removed from MD-SAL {}", id, registration);
mountBuilder.addService(DOMNotificationService.class, notificationService);
topologyRegistration = mountBuilder.register();
mountBuilder.addService(DOMNotificationService.class, notificationService);
topologyRegistration = mountBuilder.register();
+ logger.debug("{}: TOPOLOGY Mountpoint exposed into MD-SAL {}", id, registration);
+
}
synchronized void onTopologyDeviceDisconnected() {
if(topologyRegistration == null) {
}
synchronized void onTopologyDeviceDisconnected() {
if(topologyRegistration == null) {
+ logger.trace("{}: Not removing TOPOLOGY mountpoint from MD-SAL, mountpoint was not registered yet", id);
// Only log and ignore
logger.warn("Unable to unregister mount instance for {}. Ignoring exception", id.getTopologyPath(), e);
} finally {
// Only log and ignore
logger.warn("Unable to unregister mount instance for {}. Ignoring exception", id.getTopologyPath(), e);
} finally {
+ logger.debug("{}: TOPOLOGY Mountpoint removed from MD-SAL {}", id, registration);
topologyRegistration = null;
}
}
@Override
synchronized public void close() throws Exception {
topologyRegistration = null;
}
}
@Override
synchronized public void close() throws Exception {
- if(registration != null) {
- onDeviceDisconnected();
- onTopologyDeviceDisconnected();
- }
+ onDeviceDisconnected();
+ onTopologyDeviceDisconnected();