clean some compilation warnings
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / NetConfTopologyListener.java
index 059479b021c7b1daf4363bd738441409e6a6cd73..9772212e00775c6b836753ce8d8f4039b7e1deeb 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
@@ -36,9 +35,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev161014.O
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.OrgOpenroadmLldpListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.OrgOpenroadmTcaListener;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.NotificationsService;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
@@ -112,31 +108,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
         final ListenerRegistration<OrgOpenroadmTcaListener> accessTcaNotificationListenerRegistration =
                 notificationService.get().registerNotificationListener(tcaListener);
 
-
-
-        String streamName = getSupportedStream(nodeId);
-        if (streamName == null) {
-            streamName = "OPENROADM";
-        }
-        final Optional<RpcConsumerRegistry> service = mountPoint.getService(RpcConsumerRegistry.class).toJavaUtil();
-        if (service.isPresent()) {
-            final NotificationsService rpcService = service.get().getRpcService(NotificationsService.class);
-            if (rpcService == null) {
-                LOG.error("Failed to get RpcService for node {}", nodeId);
-            } else {
-                final CreateSubscriptionInputBuilder createSubscriptionInputBuilder =
-                    new CreateSubscriptionInputBuilder();
-                createSubscriptionInputBuilder.setStream(new StreamNameType(streamName));
-                LOG.info("Triggering notification stream {} for node {}", streamName, nodeId);
-                rpcService.createSubscription(createSubscriptionInputBuilder.build());
-            }
-        } else {
-            LOG.error("Failed to get RpcService for node {}", nodeId);
-        }
-        NodeRegistration nodeRegistration = new NodeRegistration(nodeId, accessAlarmNotificationListenerRegistration,
-                accessDeOperationasNotificationListenerRegistration, accessDeviceNotificationListenerRegistration,
-                accessLldpNotificationListenerRegistration, accessTcaNotificationListenerRegistration);
-        this.registrations.put(nodeId, nodeRegistration);
     }
 
     private void onDeviceDisConnected(final String nodeId) {
@@ -163,7 +134,7 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
             }
             if (rootNode.getModificationType() == ModificationType.DELETE) {
                 if (rootNode.getDataBefore() != null) {
-                    String nodeId = rootNode.getDataBefore().getKey().getNodeId().getValue();
+                    String nodeId = rootNode.getDataBefore().key().getNodeId().getValue();
                     LOG.info("Node {} deleted", nodeId);
                     this.networkModelService.deleteOpenROADMnode(nodeId);
                     onDeviceDisConnected(nodeId);
@@ -172,8 +143,8 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
                 }
                 continue;
             }
-            String nodeId = rootNode.getDataAfter().getKey().getNodeId().getValue();
-            NetconfNode netconfNode = rootNode.getDataAfter().getAugmentation(NetconfNode.class);
+            String nodeId = rootNode.getDataAfter().key().getNodeId().getValue();
+            NetconfNode netconfNode = rootNode.getDataAfter().augmentation(NetconfNode.class);
 
             if ((netconfNode != null) && !StringConstants.DEFAULT_NETCONF_NODEID.equals(nodeId)) {
                 switch (rootNode.getModificationType()) {