@Override public Future<RpcResult<UpdateMeterOutput>> meterMod(final MeterModInput input, SwitchConnectionDistinguisher cookie) { LOG.debug("Calling OFLibrary meterMod"); Future<RpcResult<Void>> response = null; try { response = getConnectionAdapter(cookie).meterMod(input); } catch (ConnectionException e) { return RpcResultUtil.getRpcErrorFuture(e); } // appending xid ListenableFuture<RpcResult<UpdateMeterOutput>> xidResult = Futures.transform( JdkFutureAdapters.listenInPoolThread(response), new Function<RpcResult<Void>, RpcResult<UpdateMeterOutput>>() { @Override public RpcResult<UpdateMeterOutput> apply(final RpcResult<Void> inputArg) { UpdateMeterOutputBuilder meterModOutput = new UpdateMeterOutputBuilder(); BigInteger bigIntXid = BigInteger.valueOf(input.getXid()); meterModOutput.setTransactionId(new TransactionId(bigIntXid)); UpdateMeterOutput result = meterModOutput.build(); RpcResult<UpdateMeterOutput> rpcResult = RpcResultBuilder .<UpdateMeterOutput>status(inputArg.isSuccessful()).withResult(result) .withRpcErrors(inputArg.getErrors()).build(); return rpcResult; } }); return xidResult; }
connectionAdapter.meterMod((MeterModInput) msg);