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.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
13 import org.opendaylight.yangtools.concepts.ObjectRegistration;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
18 * The Class OlmProvider.
20 public class OlmProvider {
21 private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
22 private final RpcProviderService rpcProviderService;
23 private final TransportpceOlmService olmPowerServiceRpc;
24 private ObjectRegistration<TransportpceOlmService> olmRPCRegistration;
27 * Instantiates a new olm provider.
28 * @param olmPowerServiceRpc
29 * implementation of TransportpceOlmService
30 * @param rpcProviderService
31 * the rpc provider service
33 public OlmProvider(final RpcProviderService rpcProviderService, final TransportpceOlmService olmPowerServiceRpc) {
34 this.rpcProviderService = rpcProviderService;
35 this.olmPowerServiceRpc = olmPowerServiceRpc;
39 * Method called when the blueprint container is created.
42 LOG.info("OlmProvider Session Initiated");
43 // Initializing Notification module
44 olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class,
45 this.olmPowerServiceRpc);
49 * Method called when the blueprint container is destroyed.
52 LOG.info("OlmProvider Closed");
53 // Clean up the RPC service registration
54 if (olmRPCRegistration != null) {
55 olmRPCRegistration.close();