96803ef066f356dea0df9dc695856e2d12905d1f
[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
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
17 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
18 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
19 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
20 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
21 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
22 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
23 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
24 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutputBuilder;
25 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
26 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
27 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder;
28 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
29 import org.opendaylight.yangtools.yang.common.RpcResult;
30 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
31
32 public class OlmServiceStub implements TransportpceOlmService {
33
34     @Override public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
35         CalculateSpanlossCurrentInput input) {
36         return null;
37     }
38
39     @Override public ListenableFuture<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
40         GetPmOutput output = new GetPmOutputBuilder()
41             .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
42         return RpcResultBuilder.success(
43             output).buildFuture();
44     }
45
46     @Override public ListenableFuture<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(
47         ServicePowerTurndownInput input) {
48         return RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
49                 .setResult("Success").build()).buildFuture();
50     }
51
52     @Override public ListenableFuture<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(
53         CalculateSpanlossBaseInput input) {
54         return null;
55     }
56
57     @Override public ListenableFuture<RpcResult<ServicePowerResetOutput>> servicePowerReset(
58             ServicePowerResetInput input) {
59         return null;
60     }
61
62     @Override public ListenableFuture<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(
63             ServicePowerSetupInput input) {
64         return RpcResultBuilder.success(new ServicePowerSetupOutputBuilder().build()).buildFuture();
65     }
66 }