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 com.google.common.util.concurrent.Futures;
12 import com.google.common.util.concurrent.ListenableFuture;
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 public class GlobalBindingRTCServer implements RpcbenchPayloadService {
27 private static final Logger LOG = LoggerFactory.getLogger(GlobalBindingRTCServer.class);
28 private int numRpcs = 0;
30 public GlobalBindingRTCServer() {
31 LOG.debug("GlobalBindingRTCServer created.");
35 public ListenableFuture<RpcResult<GlobalRpcBenchOutput>> globalRpcBench(final GlobalRpcBenchInput input) {
36 GlobalRpcBenchOutput output = new GlobalRpcBenchOutputBuilder(input).build();
37 RpcResult<GlobalRpcBenchOutput> result = RpcResultBuilder.success(output).build();
39 return Futures.immediateFuture(result);
43 public ListenableFuture<RpcResult<RoutedRpcBenchOutput>> routedRpcBench(final RoutedRpcBenchInput input) {
44 RoutedRpcBenchOutput output = new RoutedRpcBenchOutputBuilder(input).build();
45 RpcResult<RoutedRpcBenchOutput> result = RpcResultBuilder.success(output).build();
47 return Futures.immediateFuture(result);
50 public int getNumRpcs() {