本文整理汇总了Java中org.opendaylight.controller.configuration.IConfigurationContainerAware类的典型用法代码示例。如果您正苦于以下问题:Java IConfigurationContainerAware类的具体用法?Java IConfigurationContainerAware怎么用?Java IConfigurationContainerAware使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationContainerAware类属于org.opendaylight.controller.configuration包,在下文中一共展示了IConfigurationContainerAware类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveConfiguration
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
@Override
public Status saveConfiguration() {
boolean success = true;
for (IConfigurationContainerAware configurationAware : configurationAwareList) {
logger.info("Save Config triggered for {}",
configurationAware.getClass().getSimpleName());
Status status = configurationAware.saveConfiguration();
if (!status.isSuccess()) {
success = false;
logger.info("Failed to save config for {}",
configurationAware.getClass().getSimpleName());
}
}
if (success) {
return new Status(StatusCode.SUCCESS, null);
} else {
return new Status(StatusCode.INTERNALERROR,
"Failed to Save All Configurations");
}
}
示例2: configureInstance
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
* 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
* @param imp Implementation class that is being configured,
* needed as long as the same routine can configure multiple
* implementations
* @param containerName The containerName being configured, this allow
* also optional per-container different behavior if needed, usually
* should not be the case though.
*/
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(StaticRoutingImplementation.class)) {
Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
Set<String> propSet = new HashSet<String>();
propSet.add("forwarding.staticrouting.configSaveEvent");
props.put("cachenames", propSet);
// export the service
c.setInterface(new String[] { ICacheUpdateAware.class.getName(),
IForwardingStaticRouting.class.getName(),
IfNewHostNotify.class.getName(),
IConfigurationContainerAware.class.getName() }, props);
c.add(createContainerServiceDependency(containerName).setService(
IClusterContainerServices.class).setCallbacks(
"setClusterContainerService",
"unsetClusterContainerService").setRequired(true));
c.add(createContainerServiceDependency(containerName).setService(
IfIptoHost.class).setCallbacks("setHostTracker",
"unsetHostTracker").setRequired(true));
// Static routing aware there could be many
c.add(createContainerServiceDependency(containerName).setService(
IStaticRoutingAware.class).setCallbacks(
"setStaticRoutingAware", "unsetStaticRoutingAware")
.setRequired(false));
}
}
示例3: configureInstance
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
* 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
* @param imp Implementation class that is being configured,
* needed as long as the same routine can configure multiple
* implementations
* @param containerName The containerName being configured, this allow
* also optional per-container different behavior if needed, usually
* should not be the case though.
*/
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(SwitchManagerImpl.class)) {
Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
Set<String> propSet = new HashSet<String>();
propSet.add("switchmanager.configSaveEvent");
props.put("cachenames", propSet);
// export the service
c.setInterface(new String[] {
IListenInventoryUpdates.class.getName(),
ISwitchManager.class.getName(),
ICacheUpdateAware.class.getName(),
IConfigurationContainerAware.class.getName() }, props);
// Now lets add a service dependency to make sure the
// provider of service exists
c.add(createContainerServiceDependency(containerName).setService(
IInventoryService.class).setCallbacks(
"setInventoryService", "unsetInventoryService")
.setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(
ISwitchManagerAware.class).setCallbacks(
"setSwitchManagerAware", "unsetSwitchManagerAware")
.setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(
IInventoryListener.class).setCallbacks(
"setInventoryListener", "unsetInventoryListener")
.setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(
ISpanAware.class).setCallbacks("setSpanAware",
"unsetSpanAware").setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(
IClusterContainerServices.class).setCallbacks(
"setClusterContainerService",
"unsetClusterContainerService").setRequired(true));
}
}
示例4: configureInstance
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
* 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
* @param imp
* Implementation class that is being configured, needed as long
* as the same routine can configure multiple implementations
* @param containerName
* The containerName being configured, this allow also optional
* 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(ForwardingRulesManager.class)) {
String interfaces[] = null;
Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
Set<String> propSet = new HashSet<String>();
propSet.add("frm.flowsSaveEvent");
props.put("cachenames", propSet);
// export the service
interfaces = new String[] { IContainerListener.class.getName(), ISwitchManagerAware.class.getName(),
IForwardingRulesManager.class.getName(), IInventoryListener.class.getName(),
ICacheUpdateAware.class.getName(), IConfigurationContainerAware.class.getName(),
IFlowProgrammerListener.class.getName() };
c.setInterface(interfaces, props);
c.add(createContainerServiceDependency(containerName).setService(IFlowProgrammerService.class)
.setCallbacks("setFlowProgrammerService", "unsetFlowProgrammerService").setRequired(true));
c.add(createContainerServiceDependency(containerName).setService(IClusterContainerServices.class)
.setCallbacks("setClusterContainerService", "unsetClusterContainerService").setRequired(true));
c.add(createContainerServiceDependency(containerName).setService(ISwitchManager.class)
.setCallbacks("setSwitchManager", "unsetSwitchManager").setRequired(true));
c.add(createContainerServiceDependency(containerName).setService(IForwardingRulesManagerAware.class)
.setCallbacks("setFrmAware", "unsetFrmAware").setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(IContainer.class)
.setCallbacks("setIContainer", "unsetIContainer").setRequired(true));
}
}
示例5: configureInstance
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
* 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
* @param imp Implementation class that is being configured,
* needed as long as the same routine can configure multiple
* implementations
* @param containerName The containerName being configured, this allow
* also optional per-container different behavior if needed, usually
* should not be the case though.
*/
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(ConfigurationContainerImpl.class)) {
// export the service
c.setInterface(new String[] {
IConfigurationContainerService.class.getName(),
IConfigurationAware.class.getName() }, null);
c.add(createContainerServiceDependency(containerName).setService(
IConfigurationContainerAware.class).setCallbacks(
"addConfigurationContainerAware",
"removeConfigurationContainerAware").setRequired(false));
}
}
示例6: configureInstance
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
* 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
* @param imp Implementation class that is being configured,
* needed as long as the same routine can configure multiple
* implementations
* @param containerName The containerName being configured, this allow
* also optional per-container different behavior if needed, usually
* should not be the case though.
*/
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(TopologyManagerImpl.class)) {
// export the service needed to listen to topology updates
Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
Set<String> propSet = new HashSet<String>();
propSet.add("topologymanager.configSaveEvent");
props.put("cachenames", propSet);
c.setInterface(new String[] { IListenTopoUpdates.class.getName(),
ITopologyManager.class.getName(),
IConfigurationContainerAware.class.getName() }, props);
c.add(createContainerServiceDependency(containerName).setService(
ITopologyService.class).setCallbacks("setTopoService",
"unsetTopoService").setRequired(true));
// These are all the listeners for a topology manager
// updates, there could be many or none
c.add(createContainerServiceDependency(containerName).setService(
ITopologyManagerAware.class).setCallbacks(
"setTopologyManagerAware", "unsetTopologyManagerAware")
.setRequired(false));
c.add(createContainerServiceDependency(containerName).setService(
IClusterContainerServices.class).setCallbacks(
"setClusterContainerService",
"unsetClusterContainerService").setRequired(true));
}
}
示例7: addConfigurationContainerAware
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
public void addConfigurationContainerAware(
IConfigurationContainerAware configurationAware) {
if (!this.configurationAwareList.contains(configurationAware)) {
this.configurationAwareList.add(configurationAware);
}
}
示例8: removeConfigurationContainerAware
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
public void removeConfigurationContainerAware(
IConfigurationContainerAware configurationAware) {
this.configurationAwareList.remove(configurationAware);
}
示例9: testAddRemoveSaveConfiguration
import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
@Test
public void testAddRemoveSaveConfiguration() {
ConfigurationContainerImpl configurationContainerImpl = new ConfigurationContainerImpl();
IConfigurationContainerAware testConfigurationContainerAware = new ConfigurationContainerAwareTest();
configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
IConfigurationContainerAware testConfigurationAware1 = new ConfigurationContainerAwareTest();
configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware1);
Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
IConfigurationContainerAware testConfigurationAware2 = new ConfigurationContainerAwareTest();
configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware2);
Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
IConfigurationContainerAware testConfigurationAware3 = new ConfigurationContainerAwareTest();
configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware3);
Assert.assertEquals(4, configurationContainerImpl.getConfigurationAwareListSize());
configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware3);
Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware2);
Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware1);
Assert.assertEquals(0, configurationContainerImpl.getConfigurationAwareListSize());
}