- private final YangStoreSnapshot yangStoreSnapshot;
- private static final Logger logger = LoggerFactory.getLogger(Get.class);
- private final TransactionProvider transactionProvider;
-
- public Get(YangStoreSnapshot yangStoreSnapshot, ConfigRegistryClient configRegistryClient,
- String netconfSessionIdForReporting, TransactionProvider transactionProvider) {
- super(configRegistryClient, netconfSessionIdForReporting);
- this.yangStoreSnapshot = yangStoreSnapshot;
- this.transactionProvider = transactionProvider;
- }
-
- private Map<String, Map<String, ModuleRuntime>> createModuleRuntimes(ConfigRegistryClient configRegistryClient,
- Map<String, Map<String, ModuleMXBeanEntry>> mBeanEntries) {
- Map<String, Map<String, ModuleRuntime>> retVal = Maps.newHashMap();
-
- for (String namespace : mBeanEntries.keySet()) {
-
- Map<String, ModuleRuntime> innerMap = Maps.newHashMap();
- Map<String, ModuleMXBeanEntry> entriesFromNamespace = mBeanEntries.get(namespace);
- for (String module : entriesFromNamespace.keySet()) {
-
- ModuleMXBeanEntry mbe = entriesFromNamespace.get(module);
-
- Map<RuntimeBeanEntry, InstanceConfig> cache = Maps.newHashMap();
- RuntimeBeanEntry root = null;
- for (RuntimeBeanEntry rbe : mbe.getRuntimeBeans()) {
- cache.put(rbe, new InstanceConfig(configRegistryClient, rbe.getYangPropertiesToTypesMap()));
- if (rbe.isRoot())
- root = rbe;
- }
-
- if (root == null)
- continue;
-
- InstanceRuntime rootInstanceRuntime = createInstanceRuntime(root, cache);
- ModuleRuntime moduleRuntime = new ModuleRuntime(module, rootInstanceRuntime);
- innerMap.put(module, moduleRuntime);
- }
-
- retVal.put(namespace, innerMap);
- }
- return retVal;
- }
-
- private InstanceRuntime createInstanceRuntime(RuntimeBeanEntry root, Map<RuntimeBeanEntry, InstanceConfig> cache) {
- Map<String, InstanceRuntime> children = Maps.newHashMap();
- for (RuntimeBeanEntry child : root.getChildren()) {
- children.put(child.getJavaNamePrefix(), createInstanceRuntime(child, cache));
- }
-
- return new InstanceRuntime(cache.get(root), children, createJmxToYangMap(root.getChildren()));
- }