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.rev170418.TransportpceOlmService;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.slf4j.Logger;
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<OlmService> olmRPCRegistration;
+ private final RpcProviderService rpcProviderService;
+ private final OlmPowerService olmPowerService;
+ private ObjectRegistration<TransportpceOlmService> 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;
}
/**
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));
}
/**
olmRPCRegistration.close();
}
}
-}
\ No newline at end of file
+}