e832f3b1fac756a47a310bf267183d4b202b394b
[transportpce.git] / olm / src / test / java / org / opendaylight / transportpce / olm / stub / OlmServiceStub.java
1 /*
2  * Copyright © 2018 Orange Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.transportpce.olm.stub;
9
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.rev210618.CalculateSpanlossBaseInput;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.CalculateSpanlossBaseOutput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.CalculateSpanlossCurrentInput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.CalculateSpanlossCurrentOutput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.GetPmInput;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.GetPmOutput;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.GetPmOutputBuilder;
19 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerResetInput;
20 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerResetOutput;
21 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetupInput;
22 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetupOutput;
23 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetupOutputBuilder;
24 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndownInput;
25 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndownOutput;
26 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndownOutputBuilder;
27 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
28 import org.opendaylight.yangtools.yang.common.RpcResult;
29 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
30
31 public class OlmServiceStub implements TransportpceOlmService {
32
33     @Override public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
34         CalculateSpanlossCurrentInput input) {
35         return null;
36     }
37
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();
43     }
44
45     @Override public ListenableFuture<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(
46         ServicePowerTurndownInput input) {
47         return RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
48                 .setResult("Success").build()).buildFuture();
49     }
50
51     @Override public ListenableFuture<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(
52         CalculateSpanlossBaseInput input) {
53         return null;
54     }
55
56     @Override public ListenableFuture<RpcResult<ServicePowerResetOutput>> servicePowerReset(
57             ServicePowerResetInput input) {
58         return null;
59     }
60
61     @Override public ListenableFuture<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(
62             ServicePowerSetupInput input) {
63         return RpcResultBuilder.success(new ServicePowerSetupOutputBuilder().build()).buildFuture();
64     }
65 }