Extend API: Get Module Definitions
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / impl / inventory / InventoryPersistence.java
index 09de9a7..dcd0368 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation
+ *  Copyright (C) 2022-2024 Nordix Foundation
  *  Modifications Copyright (C) 2023 TechMahindra Ltd.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,7 @@
 package org.onap.cps.ncmp.api.impl.inventory;
 
 import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import org.onap.cps.ncmp.api.impl.ncmppersistence.NcmpPersistence;
 import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
@@ -78,6 +79,18 @@ public interface InventoryPersistence extends NcmpPersistence {
      */
     Collection<ModuleDefinition> getModuleDefinitionsByCmHandleId(String cmHandleId);
 
+    /**
+     * Method to return module definitions for the given parameters.
+     *
+     * @param cmHandleId        cm-handle identifier
+     * @param moduleName        module name
+     * @param moduleRevision    the revision of the module
+     * @return list of module definitions (module name, revision, yang resource content)
+     */
+    Collection<ModuleDefinition> getModuleDefinitionsByCmHandleAndModule(String cmHandleId,
+                                                                         String moduleName,
+                                                                         String moduleRevision);
+
     /**
      * Method to return module references by cmHandleId.
      *
@@ -98,7 +111,7 @@ public interface InventoryPersistence extends NcmpPersistence {
      *
      * @param yangModelCmHandles cm handle represented as Yang Models
      */
-    void saveCmHandleBatch(Collection<YangModelCmHandle> yangModelCmHandles);
+    void saveCmHandleBatch(List<YangModelCmHandle> yangModelCmHandles);
 
     /**
      * Get data node of given cm handle.