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=47944d10ad174cc2852b403ff6437993fba13f65;hb=c3212dea41910175d12de2732d36d0b6943beb2d;hp=250c5ee83abf9239d61d6bda2844d46508810d94;hpb=af11c4d587728af1442eeefa27153226bdde31e1;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 250c5ee83..47944d10a 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 @@ -9,13 +9,17 @@ package org.opendaylight.transportpce.servicehandler.impl; import org.opendaylight.controller.md.sal.binding.api.DataBroker; +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.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.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceListener; +import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.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; @@ -34,19 +38,26 @@ public class ServicehandlerProvider { private final DataBroker dataBroker; private final RpcProviderRegistry rpcRegistry; private final NotificationService notificationService; - private ListenerRegistration pcelistenerRegistration; + private final NetworkModelWavelengthService networkModelWavelengthService; + private final NotificationPublishService notificationPublishService; + private ListenerRegistration pcelistenerRegistration; + private ListenerRegistration rendererlistenerRegistration; private RpcRegistration rpcRegistration; private PathComputationService pathComputationService; private RendererServiceOperations rendererServiceOperations; public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry, NotificationService notificationService, PathComputationService pathComputationService, - RendererServiceOperations rendererServiceOperations) { + 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; } /** @@ -54,10 +65,15 @@ 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); + pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl); + rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl); final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService, - rendererServiceOperations); - final PceListenerImpl pceListener = new PceListenerImpl(); - pcelistenerRegistration = notificationService.registerNotificationListener(pceListener); + rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, + networkModelWavelengthService); rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); } @@ -67,6 +83,7 @@ public class ServicehandlerProvider { public void close() { LOG.info("ServicehandlerProvider Closed"); pcelistenerRegistration.close(); + rendererlistenerRegistration.close(); rpcRegistration.close(); }