2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.yang.store.impl;
11 import java.util.Map.Entry;
13 import org.opendaylight.controller.config.yang.store.api.YangStoreSnapshot;
14 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
15 import org.opendaylight.yangtools.yang.model.api.Module;
17 public class YangStoreSnapshotImpl implements YangStoreSnapshot {
19 private final Map<String /* Namespace from yang file */, Map<String /*
27 */, ModuleMXBeanEntry>> moduleMXBeanEntryMap;
29 private final Map<String, Entry<Module, String>> moduleMap;
31 public YangStoreSnapshotImpl(
32 Map<String, Map<String, ModuleMXBeanEntry>> moduleMXBeanEntryMap,
33 Map<String, Entry<Module, String>> moduleMap) {
34 this.moduleMXBeanEntryMap = moduleMXBeanEntryMap;
35 this.moduleMap = moduleMap;
39 public Map<String, Map<String, ModuleMXBeanEntry>> getModuleMXBeanEntryMap() {
40 return moduleMXBeanEntryMap;
44 public Map<String, Entry<Module, String>> getModuleMap() {
49 public int countModuleMXBeanEntries() {
51 for (Map<String, ModuleMXBeanEntry> value : moduleMXBeanEntryMap
53 i += value.keySet().size();
60 // TODO: reference counting