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