Fix bug in hello message: module with more revisions.
[controller.git] / opendaylight / config / yang-store-api / src / main / java / org / opendaylight / controller / config / yang / store / api / YangStoreSnapshot.java
index da8b5e4ed14a2836cf9bc3edf71daad39af20f14..b912b0c7af90c8ef43e64bd0873e766ea4c4b9a2 100644 (file)
@@ -7,21 +7,50 @@
  */
 package org.opendaylight.controller.config.yang.store.api;
 
-import java.util.Map;
-import java.util.Map.Entry;
-
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.Module;
 
+import java.util.Map;
+import java.util.Set;
+
 public interface YangStoreSnapshot extends AutoCloseable {
 
+    /**
+     * @deprecated Use {@link #getQNamesToIdentitiesToModuleMXBeanEntries()} instead. This method return only one
+     * module representation even if multiple revisions are available.
+     */
+    @Deprecated
     Map<String/* Namespace from yang file */,
             Map<String /* Name of module entry from yang file */, ModuleMXBeanEntry>> getModuleMXBeanEntryMap();
 
-    Map<String, Entry<Module, String>> getModuleMap();
 
+    Map<QName, Map<String /* identity local name */, ModuleMXBeanEntry>> getQNamesToIdentitiesToModuleMXBeanEntries();
+
+    /**
+     * Get number of parsed ModuleMXBeanEntry instances.
+     */
     int countModuleMXBeanEntries();
 
+    /**
+     * Get all modules discovered when this snapshot was created.
+     * @return all modules discovered. If one module exists with two different revisions, return both.
+     */
+    Set<Module> getModules();
+
+    /**
+     * Get all modules together with their yang sources.
+     */
+    Map<Module, String> getModulesToSources();
+
+    /**
+     * Retrieve source of module as it appeared during creation of this snapshot.
+     * @param module
+     * @return yang source of given module
+     * @throws java.lang.IllegalArgumentException if module does not belong to this snapshot
+     */
+    String getModuleSource(Module module);
+
     @Override
     void close();
 }