fix some sonar issues
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / NetConfTopologyListener.java
index 4d6579ae42220768266012866c0416242b288d13..4740bff236a858f949e758574145d0f901668dbb 100644 (file)
@@ -24,10 +24,8 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
 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;
 import org.opendaylight.transportpce.networkmodel.dto.NodeRegistration;
 import org.opendaylight.transportpce.networkmodel.dto.NodeRegistration22;
@@ -47,14 +45,11 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.OrgOpenroad
 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;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,7 +58,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
     private static final Logger LOG = LoggerFactory.getLogger(NetConfTopologyListener.class);
 
     private final NetworkModelService networkModelService;
-    //private final R2RLinkDiscovery linkDiscovery;
     private final DataBroker dataBroker;
     private final DeviceTransactionManager deviceTransactionManager;
     private final Map<String, NodeRegistration> registrations;
@@ -72,7 +66,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
     public NetConfTopologyListener(final NetworkModelService networkModelService, final DataBroker dataBroker,
              DeviceTransactionManager deviceTransactionManager) {
         this.networkModelService = networkModelService;
-        //this.linkDiscovery = linkDiscovery;
         this.dataBroker = dataBroker;
         this.deviceTransactionManager = deviceTransactionManager;
         this.registrations = new ConcurrentHashMap<>();
@@ -117,17 +110,12 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
             final ListenerRegistration<OrgOpenroadmDeviceListener> accessDeviceNotificationListenerRegistration =
                 notificationService.get().registerNotificationListener(deviceListener);
 
-//            final OrgOpenroadmLldpListener lldpListener = new LldpListener(this.linkDiscovery, nodeId);
-//            LOG.info("Registering notification listener on OrgOpenroadmLldpListener for node: {}", nodeId);
-//            final ListenerRegistration<OrgOpenroadmLldpListener> accessLldpNotificationListenerRegistration =
-//                notificationService.get().registerNotificationListener(lldpListener);
-
             TcaListener tcaListener = new TcaListener();
             LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
             final ListenerRegistration<OrgOpenroadmTcaListener> accessTcaNotificationListenerRegistration =
                 notificationService.get().registerNotificationListener(tcaListener);
 
-            String streamName = "NETCONF"; //getSupportedStream(nodeId);
+            String streamName = "NETCONF";
 
             if (streamName == null) {
                 streamName = "OPENROADM";
@@ -177,13 +165,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
                 .OrgOpenroadmDeviceListener> accessDeviceNotificationListenerRegistration =
                 notificationService.get().registerNotificationListener(deviceListener);
 
-//            final org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.OrgOpenroadmLldpListener
-//                lldpListener = new LldpListener221(linkDiscovery, nodeId);
-//            LOG.info("Registering notification listener on OrgOpenroadmLldpListener for node: {}", nodeId);
-//            final ListenerRegistration<org.opendaylight.yang.gen.v1.http.org.openroadm
-//                .lldp.rev181019.OrgOpenroadmLldpListener> accessLldpNotificationListenerRegistration =
-//                notificationService.get().registerNotificationListener(lldpListener);
-
             final org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev181019.OrgOpenroadmTcaListener
                 tcaListener = new TcaListener221();
             LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
@@ -193,7 +174,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
 
 
             String streamName = "NETCONF";
-            //getSupportedStream(nodeId);
             if (streamName == null) {
                 streamName = "OPENROADM";
             }
@@ -229,7 +209,6 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
             nodeRegistration.getAccessAlarmNotificationListenerRegistration().close();
             nodeRegistration.getAccessDeOperationasNotificationListenerRegistration().close();
             nodeRegistration.getAccessDeviceNotificationListenerRegistration().close();
-//            nodeRegistration.getAccessLldpNotificationListenerRegistration().close();
             nodeRegistration.getAccessTcaNotificationListenerRegistration().close();
         }
     }
@@ -303,7 +282,7 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
     }
 
 
-    private String getSupportedStream(String nodeId) {
+    /*private String getSupportedStream(String nodeId) {
         InstanceIdentifier<Streams> streamsIID = InstanceIdentifier.create(Netconf.class).child(Streams.class);
         try {
             Optional<Streams> ordmInfoObject =
@@ -325,5 +304,5 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
             LOG.error("NullPointerException thrown while getting Info from a non Open ROADM device {}", nodeId);
             return "NETCONF";
         }
-    }
+    }*/
 }