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=07ab8b003780a06d1f7cc5b6fe44f18d21af313d;hb=b115d446ae97ff4e7def0ad5c96beaa13191e5b0;hp=32929b9a46322068cfa41deb01d53e9e7e47284f;hpb=8e869851857c216b2513c2bf1adae927737de507;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 32929b9a4..07ab8b003 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 @@ -13,14 +13,19 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService 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.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev161014.ServicehandlerService; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubpce.rev170426.StubpceListener; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererListener; +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.PceListenerImpl; +import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev190624.TransportpcePceListener; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.TransportpceRendererListener; +import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.OrgOpenroadmServiceService; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/* +/** * Class to register * Servicehandler Service and Notification. * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange @@ -33,42 +38,53 @@ public class ServicehandlerProvider { private final DataBroker dataBroker; private final RpcProviderRegistry rpcRegistry; private final NotificationService notificationService; + private final NetworkModelWavelengthService networkModelWavelengthService; private final NotificationPublishService notificationPublishService; - - //private ListenerRegistration ServicehandlerlistenerRegistration; - /* Listener register for StubPce Notification. */ - private ListenerRegistration stubPcelistenerRegistration; - /* Listener register for StubRender Notification. */ - private ListenerRegistration stubRendererlistenerRegistration; - private RpcRegistration rpcRegistration; - + private ListenerRegistration pcelistenerRegistration; + private ListenerRegistration rendererlistenerRegistration; + private RpcRegistration rpcRegistration; + private PathComputationService pathComputationService; + private RendererServiceOperations rendererServiceOperations; public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry, - NotificationService notificationService, NotificationPublishService notificationPublishService) { + NotificationService notificationService, PathComputationService pathComputationService, + RendererServiceOperations rendererServiceOperations, + NetworkModelWavelengthService networkModelWavelengthService, + NotificationPublishService notificationPublishService) { this.dataBroker = dataBroker; this.rpcRegistry = rpcProviderRegistry; this.notificationService = notificationService; + this.pathComputationService = pathComputationService; + this.rendererServiceOperations = rendererServiceOperations; + this.networkModelWavelengthService = networkModelWavelengthService; this.notificationPublishService = notificationPublishService; } - /* + /** * Method called when the blueprint container is created. */ public void init() { LOG.info("ServicehandlerProvider Session Initiated"); - final ServicehandlerImpl consumer = new ServicehandlerImpl(dataBroker, rpcRegistry, notificationPublishService); - stubPcelistenerRegistration = notificationService.registerNotificationListener(consumer); - stubRendererlistenerRegistration = notificationService.registerNotificationListener(consumer); - rpcRegistration = rpcRegistry.addRpcImplementation(ServicehandlerService.class, consumer); + final PceListenerImpl pceListenerImpl = new PceListenerImpl(rendererServiceOperations, + pathComputationService, notificationPublishService, null); + final RendererListenerImpl rendererListenerImpl = + new RendererListenerImpl(pathComputationService, notificationPublishService); + pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl); + rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl); + final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService, + rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, + networkModelWavelengthService); + rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); } - /* + /** * Method called when the blueprint container is destroyed. */ public void close() { LOG.info("ServicehandlerProvider Closed"); - stubPcelistenerRegistration.close(); - stubRendererlistenerRegistration.close(); + pcelistenerRegistration.close(); + rendererlistenerRegistration.close(); rpcRegistration.close(); } + }