From: Martial COULIBALY Date: Tue, 17 Jul 2018 14:50:22 +0000 (+0200) Subject: Bug correction in RendererNotificationImpl X-Git-Tag: v0.2.0~66 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=e0aff026207dda8bc82f4afc51606a9e5fd60e80;hp=4ddf270b744af2d7e70d8ccc94ceffac801372ce;p=transportpce.git Bug correction in RendererNotificationImpl JIRA : TRNSPRTPCE-18 Change-Id: I9d608b400945ee29cf1dab74af7b1cd926f9de15 Signed-off-by: Martial COULIBALY --- diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/RendererNotificationsImpl.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/RendererNotificationsImpl.java index efcc3d9fc..6231c8873 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/RendererNotificationsImpl.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/RendererNotificationsImpl.java @@ -94,7 +94,7 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { private void registerNotificationListener(final NodeId nodeId) { - MountPoint mountPoint = PortMapping.getDeviceMountPoint(nodeId.getValue(), mountService); + MountPoint mountPoint = PortMapping.getDeviceMountPoint(nodeId.getValue(), this.mountService); // Register notification service final Optional notificationService = mountPoint.getService( @@ -145,8 +145,8 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { public void close() { LOG.info("RenderernotificationsImpl Closed"); // Clean up the Data Change Listener registration - if (dataTreeChangeListenerRegistration != null) { - dataTreeChangeListenerRegistration.close(); + if (this.dataTreeChangeListenerRegistration != null) { + this.dataTreeChangeListenerRegistration.close(); } } @@ -167,8 +167,8 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { if (rootNode.getModificationType() == ModificationType.DELETE) { String nodeid = rootNode.getDataBefore().getKey().getNodeId().getValue(); LOG.info("Node {} removed...", nodeid); - currentMountedDevice.remove(nodeid); - new PortMapping(dataBroker, mountService, nodeid).deleteMappingData(); + this.currentMountedDevice.remove(nodeid); + new PortMapping(this.dataBroker, this.mountService, nodeid).deleteMappingData(); } if (nnode != null) { @@ -177,12 +177,9 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { LOG.info("{} ignored: org-openroadm-device advertised but not a real ROADM device", nodeId); return; } - if (rootNode.getModificationType() == ModificationType.WRITE) { - LOG.info("Node added {}", nodeId); - - } else if (rootNode.getModificationType() == ModificationType.SUBTREE_MODIFIED) { - - LOG.info("Node modified {}", nodeId); + if ((rootNode.getModificationType() == ModificationType.WRITE) || + (rootNode.getModificationType() == ModificationType.SUBTREE_MODIFIED)) { + LOG.info("Node added or modified {}", nodeId); ConnectionStatus csts = nnode.getConnectionStatus(); switch (csts) { @@ -196,12 +193,12 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { * for notifications */ registerNotificationListener(rootNode.getDataAfter().getNodeId()); - currentMountedDevice.add(nodeId); - new PortMapping(dataBroker, mountService, nodeId).createMappingData(); + this.currentMountedDevice.add(nodeId); + new PortMapping(this.dataBroker, this.mountService, nodeId).createMappingData(); break; } case Connecting: { - LOG.info("NETCONF Node: {} was disconnected", nodeId); + LOG.info("NETCONF Node: {} is (dis)connecting", nodeId); break; } case UnableToConnect: { @@ -214,6 +211,6 @@ public class RendererNotificationsImpl implements DataTreeChangeListener { } } } - LOG.info("Netconf devices currently mounted are : {}", currentMountedDevice.toString()); + LOG.info("Netconf devices currently mounted are : {}", this.currentMountedDevice.toString()); } }