Merge "sal-remoterpc-connector: sync ch.qos.logback:logback-classic version"
[controller.git] / opendaylight / config / yang-store-api / src / main / java / org / opendaylight / controller / config / yang / store / api / YangStoreSnapshot.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yang.store.api;
9
10 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.Module;
13
14 import java.util.Map;
15 import java.util.Set;
16
17 public interface YangStoreSnapshot extends AutoCloseable {
18
19     /**
20      * @deprecated Use {@link #getQNamesToIdentitiesToModuleMXBeanEntries()} instead. This method return only one
21      * module representation even if multiple revisions are available.
22      */
23     @Deprecated
24     Map<String/* Namespace from yang file */,
25             Map<String /* Name of module entry from yang file */, ModuleMXBeanEntry>> getModuleMXBeanEntryMap();
26
27
28     Map<QName, Map<String /* identity local name */, ModuleMXBeanEntry>> getQNamesToIdentitiesToModuleMXBeanEntries();
29
30     /**
31      * Get number of parsed ModuleMXBeanEntry instances.
32      */
33     int countModuleMXBeanEntries();
34
35     /**
36      * Get all modules discovered when this snapshot was created.
37      * @return all modules discovered. If one module exists with two different revisions, return both.
38      */
39     Set<Module> getModules();
40
41     /**
42      * Get all modules together with their yang sources.
43      */
44     Map<Module, String> getModulesToSources();
45
46     /**
47      * Retrieve source of module as it appeared during creation of this snapshot.
48      * @param module
49      * @return yang source of given module
50      * @throws java.lang.IllegalArgumentException if module does not belong to this snapshot
51      */
52     String getModuleSource(Module module);
53
54     @Override
55     void close();
56 }