X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=servicehandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2Fimpl%2FServicehandlerProvider.java;h=d8662c68db7cb1176e5db77da786a11d8e5312d3;hb=cb8ebd04e8e896faf9f2157ca182939191dd7ea2;hp=003637e5e7e2c57ca73eea526e228fd1a7b5100e;hpb=fcfab00be3ad84e5616eb2df9b922a726c615c57;p=transportpce.git diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java index 003637e5e..d8662c68d 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java @@ -8,17 +8,21 @@ package org.opendaylight.transportpce.servicehandler.impl; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.NotificationService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.transportpce.pce.service.PathComputationService; -import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService; import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations; +import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.TransportpcePceListener; -import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.OrgOpenroadmServiceService; +import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.TransportpcePceListener; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.TransportpceRendererListener; +import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.OrgOpenroadmServiceService; import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,24 +37,26 @@ public class ServicehandlerProvider { private static final Logger LOG = LoggerFactory.getLogger(ServicehandlerProvider.class); private final DataBroker dataBroker; - private final RpcProviderRegistry rpcRegistry; + private final RpcProviderService rpcService; private final NotificationService notificationService; - private final NetworkModelWavelengthService networkModelWavelengthService; + private final NotificationPublishService notificationPublishService; private ListenerRegistration pcelistenerRegistration; - private RpcRegistration rpcRegistration; + private ListenerRegistration rendererlistenerRegistration; + private ListenerRegistration networkmodellistenerRegistration; + private ObjectRegistration rpcRegistration; private PathComputationService pathComputationService; private RendererServiceOperations rendererServiceOperations; - public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry, + public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderService rpcProviderService, NotificationService notificationService, PathComputationService pathComputationService, RendererServiceOperations rendererServiceOperations, - NetworkModelWavelengthService networkModelWavelengthService) { + NotificationPublishService notificationPublishService) { this.dataBroker = dataBroker; - this.rpcRegistry = rpcProviderRegistry; + this.rpcService = rpcProviderService; this.notificationService = notificationService; this.pathComputationService = pathComputationService; this.rendererServiceOperations = rendererServiceOperations; - this.networkModelWavelengthService = networkModelWavelengthService; + this.notificationPublishService = notificationPublishService; } /** @@ -58,10 +64,20 @@ public class ServicehandlerProvider { */ public void init() { LOG.info("ServicehandlerProvider Session Initiated"); + final PceListenerImpl pceListenerImpl = new PceListenerImpl(rendererServiceOperations, + pathComputationService, notificationPublishService, null); + final RendererListenerImpl rendererListenerImpl = + new RendererListenerImpl(pathComputationService, notificationPublishService); + final NetworkModelListenerImpl networkModelListenerImpl = + new NetworkModelListenerImpl(notificationPublishService, null); + pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl); + rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl); + networkmodellistenerRegistration = notificationService.registerNotificationListener(networkModelListenerImpl); final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService, - rendererServiceOperations, networkModelWavelengthService); - final PceListenerImpl pceListener = new PceListenerImpl(); - rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); + rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl); + rpcRegistration = + rpcService.registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); } /** @@ -70,6 +86,8 @@ public class ServicehandlerProvider { public void close() { LOG.info("ServicehandlerProvider Closed"); pcelistenerRegistration.close(); + rendererlistenerRegistration.close(); + networkmodellistenerRegistration.close(); rpcRegistration.close(); }