Rework CpsModulePersistenceService
[cps.git] / cps-service / src / main / java / org / onap / cps / spi / CpsModulePersistenceService.java
index 9749d8b..a82d69a 100644 (file)
 package org.onap.cps.spi;
 
 import java.util.Map;
+import org.checkerframework.checker.nullness.qual.NonNull;
 
 /**
  * Service to manage modules.
  */
 public interface CpsModulePersistenceService {
 
-    /**
-     * TODO
-     * clean up method to conform with spi proposal - https://jira.onap.org/browse/CPS-103
-     * Store the module from a yang model in the database.
-     *
-     * @param namespace     module namespace
-     * @param moduleContent module content
-     * @param revision      module revision
-     * @param dataspaceName the name of the dataspace the module is associated with
-     */
-    @Deprecated
-    void storeModule(final String namespace, final String moduleContent, final String revision,
-                     final String dataspaceName);
-
-
     /**
      * Stores Schema Set.
      *
@@ -49,6 +35,16 @@ public interface CpsModulePersistenceService {
      * @param schemaSetName                 schema set name
      * @param yangResourcesNameToContentMap YANG resources (files) map where key is a name and value is content
      */
-    void storeSchemaSet(String dataspaceName, String schemaSetName, Map<String, String> yangResourcesNameToContentMap);
+    void storeSchemaSet(@NonNull String dataspaceName, @NonNull String schemaSetName,
+            @NonNull Map<String, String> yangResourcesNameToContentMap);
 
+    /**
+     * Returns YANG resources per specific namespace / schemaSetName.
+     *
+     * @param namespace     module namespace
+     * @param schemaSetName schema set name
+     * @return YANG resources (files) map where key is a name and value is content
+     */
+    @NonNull
+    Map<String, String> getYangSchemaResources(@NonNull String namespace, @NonNull String schemaSetName);
 }