Fix null value put in FRM incativeFlows hash map
[controller.git] / opendaylight / sal / implementation / src / main / java / org / opendaylight / controller / sal / implementation / internal / FlowProgrammerService.java
index d6feebd4a3067a057af0a7991dcf82613f2f5995..a7bdb9da8bf32072b73b45a3128b412b9f18f88a 100644 (file)
@@ -38,6 +38,7 @@ import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerSe
 import org.opendaylight.controller.sal.match.Match;
 import org.opendaylight.controller.sal.match.MatchType;
 import org.opendaylight.controller.sal.utils.EtherTypes;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IPProtocols;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.Status;
@@ -115,21 +116,21 @@ public class FlowProgrammerService implements IFlowProgrammerService,
     }
 
     // Set the reference to the plugin flow programmer
-    public void setService(Map props, IPluginInFlowProgrammerService s) {
+    public void setService(Map<String, Object> props, IPluginInFlowProgrammerService s) {
         if (this.pluginFlowProgrammer == null) {
             logger.error("pluginFlowProgrammer store null");
             return;
         }
 
-        logger.trace("Got a service set request {}", s);
-        String type = null;
-        for (Object e : props.entrySet()) {
-            Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:({}) value:({})", entry.getKey(),
-                    entry.getValue());
+        if (logger.isTraceEnabled()) {
+            logger.trace("Got a service set request {}", s);
+            for (Map.Entry<String, Object> entry : props.entrySet()) {
+                logger.trace("Prop key:({}) value:({})", entry.getKey(), entry.getValue());
+            }
         }
 
-        Object value = props.get("protocolPluginType");
+        String type = null;
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
@@ -142,21 +143,22 @@ public class FlowProgrammerService implements IFlowProgrammerService,
         }
     }
 
-    public void unsetService(Map props, IPluginInFlowProgrammerService s) {
+    public void unsetService(Map<String, Object> props, IPluginInFlowProgrammerService s) {
         if (this.pluginFlowProgrammer == null) {
             logger.error("pluginFlowProgrammer store null");
             return;
         }
 
-        String type = null;
         logger.debug("Received unsetpluginFlowProgrammer request");
-        for (Object e : props.entrySet()) {
-            Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:({}) value:({})", entry.getKey(),
-                    entry.getValue());
+        if (logger.isTraceEnabled()) {
+            logger.trace("Got a service set request {}", s);
+            for (Map.Entry<String, Object> entry : props.entrySet()) {
+                logger.trace("Prop key:({}) value:({})", entry.getKey(), entry.getValue());
+            }
         }
 
-        Object value = props.get("protocoloPluginType");
+        String type = null;
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }