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.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;
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) {
}
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);
}
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()) {