import org.apache.felix.dm.Component;
import org.opendaylight.controller.protocol_plugin.openflow.IDataPacketListen;
import org.opendaylight.controller.protocol_plugin.openflow.IDataPacketMux;
+import org.opendaylight.controller.protocol_plugin.openflow.IDiscoveryListener;
import org.opendaylight.controller.protocol_plugin.openflow.IFlowProgrammerNotifier;
+import org.opendaylight.controller.protocol_plugin.openflow.IInventoryProvider;
import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimInternalListener;
+import org.opendaylight.controller.protocol_plugin.openflow.IOFStatisticsListener;
import org.opendaylight.controller.protocol_plugin.openflow.IOFStatisticsManager;
-import org.opendaylight.controller.protocol_plugin.openflow.IPluginReadServiceFilter;
+import org.opendaylight.controller.protocol_plugin.openflow.IReadFilterInternalListener;
+import org.opendaylight.controller.protocol_plugin.openflow.IReadServiceFilter;
import org.opendaylight.controller.protocol_plugin.openflow.IRefreshInternalProvider;
-import org.opendaylight.controller.protocol_plugin.openflow.IStatisticsListener;
import org.opendaylight.controller.protocol_plugin.openflow.ITopologyServiceShimListener;
import org.opendaylight.controller.protocol_plugin.openflow.core.IController;
import org.opendaylight.controller.protocol_plugin.openflow.core.IMessageListener;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.discovery.IDiscoveryService;
import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService;
import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
import org.opendaylight.controller.sal.reader.IPluginInReadService;
+import org.opendaylight.controller.sal.reader.IPluginOutReadService;
import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
import org.opendaylight.controller.sal.utils.GlobalConstants;
/**
* Openflow protocol plugin Activator
- *
- *
+ *
+ *
*/
public class Activator extends ComponentActivatorAbstractBase {
protected static final Logger logger = LoggerFactory
/**
* Function called when the activator starts just after some initializations
* are done by the ComponentActivatorAbstractBase.
- *
+ *
*/
public void init() {
}
/**
* Function called when the activator stops just before the cleanup done by
* ComponentActivatorAbstractBase
- *
+ *
*/
public void destroy() {
}
/**
* Function that is used to communicate to dependency manager the list of
* known implementations for services inside a container
- *
- *
+ *
+ *
* @return An array containing all the CLASS objects that will be
* instantiated in order to get an fully working implementation
* Object
/**
* Function that is called when configuration of the dependencies is
* required.
- *
+ *
* @param c
* dependency manager Component object, used for configuring the
* dependencies exported and imported
// export the service to be used by SAL
c.setInterface(
new String[] { IPluginInTopologyService.class.getName(),
- ITopologyServiceShimListener.class.getName() },
- null);
+ ITopologyServiceShimListener.class.getName() }, null);
// Hook the services coming in from SAL, as optional in
// case SAL is not yet there, could happen
c.add(createContainerServiceDependency(containerName)
if (imp.equals(InventoryService.class)) {
// export the service
c.setInterface(
- new String[] { IPluginInInventoryService.class.getName(),
- IStatisticsListener.class.getName(),
- IInventoryShimInternalListener.class.getName() },
- null);
+ new String[] {
+ IPluginInInventoryService.class.getName(),
+ IInventoryShimInternalListener.class.getName(),
+ IInventoryProvider.class.getName() }, null);
// Now lets add a service dependency to make sure the
// provider of service exists
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
Dictionary<String, Object> props = new Hashtable<String, Object>();
// Set the protocolPluginType property which will be used
// by SAL
- props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
- c.setInterface(IPluginInReadService.class.getName(), props);
+ props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
+ c.setInterface(new String[] {
+ IReadFilterInternalListener.class.getName(),
+ IPluginInReadService.class.getName() }, props);
+
c.add(createServiceDependency()
- .setService(IPluginReadServiceFilter.class)
+ .setService(IReadServiceFilter.class)
.setCallbacks("setService", "unsetService")
.setRequired(true));
+ c.add(createContainerServiceDependency(containerName)
+ .setService(IPluginOutReadService.class)
+ .setCallbacks("setPluginOutReadServices",
+ "unsetPluginOutReadServices")
+ .setRequired(false));
}
if (imp.equals(FlowProgrammerNotifier.class)) {
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)
/**
* Function that is used to communicate to dependency manager the list of
* known implementations for services that are container independent.
- *
- *
+ *
+ *
* @return An array containing all the CLASS objects that will be
* instantiated in order to get an fully working implementation
* Object
/**
* Function that is called when configuration of the dependencies is
* required.
- *
+ *
* @param c
* dependency manager Component object, used for configuring the
* dependencies exported and imported
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(),
IMessageListener.class.getName(),
IContainerListener.class.getName(),
IInventoryShimExternalListener.class.getName() },
- props);
+ props);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
if (imp.equals(ReadServiceFilter.class)) {
- c.setInterface(
- new String[] { IPluginReadServiceFilter.class.getName(),
- IContainerListener.class.getName() }, null);
+ c.setInterface(new String[] {
+ IReadServiceFilter.class.getName(),
+ IContainerListener.class.getName(),
+ IOFStatisticsListener.class.getName() }, null);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
.setService(IOFStatisticsManager.class)
.setCallbacks("setService", "unsetService")
.setRequired(true));
+ c.add(createServiceDependency()
+ .setService(IReadFilterInternalListener.class)
+ .setCallbacks("setReadFilterInternalListener",
+ "unsetReadFilterInternalListener")
+ .setRequired(false));
+
}
if (imp.equals(OFStatisticsManager.class)) {
.setCallbacks("setController", "unsetController")
.setRequired(true));
c.add(createServiceDependency()
- .setService(IStatisticsListener.class)
+ .setService(IOFStatisticsListener.class)
.setCallbacks("setStatisticsListener",
"unsetStatisticsListener").setRequired(false));
}
.setRequired(true));
c.add(createContainerServiceDependency(
GlobalConstants.DEFAULT.toString())
- .setService(IPluginInInventoryService.class)
- .setCallbacks("setPluginInInventoryService",
- "unsetPluginInInventoryService").setRequired(true));
+ .setService(IInventoryProvider.class)
+ .setCallbacks("setInventoryProvider",
+ "unsetInventoryProvider").setRequired(true));
c.add(createServiceDependency().setService(IDataPacketMux.class)
.setCallbacks("setIDataPacketMux", "unsetIDataPacketMux")
.setRequired(true));
c.add(createServiceDependency()
- .setService(IDiscoveryService.class)
- .setCallbacks("setDiscoveryService",
- "unsetDiscoveryService").setRequired(true));
+ .setService(IDiscoveryListener.class)
+ .setCallbacks("setDiscoveryListener",
+ "unsetDiscoveryListener").setRequired(true));
}
// DataPacket mux/demux services, which is teh actual engine
}
if (imp.equals(InventoryServiceShim.class)) {
- c.setInterface(new String[] { IContainerListener.class.getName() },
- null);
+ c.setInterface(new String[] { IContainerListener.class.getName(),
+ IOFStatisticsListener.class.getName()}, null);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
}
if (imp.equals(TopologyServiceShim.class)) {
- c.setInterface(new String[] { IDiscoveryService.class.getName(),
+ c.setInterface(new String[] { IDiscoveryListener.class.getName(),
IContainerListener.class.getName(),
- IRefreshInternalProvider.class.getName() }, null);
- c.add(createServiceDependency()
+ IRefreshInternalProvider.class.getName(),
+ IInventoryShimExternalListener.class.getName() }, null);
+ c.add(createServiceDependency()
.setService(ITopologyServiceShimListener.class)
.setCallbacks("setTopologyServiceShimListener",
"unsetTopologyServiceShimListener")