diff options
author | Niamh Core <niamh.core@est.tech> | 2021-08-18 10:40:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-18 10:40:26 +0000 |
commit | 24112c0a500e94dc6068be71105874f8d81678b7 (patch) | |
tree | 5db8eb2edc8938d72f98529e61a8210020bda111 /cps-service/src/main/java | |
parent | ddf661254f711d78b480b8f5623632443a8f6ebc (diff) | |
parent | 4c52e1a31c1424a954b2a1540117b4fbb443c578 (diff) |
Merge "CPS-508: Create anchor/schemaset from new modules and existing modules"
Diffstat (limited to 'cps-service/src/main/java')
4 files changed, 33 insertions, 1 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 fee4daa51a..d174085263 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 @@ -46,6 +46,18 @@ public interface CpsModuleService { @NonNull Map<String, String> yangResourcesNameToContentMap); /** + * Create a schema set from new modules and existing modules. + * + * @param dataspaceName Dataspace name + * @param schemaSetName schema set name + * @param newYangResourcesModuleNameToContentMap YANG resources map where key is a module name and value is content + * @param moduleReferenceList List of YANG resources module references + */ + void createSchemaSetFromModules(@NonNull String dataspaceName, @NonNull String schemaSetName, + @NonNull Map<String, String> newYangResourcesModuleNameToContentMap, + @NonNull List<ModuleReference> moduleReferenceList); + + /** * Read schema set in the given dataspace. * * @param dataspaceName dataspace name 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 34735f8482..c65f827816 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 @@ -51,6 +51,15 @@ public class CpsModuleServiceImpl implements CpsModuleService { } @Override + public void createSchemaSetFromModules(final String dataspaceName, final String schemaSetName, + final Map<String, String> newYangResourcesModuleNameToContentMap, + final List<ModuleReference> moduleReferenceList) { + cpsModulePersistenceService.storeSchemaSetFromModules(dataspaceName, schemaSetName, + newYangResourcesModuleNameToContentMap, moduleReferenceList); + + } + + @Override public SchemaSet getSchemaSet(final String dataspaceName, final String schemaSetName) { final var yangTextSchemaSourceSet = yangTextSchemaSourceSetCache .get(dataspaceName, schemaSetName); diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java index f71ff0b3be..b05385fbf4 100755 --- a/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java +++ b/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java @@ -49,7 +49,6 @@ public interface CpsAdminPersistenceService { */ void createAnchor(@NonNull String dataspaceName, @NonNull String schemaSetName, @NonNull String anchorName); - /** * Read all anchors in the given a dataspace. * 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 bc62a23c52..7ad109d815 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 @@ -43,6 +43,18 @@ public interface CpsModulePersistenceService { @NonNull Map<String, String> yangResourcesNameToContentMap); /** + * Stores a schema set from new modules and existing modules. + * + * @param dataspaceName Dataspace name + * @param schemaSetName Schema set name + * @param newYangResourcesModuleNameToContentMap YANG resources map where key is a module name and value is content + * @param moduleReferenceList List of YANG resources module references + */ + void storeSchemaSetFromModules(@NonNull String dataspaceName, @NonNull String schemaSetName, + @NonNull Map<String, String> newYangResourcesModuleNameToContentMap, + @NonNull List<ModuleReference> moduleReferenceList); + + /** * Deletes Schema Set. * * @param dataspaceName dataspace name |