- public void configureGlobalInstance(Component c, Object imp){
- if (imp.equals(ConfigurationServiceImpl.class)) {
- // export the service to be used by SAL
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- // Set the protocolPluginType property which will be used
- // by SAL
- props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
- c.setInterface(new String[] { IPluginInBridgeDomainConfigService.class.getName(),
- OvsdbConfigurationService.class.getName()}, props);
-
- c.add(createServiceDependency()
- .setService(OvsdbConnectionService.class)
- .setRequired(true));
- c.add(createServiceDependency()
- .setService(OvsdbInventoryService.class)
- .setRequired(true));
- c.add(createServiceDependency()
- .setService(IClusterGlobalServices.class)
- .setCallbacks("setClusterServices", "unsetClusterServices")
- .setRequired(false));
- }
-
- if (imp.equals(ConnectionServiceImpl.class)) {
- // export the service to be used by SAL
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- // Set the protocolPluginType property which will be used
- // by SAL
- props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
- c.setInterface(
- new String[] {IPluginInConnectionService.class.getName(),
- OvsdbConnectionService.class.getName(),
- OvsdbConnectionListener.class.getName()}, props);
- c.add(createServiceDependency()
- .setService(OvsdbInventoryService.class)
- .setRequired(true));
- c.add(createServiceDependency()
- .setService(OvsdbConnection.class)
- .setRequired(true));
- }
-
- if (imp.equals(InventoryServiceImpl.class)) {
- Dictionary<String, Object> props = new Hashtable<>();
- props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
- props.put("scope", "Global");
- c.setInterface(
- new String[]{IPluginInInventoryService.class.getName(),
- OvsdbInventoryService.class.getName()}, props);
- c.add(createServiceDependency()
- .setService(IPluginOutInventoryService.class, "(scope=Global)")
- .setCallbacks("setPluginOutInventoryServices",
- "unsetPluginOutInventoryServices")
- .setRequired(true));
- c.add(createServiceDependency()
- .setService(OvsdbInventoryListener.class)
- .setCallbacks("listenerAdded", "listenerRemoved"));
- c.add(createServiceDependency()
- .setService(OvsdbConfigurationService.class)
- .setRequired(false));
- }
-
- if (imp.equals(NodeFactory.class)) {
- // export the service to be used by SAL
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- // Set the protocolPluginType property which will be used
- // by SAL
- props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
- props.put("protocolName", "OVS");
- c.setInterface(INodeFactory.class.getName(), props);
- }
- if (imp.equals(NodeConnectorFactory.class)) {
- // export the service to be used by SAL
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- // Set the protocolPluginType property which will be used
- // by SAL
- props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
- props.put("protocolName", "OVS");
- c.setInterface(INodeConnectorFactory.class.getName(), props);
- }
-