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.renderer.rpcs;
11 import com.google.common.collect.ImmutableClassToInstanceMap;
12 import org.opendaylight.mdsal.binding.api.RpcProviderService;
13 import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
14 import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.CreateOtsOms;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.OtnServicePath;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.RendererRollback;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.ServicePath;
19 import org.opendaylight.yangtools.concepts.Registration;
20 import org.opendaylight.yangtools.yang.binding.Rpc;
21 import org.osgi.service.component.annotations.Activate;
22 import org.osgi.service.component.annotations.Component;
23 import org.osgi.service.component.annotations.Deactivate;
24 import org.osgi.service.component.annotations.Reference;
25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory;
28 @Component(immediate = true)
29 public class DeviceRendererRPCImpl {
31 private static final Logger LOG = LoggerFactory.getLogger(DeviceRendererRPCImpl.class);
32 private Registration reg;
35 public DeviceRendererRPCImpl(@Reference RpcProviderService rpcProviderService,
36 @Reference DeviceRendererService deviceRenderer,
37 @Reference OtnDeviceRendererService otnDeviceRendererService) {
38 this.reg = rpcProviderService.registerRpcImplementations(ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
39 .put(ServicePath.class, new ServicePathImpl(deviceRenderer))
40 .put(OtnServicePath.class, new OtnServicePathImpl(otnDeviceRendererService))
41 .put(RendererRollback.class, new RendererRollbackImpl(deviceRenderer))
42 .put(CreateOtsOms.class, new CreateOtsOmsImpl(deviceRenderer))
44 LOG.debug("RPC of DeviceRendererRPCImpl instantiated");
50 LOG.info("DeviceRendererRPCImpl Closed");
53 public Registration getRegisteredRpc() {