2 * Copyright (c) 2015 Cisco Systems 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
9 package rpcbenchmark.impl;
11 import java.util.concurrent.Future;
13 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.GlobalRpcBenchInput;
14 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.GlobalRpcBenchOutput;
15 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.GlobalRpcBenchOutputBuilder;
16 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBenchInput;
17 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBenchOutput;
18 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBenchOutputBuilder;
19 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RpcbenchPayloadService;
20 import org.opendaylight.yangtools.yang.common.RpcResult;
21 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
25 import com.google.common.util.concurrent.Futures;
27 public class GlobalBindingRTCServer implements RpcbenchPayloadService {
29 private static final Logger LOG = LoggerFactory.getLogger(GlobalBindingRTCServer.class);
30 private int numRpcs = 0;
32 public GlobalBindingRTCServer() {
33 LOG.debug("GlobalBindingRTCServer created.");
37 public Future<RpcResult<GlobalRpcBenchOutput>> globalRpcBench(
38 GlobalRpcBenchInput input) {
39 GlobalRpcBenchOutput output = new GlobalRpcBenchOutputBuilder(input).build();
40 RpcResult<GlobalRpcBenchOutput> result = RpcResultBuilder.success(output).build();
42 return Futures.immediateFuture(result);
46 public Future<RpcResult<RoutedRpcBenchOutput>> routedRpcBench(
47 RoutedRpcBenchInput input) {
48 RoutedRpcBenchOutput output = new RoutedRpcBenchOutputBuilder(input).build();
49 RpcResult<RoutedRpcBenchOutput> result = RpcResultBuilder.success(output).build();
51 return Futures.immediateFuture(result);
54 public int getNumRpcs() {