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=1b31874f37a50567ab3ea8e37792cdfa1725ecd0;hb=2a29f9ab006d8806f77b1a1e073b478e5351cc5f;hp=28e8b00215531ac23f5123ebe7a35a17c640ea93;hpb=0779ad5796bb645690874959c9a891c42e2f7175;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 28e8b0021..1b31874f3 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,16 +8,19 @@ 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.transportpce.pce.service.PathComputationService; -import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.NotificationService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +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.transportpce.servicehandler.service.ServiceDataStoreOperations; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.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; @@ -32,21 +35,31 @@ 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 ListenerRegistration pcelistenerRegistration; - private RpcRegistration rpcRegistration; - private PathComputationService pathComputationService; - private RendererServiceOperations rendererServiceOperations; + private ListenerRegistration rendererlistenerRegistration; + private ListenerRegistration networkmodellistenerRegistration; + private ObjectRegistration rpcRegistration; + private ServiceDataStoreOperations serviceDataStoreOperations; + private PceListenerImpl pceListenerImpl; + private RendererListenerImpl rendererListenerImpl; + private NetworkModelListenerImpl networkModelListenerImpl; + private ServicehandlerImpl servicehandler; - public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry, - NotificationService notificationService, PathComputationService pathComputationService, - RendererServiceOperations rendererServiceOperations) { + public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderService rpcProviderService, + NotificationService notificationService, ServiceDataStoreOperations serviceDataStoreOperations, + PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl, + NetworkModelListenerImpl networkModelListenerImpl, ServicehandlerImpl servicehandler) { this.dataBroker = dataBroker; - this.rpcRegistry = rpcProviderRegistry; + this.rpcService = rpcProviderService; this.notificationService = notificationService; - this.pathComputationService = pathComputationService; - this.rendererServiceOperations = rendererServiceOperations; + this.serviceDataStoreOperations = serviceDataStoreOperations; + this.serviceDataStoreOperations.initialize(); + this.pceListenerImpl = pceListenerImpl; + this.rendererListenerImpl = rendererListenerImpl; + this.networkModelListenerImpl = networkModelListenerImpl; + this.servicehandler = servicehandler; } /** @@ -54,10 +67,10 @@ public class ServicehandlerProvider { */ public void init() { LOG.info("ServicehandlerProvider Session Initiated"); - final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService, - rendererServiceOperations); - final PceListenerImpl pceListener = new PceListenerImpl(); - rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); + pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl); + rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl); + networkmodellistenerRegistration = notificationService.registerNotificationListener(networkModelListenerImpl); + rpcRegistration = rpcService.registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); } /** @@ -66,6 +79,8 @@ public class ServicehandlerProvider { public void close() { LOG.info("ServicehandlerProvider Closed"); pcelistenerRegistration.close(); + rendererlistenerRegistration.close(); + networkmodellistenerRegistration.close(); rpcRegistration.close(); }