use of org.opendaylight.controller.config.facade.xml.runtime.InstanceRuntime in project controller by opendaylight.
the class ConfigSubsystemFacade method createModuleRuntimes.
private Map<String, Map<String, ModuleRuntime>> createModuleRuntimes(final ConfigRegistryClient client, final Map<String, Map<String, ModuleMXBeanEntry>> mbeanentries) {
Map<String, Map<String, ModuleRuntime>> retVal = new HashMap<>();
for (Map.Entry<String, Map<String, ModuleMXBeanEntry>> namespaceToModuleEntry : mbeanentries.entrySet()) {
Map<String, ModuleRuntime> innerMap = new HashMap<>();
Map<String, ModuleMXBeanEntry> entriesFromNamespace = namespaceToModuleEntry.getValue();
for (Map.Entry<String, ModuleMXBeanEntry> moduleToMXEntry : entriesFromNamespace.entrySet()) {
ModuleMXBeanEntry mbe = moduleToMXEntry.getValue();
Map<RuntimeBeanEntry, InstanceConfig> cache = new HashMap<>();
RuntimeBeanEntry root = null;
for (RuntimeBeanEntry rbe : mbe.getRuntimeBeans()) {
cache.put(rbe, new InstanceConfig(client, rbe.getYangPropertiesToTypesMap(), mbe.getNullableDummyContainerName()));
if (rbe.isRoot()) {
root = rbe;
}
}
if (root == null) {
continue;
}
InstanceRuntime rootInstanceRuntime = createInstanceRuntime(root, cache);
ModuleRuntime moduleRuntime = new ModuleRuntime(rootInstanceRuntime);
innerMap.put(moduleToMXEntry.getKey(), moduleRuntime);
}
retVal.put(namespaceToModuleEntry.getKey(), innerMap);
}
return retVal;
}
Aggregations