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.rpc.impl.CalculateSpanlossBaseImpl;
13 import org.opendaylight.transportpce.olm.rpc.impl.CalculateSpanlossCurrentImpl;
14 import org.opendaylight.transportpce.olm.rpc.impl.GetPmImpl;
15 import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerResetImpl;
16 import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerSetupImpl;
17 import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerTurndownImpl;
18 import org.opendaylight.transportpce.olm.service.OlmPowerService;
19 import org.opendaylight.yangtools.concepts.Registration;
20 import org.osgi.service.component.annotations.Activate;
21 import org.osgi.service.component.annotations.Component;
22 import org.osgi.service.component.annotations.Deactivate;
23 import org.osgi.service.component.annotations.Reference;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
28 * The Class OlmPowerServiceRpcImpl.
31 public class OlmPowerServiceRpcImpl {
32 private static final Logger LOG = LoggerFactory.getLogger(OlmPowerServiceRpcImpl.class);
33 private Registration rpcRegistration;
36 public OlmPowerServiceRpcImpl(@Reference OlmPowerService olmPowerService,
37 @Reference RpcProviderService rpcProviderService) {
38 this.rpcRegistration = rpcProviderService.registerRpcImplementations(
39 new GetPmImpl(olmPowerService),
40 new ServicePowerSetupImpl(olmPowerService),
41 new ServicePowerTurndownImpl(olmPowerService),
42 new CalculateSpanlossBaseImpl(olmPowerService),
43 new CalculateSpanlossCurrentImpl(olmPowerService),
44 new ServicePowerResetImpl(olmPowerService));
45 LOG.info("OlmPowerServiceRpcImpl instantiated");
50 this.rpcRegistration.close();
51 LOG.info("OlmPowerServiceRpcImpl Closed");
54 public Registration getRegisteredRpc() {
55 return rpcRegistration;