Merge "Change default use of Model Loader to TRUE"
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / inventory / InventoryPersistence.java
index 6d006d9..cbd30a8 100644 (file)
@@ -1,6 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022 Nordix Foundation
+ *  Copyright (C) 2022-2023 Nordix Foundation
+ *  Modifications Copyright (C) 2023 TechMahindra Ltd.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -61,6 +62,14 @@ public interface InventoryPersistence {
      */
     YangModelCmHandle getYangModelCmHandle(String cmHandleId);
 
+    /**
+     * This method retrieves DMI service name, DMI properties and the state for a given cm handle.
+     *
+     * @param cmHandleIds a list of the ids of the cm handles
+     * @return collection of yang model cm handles
+     */
+    Collection<YangModelCmHandle> getYangModelCmHandles(Collection<String> cmHandleIds);
+
     /**
      * Method to return module definitions by cmHandleId.
      *
@@ -105,13 +114,20 @@ public interface InventoryPersistence {
      */
     void deleteSchemaSetWithCascade(String schemaSetName);
 
+    /**
+     * Method to delete multiple schema sets.
+     *
+     * @param schemaSetNames schema set names
+     */
+    void deleteSchemaSetsWithCascade(Collection<String> schemaSetNames);
+
     /**
      * Get data node via xpath.
      *
      * @param xpath xpath
      * @return data node
      */
-    DataNode getDataNode(String xpath);
+    Collection<DataNode> getDataNode(String xpath);
 
     /**
      * Get data node via xpath.
@@ -120,7 +136,24 @@ public interface InventoryPersistence {
      * @param fetchDescendantsOption fetch descendants option
      * @return data node
      */
-    DataNode getDataNode(String xpath, FetchDescendantsOption fetchDescendantsOption);
+    Collection<DataNode> getDataNode(String xpath, FetchDescendantsOption fetchDescendantsOption);
+
+    /**
+     * Get collection of data nodes via xpaths.
+     *
+     * @param xpaths collection of xpaths
+     * @return collection of data nodes
+     */
+    Collection<DataNode> getDataNodes(Collection<String> xpaths);
+
+    /**
+     * Get collection of data nodes via xpaths.
+     *
+     * @param xpaths collection of xpaths
+     * @param fetchDescendantsOption fetch descendants option
+     * @return collection of data nodes
+     */
+    Collection<DataNode> getDataNodes(Collection<String> xpaths, FetchDescendantsOption fetchDescendantsOption);
 
     /**
      * Get data node of given cm handle.
@@ -128,7 +161,15 @@ public interface InventoryPersistence {
      * @param cmHandleId cmHandle ID
      * @return data node
      */
-    DataNode getCmHandleDataNode(String cmHandleId);
+    Collection<DataNode> getCmHandleDataNode(String cmHandleId);
+
+    /**
+     * Get collection of data nodes of given cm handles.
+     *
+     * @param cmHandleIds collection of cmHandle IDs
+     * @return collection of data nodes
+     */
+    Collection<DataNode> getCmHandleDataNodes(Collection<String> cmHandleIds);
 
     /**
      * get CM handles that has given module names.
@@ -147,9 +188,16 @@ public interface InventoryPersistence {
     void replaceListContent(String parentNodeXpath, Collection<DataNode> dataNodes);
 
     /**
-     * Deletes data node for given anchor and dataspace.
+     * Deletes data node.
      *
      * @param dataNodeXpath data node xpath
      */
     void deleteDataNode(String dataNodeXpath);
+
+    /**
+     * Deletes multiple data nodes.
+     *
+     * @param dataNodeXpaths data node xpaths
+     */
+    void deleteDataNodes(Collection<String> dataNodeXpaths);
 }