2 * Copyright © 2018 Orange Systems, 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.olm.stub;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.ArrayList;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
19 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
20 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
21 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
22 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
23 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutputBuilder;
24 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
25 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
26 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder;
27 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
28 import org.opendaylight.yangtools.yang.common.RpcResult;
29 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
31 public class OlmServiceStub implements TransportpceOlmService {
33 @Override public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
34 CalculateSpanlossCurrentInput input) {
38 @Override public ListenableFuture<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
39 GetPmOutput output = new GetPmOutputBuilder()
40 .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
41 return RpcResultBuilder.success(
42 output).buildFuture();
45 @Override public ListenableFuture<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(
46 ServicePowerTurndownInput input) {
47 return RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
48 .setResult("Success").build()).buildFuture();
51 @Override public ListenableFuture<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(
52 CalculateSpanlossBaseInput input) {
56 @Override public ListenableFuture<RpcResult<ServicePowerResetOutput>> servicePowerReset(
57 ServicePowerResetInput input) {
61 @Override public ListenableFuture<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(
62 ServicePowerSetupInput input) {
63 return RpcResultBuilder.success(new ServicePowerSetupOutputBuilder().build()).buildFuture();