Fix for the "without any protocolPluginType provided" error 77/577/2
authorAlessandro Boch <aboch@cisco.com>
Tue, 9 Jul 2013 02:07:45 +0000 (19:07 -0700)
committerAlessandro Boch <aboch@cisco.com>
Tue, 9 Jul 2013 02:34:30 +0000 (19:34 -0700)
CHANGE: Add a global constant for the "protocolPluginType" key to prevent the key mispell issue again

Change-Id: Icb76cf8775881d41c1792e0c5ce59925276b7e8e
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Activator.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java

index a93a8b7243cede7e2d81d212160dbe7a97806539..54c61b89abc7b951076741b5cf37e8e3c9f3cd79 100644 (file)
@@ -143,7 +143,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
             c.setInterface(IPluginInDataPacketService.class.getName(), props);
             // Hook the services coming in from SAL, as optional in
             // case SAL is not yet there, could happen
@@ -167,7 +167,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
             c.setInterface(IPluginInReadService.class.getName(), props);
             c.add(createServiceDependency()
                     .setService(IPluginReadServiceFilter.class)
@@ -180,7 +180,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
             c.setInterface(IFlowProgrammerNotifier.class.getName(), props);
 
             c.add(createContainerServiceDependency(containerName)
@@ -233,7 +233,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
             c.setInterface(
                     new String[] {
                             IPluginInFlowProgrammerService.class.getName(),
index 614e70b1b859b0e23c7500549f776dd961558d53..76c38664d4d44adde2e799d1f5ff595702aa0c67 100644 (file)
@@ -90,7 +90,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", "STUB");
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "STUB");
             c.setInterface(IPluginInReadService.class.getName(), props);
         }
 
@@ -99,7 +99,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", "STUB");
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "STUB");
             c.setInterface(IPluginInInventoryService.class.getName(), props);
         }
     }
@@ -115,7 +115,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", "STUB");
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "STUB");
             c.setInterface(IPluginInFlowProgrammerService.class.getName(), props);
         }
         if (imp.equals(StubNodeFactory.class)) {
@@ -123,7 +123,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", "STUB");
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "STUB");
             props.put("protocolName", "STUB");
             c.setInterface(INodeFactory.class.getName(), props);
         }
@@ -132,7 +132,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             Dictionary<String, Object> props = new Hashtable<String, Object>();
             // Set the protocolPluginType property which will be used
             // by SAL
-            props.put("protocolPluginType", "STUB");
+            props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "STUB");
             props.put("protocolName", "STUB");
             c.setInterface(INodeConnectorFactory.class.getName(), props);
         }
index 0ebf633c55c123b742f8ba5365905f372f328b02..174f2546bad1039f87352b5e0a8bd129ad383732 100644 (file)
@@ -19,7 +19,8 @@ public enum GlobalConstants {
     CONTAINERNAME("name"),
     STATICVLAN("staticvlan"),
     CLUSTERINGSERVICES("clusteringservices"),
-    STARTUPHOME("configuration/startup/");
+    STARTUPHOME("configuration/startup/"),
+    PROTOCOLPLUGINTYPE("protocolPluginType");
 
     private GlobalConstants(String name) {
         this.name = name;
index 41e4d2a7fcb30247bdb9a95c5f8c014bfd69389a..6cab6b9b4f8b0cf8c774f021e8487fd13365aedc 100644 (file)
@@ -40,6 +40,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * are done by the ComponentActivatorAbstractBase.
      *
      */
+    @Override
     public void init() {
 
     }
@@ -49,6 +50,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * ComponentActivatorAbstractBase
      *
      */
+    @Override
     public void destroy() {
 
     }
@@ -62,6 +64,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      *         instantiated in order to get an fully working implementation
      *         Object
      */
+    @Override
     public Object[] getImplementations() {
         Object[] res = { Topology.class, Inventory.class,
                 FlowProgrammerService.class, ReadService.class,
@@ -84,6 +87,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      *            per-container different behavior if needed, usually should not
      *            be the case though.
      */
+    @Override
     public void configureInstance(Component c, Object imp, String containerName) {
         if (imp.equals(Topology.class)) {
             // export the service for Apps and Plugins
index a9eefd3a8a689d8b4d92bd76fc4ec0edf1198193..eef43592341d69a68cc9b0f2780fef3e695856b4 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.controller.sal.packet.LinkEncap;
 import org.opendaylight.controller.sal.packet.Packet;
 import org.opendaylight.controller.sal.packet.PacketResult;
 import org.opendaylight.controller.sal.packet.RawPacket;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.NetUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -217,7 +218,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
             logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
-        Object value = props.get("protocolPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
@@ -243,7 +244,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
             logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
-        Object value = props.get("protocoloPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
index d6feebd4a3067a057af0a7991dcf82613f2f5995..369588c0c4169eb74dd0ca38fd58d3a6b1d95bc1 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;
@@ -129,7 +130,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
                     entry.getValue());
         }
 
-        Object value = props.get("protocolPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
@@ -156,7 +157,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
                     entry.getValue());
         }
 
-        Object value = props.get("protocoloPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
index fce0a39719234a58e1d37c98b5d84d3ae67fe6d7..edc91173890970b12680fa27628fe378a9ba1490 100644 (file)
@@ -38,6 +38,7 @@ import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
 import org.opendaylight.controller.sal.reader.NodeDescription;
 import org.opendaylight.controller.sal.reader.NodeTableStatistics;
 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.NodeCreator;
@@ -116,7 +117,7 @@ public class ReadService implements IReadService, CommandProvider {
                     entry.getValue());
         }
 
-        Object value = props.get("protocolPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }
@@ -143,7 +144,7 @@ public class ReadService implements IReadService, CommandProvider {
                     entry.getValue());
         }
 
-        Object value = props.get("protocoloPluginType");
+        Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
         if (value instanceof String) {
             type = (String) value;
         }