From c309f24909510ebd11737efc3eadb055c91e304e Mon Sep 17 00:00:00 2001 From: niamhcore Date: Tue, 7 Sep 2021 10:27:18 +0100 Subject: P2 - Get module names and revisions rest layer Issue-ID: CPS-485 Signed-off-by: niamhcore Change-Id: I1bcf45902207d0dba6b5dfe8277cb06571694db3 --- .../src/main/java/org/onap/cps/api/CpsModuleService.java | 13 +++++++++++-- .../java/org/onap/cps/api/impl/CpsModuleServiceImpl.java | 9 +++++++-- .../java/org/onap/cps/spi/CpsModulePersistenceService.java | 9 ++++----- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'cps-service/src/main/java/org/onap') 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 218a236f1..1dccf49c9 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 @@ -81,10 +81,19 @@ public interface CpsModuleService { @NonNull CascadeDeleteAllowed cascadeDeleteAllowed); /** - * Retrieve all modules and revisions known by CPS for all Yang Resources. + * Retrieve module references for the given dataspace name. * * @param dataspaceName dataspace name * @return a list of ModuleReference objects */ - Collection getAllYangResourceModuleReferences(final String dataspaceName); + Collection getYangResourceModuleReferences(String dataspaceName); + + /** + * Retrieve module references for the given dataspace name and anchor name. + * + * @param dataspaceName dataspace name + * @param anchorName anchor name + * @return a list of ModuleReference objects + */ + Collection getYangResourcesModuleReferences(String dataspaceName, String anchorName); } 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 17ad78cbe..10326413c 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 @@ -75,8 +75,13 @@ public class CpsModuleServiceImpl implements CpsModuleService { } @Override - public Collection getAllYangResourceModuleReferences(final String dataspaceName) { - return cpsModulePersistenceService.getAllYangResourceModuleReferences(dataspaceName); + public Collection getYangResourceModuleReferences(final String dataspaceName) { + return cpsModulePersistenceService.getYangResourceModuleReferences(dataspaceName); } + @Override + public Collection getYangResourcesModuleReferences(final String dataspaceName, + final String anchorName) { + return cpsModulePersistenceService.getYangResourceModuleReferences(dataspaceName, anchorName); + } } 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 4f46c0dac..9b50f9e91 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 @@ -90,20 +90,19 @@ public interface CpsModulePersistenceService { @NonNull String anchorName); /** - * Returns all YANG resources module references for the given dataspace name. + * Returns YANG resources module references for the given dataspace name. * * @param dataspaceName dataspace name * @return Collection of all YANG resources module information in the database */ - Collection getAllYangResourceModuleReferences(final String dataspaceName); + Collection getYangResourceModuleReferences(String dataspaceName); /** - * Get all YANG resource module references for the given anchor name and dataspace name. + * Get YANG resource module references for the given anchor name and dataspace name. * * @param dataspaceName dataspace name * @param anchorName anchor name * @return a collection of module names and revisions */ - Collection getAllYangResourceModuleReferences(final String dataspaceName, - final String anchorName); + Collection getYangResourceModuleReferences(String dataspaceName, String anchorName); } -- cgit 1.2.3-korg