- final OrgOpenroadmAlarmListener alarmListener = new AlarmNotificationListener(this.dataBroker);
- LOG.info("Registering notification listener on OrgOpenroadmAlarmListener for node: {}", nodeId);
- final ListenerRegistration<OrgOpenroadmAlarmListener> accessAlarmNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(alarmListener);
-
- final OrgOpenroadmDeOperationsListener deOperationsListener = new DeOperationsListener();
- LOG.info("Registering notification listener on OrgOpenroadmDeOperationsListener for node: {}", nodeId);
- final ListenerRegistration<OrgOpenroadmDeOperationsListener>
- accessDeOperationasNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(deOperationsListener);
-
- final OrgOpenroadmDeviceListener deviceListener = new DeviceListener();
- LOG.info("Registering notification listener on OrgOpenroadmDeviceListener for node: {}", nodeId);
- 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);
-
- final OrgOpenroadmTcaListener tcaListener = new TcaListener();
- LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
- 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);