Bump upstream dependencies to Ca
[transportpce.git] / olm / src / main / java / org / opendaylight / transportpce / olm / rpc / impl / ServicePowerTurndownImpl.java
1 /*
2  * Copyright © 2024 Orange, 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.rpc.impl;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.opendaylight.transportpce.olm.service.OlmPowerService;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndown;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndownInput;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndownOutput;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
18 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
19
20 /**
21  * This class is the implementation of the 'service-power-trundown' RESTCONF service, which
22  * is one of the external APIs into the olm application.
23  *
24  * <p>
25  * 1. service-power-turndown: This operation performs following steps:
26  *    Step1: For each TP within Node sets interface outofservice .
27  *    Step2: For each roam-connection sets power to -60dbm
28  *    Step3: Turns power mode off
29  *
30  * <p>
31  * The signature for this method was generated by yang tools from the
32  * olm API model.
33  */
34 public class ServicePowerTurndownImpl implements ServicePowerTurndown {
35     private final OlmPowerService olmPowerService;
36
37     public ServicePowerTurndownImpl(final OlmPowerService olmPowerService) {
38         this.olmPowerService = requireNonNull(olmPowerService);
39     }
40
41     @Override
42     public ListenableFuture<RpcResult<ServicePowerTurndownOutput>> invoke(ServicePowerTurndownInput input) {
43         return RpcResultBuilder.success(this.olmPowerService.servicePowerTurndown(input)).buildFuture();
44     }
45
46 }