X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=olm%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Folm%2FOlmProvider.java;h=db2865167ea053f03ff0185692c4b163ccfe77dc;hb=a8cbc775799b33a13f563f073c287fddc9f51000;hp=6325d333d04a6384ada21eb518757833f44d8a55;hpb=c28ecb3f1e25f12a69f0925d7682e0e6024381e2;p=transportpce.git diff --git a/olm/src/main/java/org/opendaylight/transportpce/olm/OlmProvider.java b/olm/src/main/java/org/opendaylight/transportpce/olm/OlmProvider.java index 6325d333d..db2865167 100644 --- a/olm/src/main/java/org/opendaylight/transportpce/olm/OlmProvider.java +++ b/olm/src/main/java/org/opendaylight/transportpce/olm/OlmProvider.java @@ -8,11 +8,10 @@ package org.opendaylight.transportpce.olm; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.MountPointService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.transportpce.olm.service.OlmPowerService; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService; +import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,40 +19,21 @@ import org.slf4j.LoggerFactory; * The Class OlmProvider. */ public class OlmProvider { - - /** The Constant LOG. */ private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class); - - /** The data broker. */ - private final DataBroker dataBroker; - - /** The mount point service. */ - private final MountPointService mountPointService; - - /** The rpc provider registry. */ - private final RpcProviderRegistry rpcProviderRegistry; - - /** The get pm registration. */ - private RpcRegistration olmRPCRegistration; + private final RpcProviderService rpcProviderService; + private final OlmPowerService olmPowerService; + private ObjectRegistration olmRPCRegistration; /** * Instantiates a new olm provider. - * - * @param dataBroker - * the data broker - * @param mountPointService - * the mount point service - * @param rpcProviderRegistry - * the rpc provider registry + * @param olmPowerService + * implementation of OlmService + * @param rpcProviderService + * the rpc provider service */ - public OlmProvider(final DataBroker dataBroker, final MountPointService mountPointService, - final RpcProviderRegistry rpcProviderRegistry) { - this.dataBroker = dataBroker; - this.mountPointService = mountPointService; - this.rpcProviderRegistry = rpcProviderRegistry; - if (mountPointService == null) { - LOG.error("Mount service is null"); - } + public OlmProvider(final RpcProviderService rpcProviderService, final OlmPowerService olmPowerService) { + this.rpcProviderService = rpcProviderService; + this.olmPowerService = olmPowerService; } /** @@ -62,18 +42,18 @@ public class OlmProvider { public void init() { LOG.info("OlmProvider Session Initiated"); // Initializing Notification module - olmRPCRegistration = rpcProviderRegistry.addRpcImplementation(OlmService.class, new OlmPowerSetupImpl( - dataBroker,mountPointService)); + olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class, + new OlmPowerServiceRpcImpl(this.olmPowerService)); } /** * Method called when the blueprint container is destroyed. */ public void close() { - LOG.info("RendererProvider Closed"); + LOG.info("OlmProvider Closed"); // Clean up the RPC service registration if (olmRPCRegistration != null) { olmRPCRegistration.close(); } } -} \ No newline at end of file +}