- @Override
- public ListenableFuture<RpcResult<GetAllMeterConfigStatisticsOutput>> call()
- throws Exception {
- final SettableFuture<RpcResult<GetAllMeterConfigStatisticsOutput>> result = SettableFuture.create();
-
- if (taskContext.getSession().getPrimaryConductor().getVersion() == OFConstants.OFP_VERSION_1_0) {
- RpcResult<GetAllMeterConfigStatisticsOutput> rpcResult = RpcResultBuilder.success(
- new GetAllMeterConfigStatisticsOutputBuilder().build()).build();
- return Futures.immediateFuture(rpcResult);
- } else {
- final Long xid = taskContext.getSession().getNextXid();
-
- MultipartRequestMeterConfigCaseBuilder caseBuilder =
- new MultipartRequestMeterConfigCaseBuilder();
- MultipartRequestMeterConfigBuilder mprMeterConfigBuild =
- new MultipartRequestMeterConfigBuilder();
- mprMeterConfigBuild.setMeterId(new MeterId(BinContent.intToUnsignedLong(
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common
- .types.rev130731.Meter.OFPMALL.getIntValue())));
- caseBuilder.setMultipartRequestMeterConfig(mprMeterConfigBuild.build());
-
- MultipartRequestInputBuilder mprInput =
- createMultipartHeader(MultipartType.OFPMPMETERCONFIG, taskContext, xid);
- mprInput.setMultipartRequestBody(caseBuilder.build());
- Future<RpcResult<Void>> resultFromOFLib = getMessageService()
- .multipartRequest(mprInput.build(), getCookie());
- ListenableFuture<RpcResult<Void>> resultLib = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
-
- Futures.addCallback(resultLib, new ResultCallback<GetAllMeterConfigStatisticsOutput>(result) {
- @Override
- public GetAllMeterConfigStatisticsOutput createResult() {
- GetAllMeterConfigStatisticsOutputBuilder allMeterConfStatBuilder =
- new GetAllMeterConfigStatisticsOutputBuilder()
- .setTransactionId(new TransactionId(BigInteger.valueOf(xid)));
- return allMeterConfStatBuilder.build();
- }
- });
- return result;
- }
- }
- };
- return task;
- }
-
- /**
+ public OFRpcTaskImpl(OFRpcTaskContext taskContext, SwitchConnectionDistinguisher cookie,
+ GetAllMeterConfigStatisticsInput input) {
+ super(taskContext, cookie, input);
+ }
+
+ @Override
+ public ListenableFuture<RpcResult<GetAllMeterConfigStatisticsOutput>> call()
+ throws Exception {
+ final SettableFuture<RpcResult<GetAllMeterConfigStatisticsOutput>> result = SettableFuture.create();
+
+ if (taskContext.getSession().getPrimaryConductor().getVersion() == OFConstants.OFP_VERSION_1_0) {
+ RpcResult<GetAllMeterConfigStatisticsOutput> rpcResult = RpcResultBuilder.success(
+ new GetAllMeterConfigStatisticsOutputBuilder().build()).build();
+ return Futures.immediateFuture(rpcResult);
+ } else {
+ final Long xid = taskContext.getSession().getNextXid();
+
+ MultipartRequestMeterConfigCaseBuilder caseBuilder =
+ new MultipartRequestMeterConfigCaseBuilder();
+ MultipartRequestMeterConfigBuilder mprMeterConfigBuild =
+ new MultipartRequestMeterConfigBuilder();
+ mprMeterConfigBuild.setMeterId(new MeterId(BinContent.intToUnsignedLong(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common
+ .types.rev130731.Meter.OFPMALL.getIntValue())));
+ caseBuilder.setMultipartRequestMeterConfig(mprMeterConfigBuild.build());
+
+ MultipartRequestInputBuilder mprInput =
+ createMultipartHeader(MultipartType.OFPMPMETERCONFIG, taskContext, xid);
+ mprInput.setMultipartRequestBody(caseBuilder.build());
+ Future<RpcResult<Void>> resultFromOFLib = getMessageService()
+ .multipartRequest(mprInput.build(), getCookie());
+ ListenableFuture<RpcResult<Void>> resultLib = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
+
+ Futures.addCallback(resultLib, new ResultCallback<GetAllMeterConfigStatisticsOutput>(result) {
+ @Override
+ public GetAllMeterConfigStatisticsOutput createResult() {
+ GetAllMeterConfigStatisticsOutputBuilder allMeterConfStatBuilder =
+ new GetAllMeterConfigStatisticsOutputBuilder()
+ .setTransactionId(new TransactionId(BigInteger.valueOf(xid)));
+ return allMeterConfStatBuilder.build();
+ }
+ });
+ return result;
+ }
+ }
+ }
+
+ return new OFRpcTaskImpl(taskContext, cookie, input);
+ }
+
+ /**