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