2 * Copyright © 2018 Orange, Inc. 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.servicehandler.stub;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.concurrent.ExecutionException;
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.yangtools.yang.common.RpcResult;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 public class StubRendererServiceOperations implements RendererServiceOperations {
22 private static final Logger LOG = LoggerFactory.getLogger(StubRendererServiceOperations.class);
25 public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
26 ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> rpcResultFuture = StubrendererImpl
27 .serviceImplementation(input);
29 return rpcResultFuture.get().getResult();
30 } catch (InterruptedException e) {
31 LOG.error("RPC serviceImplementation failed !",e);
32 } catch (ExecutionException e) {
33 LOG.error("RPC serviceImplementation failed !",e);
39 public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
40 ListenableFuture<RpcResult<ServiceDeleteOutput>> rpcResultFuture = StubrendererImpl.serviceDelete(input);
42 return rpcResultFuture.get().getResult();
43 } catch (InterruptedException e) {
44 LOG.error("RPC serviceDelete failed !",e);
45 } catch (ExecutionException e) {
46 LOG.error("RPC serviceDelete failed !",e);