Merge "Rework bit-copying functions and re-enable tests"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / direct / AbstractFlowDirectStatisticsService.java
index a1656f289f2ce043af41accbf14ebe92b3682d9b..fb8181797a3dde9cef4d0dccacf7b629f17b371d 100644 (file)
@@ -8,14 +8,12 @@
 
 package org.opendaylight.openflowplugin.impl.statistics.services.direct;
 
-import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
 import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
 import org.opendaylight.openflowplugin.impl.registry.flow.FlowRegistryKeyFactory;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchReactor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -26,9 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.f
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatisticsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder;
 
 /**
  * The Flow direct statistics service.
@@ -43,50 +38,9 @@ public abstract class AbstractFlowDirectStatisticsService<T extends OfHeader>
         super(MultipartType.OFPMPFLOW, requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
     }
 
-    @Override
-    public MultipartRequestBody buildRequestBody(GetFlowStatisticsInput input) {
-        final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
-
-        if (input.getTableId() != null) {
-            mprFlowRequestBuilder.setTableId(input.getTableId());
-        } else {
-            mprFlowRequestBuilder.setTableId(OFConstants.OFPTT_ALL);
-        }
-
-        if (input.getOutPort() != null) {
-            mprFlowRequestBuilder.setOutPort(input.getOutPort().longValue());
-        } else {
-            mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
-        }
-
-        if (input.getOutGroup() != null) {
-            mprFlowRequestBuilder.setOutGroup(input.getOutGroup());
-        } else {
-            mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
-        }
-
-        if (input.getCookie() != null) {
-            mprFlowRequestBuilder.setCookie(input.getCookie().getValue());
-        } else {
-            mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
-        }
-
-        if (input.getCookieMask() != null) {
-            mprFlowRequestBuilder.setCookieMask(input.getCookieMask().getValue());
-        } else {
-            mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
-        }
-
-        MatchReactor.getInstance().convert(input.getMatch(), getVersion(), mprFlowRequestBuilder, getConvertorExecutor());
-
-        return new MultipartRequestFlowCaseBuilder()
-                .setMultipartRequestFlow(mprFlowRequestBuilder.build())
-                .build();
-    }
-
     /**
      * Get flow ID from #{@link org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry} or
-     * create alien ID
+     * create alien ID.
      * @param flowStatistics flow statistics
      * @return generated flow ID
      */