2 * Copyright © 2024 Orange, Inc. and others. All rights reserved.
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
8 package org.opendaylight.transportpce.olm.rpc.impl;
10 import static java.util.Objects.requireNonNull;
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.CalculateSpanlossCurrent;
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.yangtools.yang.common.RpcResult;
18 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
21 public class CalculateSpanlossCurrentImpl implements CalculateSpanlossCurrent {
22 private final OlmPowerService olmPowerService;
24 public CalculateSpanlossCurrentImpl(final OlmPowerService olmPowerService) {
25 this.olmPowerService = requireNonNull(olmPowerService);
29 public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> invoke(CalculateSpanlossCurrentInput input) {
30 return RpcResultBuilder.success(this.olmPowerService.calculateSpanlossCurrent(input)).buildFuture();