From: Alessandro Boch Date: Tue, 9 Jul 2013 02:07:45 +0000 (-0700) Subject: Fix for the "without any protocolPluginType provided" error X-Git-Tag: releasepom-0.1.0~304^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=e040c4e90445b4e67b4b9a281a17b974bec80a13 Fix for the "without any protocolPluginType provided" error CHANGE: Add a global constant for the "protocolPluginType" key to prevent the key mispell issue again Change-Id: Icb76cf8775881d41c1792e0c5ce59925276b7e8e Signed-off-by: Alessandro Boch --- diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Activator.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Activator.java index a93a8b7243..54c61b89ab 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Activator.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Activator.java @@ -143,7 +143,7 @@ public class Activator extends ComponentActivatorAbstractBase { Dictionary props = new Hashtable(); // 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 props = new Hashtable(); // 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 props = new Hashtable(); // 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 props = new Hashtable(); // 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(), diff --git a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java index 614e70b1b8..76c38664d4 100644 --- a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java +++ b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java @@ -90,7 +90,7 @@ public class Activator extends ComponentActivatorAbstractBase { Dictionary props = new Hashtable(); // 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 props = new Hashtable(); // 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 props = new Hashtable(); // 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 props = new Hashtable(); // 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 props = new Hashtable(); // 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); } diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java index 0ebf633c55..174f2546ba 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java @@ -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; diff --git a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java index 41e4d2a7fc..6cab6b9b4f 100644 --- a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java +++ b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java @@ -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 diff --git a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java index a9eefd3a8a..eef4359234 100644 --- a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java +++ b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java @@ -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; } diff --git a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java index d6feebd4a3..369588c0c4 100644 --- a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java +++ b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java @@ -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; } diff --git a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java index fce0a39719..edc9117389 100644 --- a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java +++ b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java @@ -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; }