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
8 package org.opendaylight.transportpce.renderer.rpcs;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.transportpce.renderer.ModelMappingUtils;
12 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.TransportpceRendererService;
18 import org.opendaylight.yangtools.yang.common.RpcResult;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
22 public class TransportPCEServicePathRPCImpl implements TransportpceRendererService {
24 private static final Logger LOG = LoggerFactory.getLogger(TransportPCEServicePathRPCImpl.class);
26 private final RendererServiceOperations rendererServiceOperations;
28 public TransportPCEServicePathRPCImpl(RendererServiceOperations rendererServiceOperations) {
29 this.rendererServiceOperations = rendererServiceOperations;
33 public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
34 String serviceName = input.getServiceName();
35 LOG.info("Calling RPC service delete request {} {}", serviceName);
36 return ModelMappingUtils
37 .createServiceDeleteRpcResponse(this.rendererServiceOperations.serviceDelete(input));
41 public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
42 ServiceImplementationRequestInput input) {
43 String serviceName = input.getServiceName();
44 LOG.info("Calling RPC service impl request {} {}", serviceName);
45 return ModelMappingUtils
46 .createServiceImplementationRpcResponse(this.rendererServiceOperations.serviceImplementation(input));