X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=networkmodel%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fnetworkmodel%2FNetConfTopologyListener.java;h=9772212e00775c6b836753ce8d8f4039b7e1deeb;hb=922e31d0c09ed2f189362381cd19e6c5dc69a949;hp=059479b021c7b1daf4363bd738441409e6a6cd73;hpb=ce96a3bb3962f1350f9c7cee6405dcfba88aaaa3;p=transportpce.git diff --git a/networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java b/networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java index 059479b02..9772212e0 100644 --- a/networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java +++ b/networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java @@ -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 { final ListenerRegistration accessTcaNotificationListenerRegistration = notificationService.get().registerNotificationListener(tcaListener); - - - String streamName = getSupportedStream(nodeId); - if (streamName == null) { - streamName = "OPENROADM"; - } - final Optional 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 { } 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 { } 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()) {