summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/main/java/org')
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java9
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java8
-rwxr-xr-xcps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java9
3 files changed, 26 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java b/cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java
index cd156d6dd9..fee4daa51a 100644
--- a/cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java
+++ b/cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java
@@ -21,10 +21,12 @@
package org.onap.cps.api;
+import java.util.List;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.onap.cps.spi.CascadeDeleteAllowed;
import org.onap.cps.spi.exceptions.DataInUseException;
+import org.onap.cps.spi.model.ModuleReference;
import org.onap.cps.spi.model.SchemaSet;
/**
@@ -63,4 +65,11 @@ public interface CpsModuleService {
*/
void deleteSchemaSet(@NonNull String dataspaceName, @NonNull String schemaSetName,
@NonNull CascadeDeleteAllowed cascadeDeleteAllowed);
+
+ /**
+ * Retrieve all modules and revisions known by CPS for all Yang Resources.
+ *
+ * @return a list of ModuleReference objects
+ */
+ List<ModuleReference> getAllYangResourcesModuleReferences();
}
diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java
index e4e6d1bef7..34735f8482 100644
--- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java
+++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java
@@ -21,10 +21,12 @@
package org.onap.cps.api.impl;
+import java.util.List;
import java.util.Map;
import org.onap.cps.api.CpsModuleService;
import org.onap.cps.spi.CascadeDeleteAllowed;
import org.onap.cps.spi.CpsModulePersistenceService;
+import org.onap.cps.spi.model.ModuleReference;
import org.onap.cps.spi.model.SchemaSet;
import org.onap.cps.yang.YangTextSchemaSourceSetBuilder;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,4 +63,10 @@ public class CpsModuleServiceImpl implements CpsModuleService {
final CascadeDeleteAllowed cascadeDeleteAllowed) {
cpsModulePersistenceService.deleteSchemaSet(dataspaceName, schemaSetName, cascadeDeleteAllowed);
}
+
+ @Override
+ public List<ModuleReference> getAllYangResourcesModuleReferences() {
+ return cpsModulePersistenceService.getAllYangResourcesModuleReferences();
+ }
+
}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
index ec8a53cd13..bc62a23c52 100755
--- a/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
@@ -21,9 +21,11 @@
package org.onap.cps.spi;
+import java.util.List;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.onap.cps.spi.exceptions.DataInUseException;
+import org.onap.cps.spi.model.ModuleReference;
/**
* Service to manage modules.
@@ -73,4 +75,11 @@ public interface CpsModulePersistenceService {
@NonNull
Map<String, String> getYangSchemaSetResources(@NonNull String dataspaceName,
@NonNull String anchorName);
+
+ /**
+ * Returns all YANG resources module references.
+ *
+ * @return List of all YANG resources module information in the database
+ */
+ List<ModuleReference> getAllYangResourcesModuleReferences();
}