- OFRpcTask<GetAllFlowStatisticsFromFlowTableInput, RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> task =
- new OFRpcTask<GetAllFlowStatisticsFromFlowTableInput, RpcResult<GetAllFlowStatisticsFromFlowTableOutput>>(taskContext, cookie, input) {
-
- @Override
- public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> call() throws Exception {
- final SettableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> result = SettableFuture.create();
-
- final Long xid = taskContext.getSession().getNextXid();
-
- MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
- MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
- mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
- mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
- mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
- mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
- mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
- FlowCreatorUtil.setWildcardedFlowMatch(taskContext.getSession()
- .getPrimaryConductor().getVersion(), mprFlowRequestBuilder);
-
- MultipartRequestInputBuilder mprInput =
- createMultipartHeader(MultipartType.OFPMPFLOW, taskContext, xid);
- mprInput.setMultipartRequestBody(multipartRequestFlowCaseBuilder.build());
- Future<RpcResult<Void>> resultFromOFLib = getMessageService()
- .multipartRequest(mprInput.build(), getCookie());
- ListenableFuture<RpcResult<Void>> resultLib = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
-
- Futures.addCallback(resultLib, new ResultCallback<GetAllFlowStatisticsFromFlowTableOutput>(result) {
- @Override
- public GetAllFlowStatisticsFromFlowTableOutput createResult() {
- GetAllFlowStatisticsFromFlowTableOutputBuilder allFlowStatsFromFlowTableBuilder =
- new GetAllFlowStatisticsFromFlowTableOutputBuilder()
- .setTransactionId(new TransactionId(BigInteger.valueOf(xid)));
- return allFlowStatsFromFlowTableBuilder.build();
- }
- });
- return result;
+ class OFRpcTaskImpl extends OFRpcTask<GetAllFlowStatisticsFromFlowTableInput, RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> {
+
+ public OFRpcTaskImpl(OFRpcTaskContext taskContext, SwitchConnectionDistinguisher cookie,
+ GetAllFlowStatisticsFromFlowTableInput input) {
+ super(taskContext, cookie, input);
+ }
+
+ @Override
+ public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> call() throws Exception {
+ final SettableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> result = SettableFuture.create();
+
+ final Long xid = taskContext.getSession().getNextXid();
+
+ MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
+ mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
+ mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
+ mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
+ mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
+ mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
+ FlowCreatorUtil.setWildcardedFlowMatch(taskContext.getSession()
+ .getPrimaryConductor().getVersion(), mprFlowRequestBuilder);
+
+ MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
+ multipartRequestFlowCaseBuilder.setMultipartRequestFlow(mprFlowRequestBuilder.build());
+
+ MultipartRequestInputBuilder mprInput =
+ createMultipartHeader(MultipartType.OFPMPFLOW, taskContext, xid);
+ mprInput.setMultipartRequestBody(multipartRequestFlowCaseBuilder.build());
+ Future<RpcResult<Void>> resultFromOFLib = getMessageService()
+ .multipartRequest(mprInput.build(), getCookie());
+ ListenableFuture<RpcResult<Void>> resultLib = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
+
+ Futures.addCallback(resultLib, new ResultCallback<GetAllFlowStatisticsFromFlowTableOutput>(result) {
+ @Override
+ public GetAllFlowStatisticsFromFlowTableOutput createResult() {
+ GetAllFlowStatisticsFromFlowTableOutputBuilder allFlowStatsFromFlowTableBuilder =
+ new GetAllFlowStatisticsFromFlowTableOutputBuilder()
+ .setTransactionId(new TransactionId(BigInteger.valueOf(xid)));
+ return allFlowStatsFromFlowTableBuilder.build();