Merge "Bug 5596 Cleaning part 3"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / translator / FlowRemovedTranslator.java
index c72a6b79e2b845ad4852359378192680fe9f3a7f..eb9ff12296554045022cffdf270f6c08fc0be45f 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowplugin.impl.translator;
 import java.util.Optional;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
@@ -22,6 +22,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  * translate {@link FlowRemoved} message to FlowRemoved notification (omit instructions)
  */
 public class FlowRemovedTranslator implements MessageTranslator<FlowRemoved, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved> {
+    private final ConvertorExecutor convertorExecutor;
+
+    public FlowRemovedTranslator(ConvertorExecutor convertorExecutor) {
+        this.convertorExecutor = convertorExecutor;
+    }
+
+    protected ConvertorExecutor getConvertorExecutor() {
+        return convertorExecutor;
+    }
 
     @Override
     public org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved translate(FlowRemoved input, DeviceInfo deviceInfo, Object connectionDistinguisher) {
@@ -39,7 +48,7 @@ public class FlowRemovedTranslator implements MessageTranslator<FlowRemoved, org
         final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(deviceInfo.getVersion());
         datapathIdConvertorData.setDatapathId(deviceInfo.getDatapathId());
 
-        final Optional<MatchBuilder> matchBuilderOptional = ConvertorManager.getInstance().convert(
+        final Optional<MatchBuilder> matchBuilderOptional = getConvertorExecutor().convert(
                 flowRemoved.getMatch(),
                 datapathIdConvertorData);