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;
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;
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;
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<>();
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";
.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);
String streamName = "NETCONF";
- //getSupportedStream(nodeId);
if (streamName == null) {
streamName = "OPENROADM";
}
nodeRegistration.getAccessAlarmNotificationListenerRegistration().close();
nodeRegistration.getAccessDeOperationasNotificationListenerRegistration().close();
nodeRegistration.getAccessDeviceNotificationListenerRegistration().close();
-// nodeRegistration.getAccessLldpNotificationListenerRegistration().close();
nodeRegistration.getAccessTcaNotificationListenerRegistration().close();
}
}
}
- private String getSupportedStream(String nodeId) {
+ /*private String getSupportedStream(String nodeId) {
InstanceIdentifier<Streams> streamsIID = InstanceIdentifier.create(Netconf.class).child(Streams.class);
try {
Optional<Streams> ordmInfoObject =
LOG.error("NullPointerException thrown while getting Info from a non Open ROADM device {}", nodeId);
return "NETCONF";
}
- }
+ }*/
}