2 * Copyright © 2017 AT&T and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.olm;
11 import org.opendaylight.mdsal.binding.api.RpcProviderService;
12 import org.opendaylight.transportpce.olm.service.OlmPowerService;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
14 import org.opendaylight.yangtools.concepts.ObjectRegistration;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
19 * The Class OlmProvider.
21 public class OlmProvider {
22 private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
23 private final RpcProviderService rpcProviderService;
24 private final OlmPowerService olmPowerService;
25 private ObjectRegistration<TransportpceOlmService> olmRPCRegistration;
28 * Instantiates a new olm provider.
29 * @param olmPowerService
30 * implementation of OlmService
31 * @param rpcProviderService
32 * the rpc provider service
34 public OlmProvider(final RpcProviderService rpcProviderService, final OlmPowerService olmPowerService) {
35 this.rpcProviderService = rpcProviderService;
36 this.olmPowerService = olmPowerService;
40 * Method called when the blueprint container is created.
43 LOG.info("OlmProvider Session Initiated");
44 // Initializing Notification module
45 olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class,
46 new OlmPowerServiceRpcImpl(this.olmPowerService));
50 * Method called when the blueprint container is destroyed.
53 LOG.info("OlmProvider Closed");
54 // Clean up the RPC service registration
55 if (olmRPCRegistration != null) {
56 olmRPCRegistration.close();