X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=nbinotifications%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fnbinotifications%2Fimpl%2FNbiNotificationsProvider.java;h=f1caef3f55cc21abe96823118d8873ecd4af576d;hb=8be42823a12d414dfa491305f4912bb642b6d5e2;hp=ac4c6ef8e61660e4d9b4e32a496e9185fa2c98dc;hpb=37a539ad2c5ad1006cd0203de63d80350c32b72e;p=transportpce.git diff --git a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java index ac4c6ef8e..f1caef3f5 100644 --- a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java +++ b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java @@ -7,7 +7,6 @@ */ package org.opendaylight.transportpce.nbinotifications.impl; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -20,13 +19,11 @@ import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsL import org.opendaylight.transportpce.nbinotifications.producer.Publisher; import org.opendaylight.transportpce.nbinotifications.utils.TopicManager; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.TapiNotificationService; import org.opendaylight.yangtools.concepts.ListenerRegistration; -import org.opendaylight.yangtools.concepts.ObjectRegistration; +import org.opendaylight.yangtools.concepts.Registration; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; @@ -51,7 +48,7 @@ public class NbiNotificationsProvider { private static Map> publishersServiceMap = new HashMap<>(); private static Map> publishersAlarmMap = new HashMap<>(); private ListenerRegistration listenerRegistration; - private List> rpcRegistrations = new ArrayList<>(); + private Registration rpcRegistration; @Activate public NbiNotificationsProvider(@Reference RpcProviderService rpcProviderService, @@ -92,8 +89,7 @@ public class NbiNotificationsProvider { NbiNotificationsImpl nbiImpl = new NbiNotificationsImpl(converterService, converterAlarmService, converterTapiService, subscriberServer, networkTransactionService, topicManager); - rpcRegistrations.add(rpcProviderService.registerRpcImplementation(NbiNotificationsService.class, nbiImpl)); - rpcRegistrations.add(rpcProviderService.registerRpcImplementation(TapiNotificationService.class, nbiImpl)); + rpcRegistration = rpcProviderService.registerRpcImplementations(nbiImpl.registerRPCs()); NbiNotificationsListenerImpl nbiNotificationsListener = new NbiNotificationsListenerImpl( topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap()); listenerRegistration = notificationService.registerNotificationListener(nbiNotificationsListener); @@ -112,7 +108,7 @@ public class NbiNotificationsProvider { for (Publisher publisherAlarm : publishersAlarmMap.values()) { publisherAlarm.close(); } - rpcRegistrations.forEach(reg -> reg.close()); + rpcRegistration.close(); listenerRegistration.close(); LOG.info("NbiNotificationsProvider Closed"); }