diff options
author | Claudio David Gasparini <claudio.gasparini@pantheon.tech> | 2021-01-07 12:21:38 +0100 |
---|---|---|
committer | Claudio David Gasparini <claudio.gasparini@pantheon.tech> | 2021-01-11 10:01:27 +0100 |
commit | fa56d71bb94d88f657a9d73fb91c3036220f32ab (patch) | |
tree | 163bd68ae4a77cdc4412a5354958090e7063f257 /cps-ri/src/main | |
parent | 45b0d293c2d625c6d352d71a743f832c5e287c4e (diff) |
Rework CpsModulePersistenceService
- remove getModuleReferences
- provide service returning YangTextSchemaSourceSet
Issue-ID: CPS-21
Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech>
Change-Id: I61cf6450c8ed8a5154990ea19467e016dc1155b4
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java index 3e3a4b43e4..23a384306f 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java @@ -32,11 +32,9 @@ import org.onap.cps.spi.entities.Dataspace; import org.onap.cps.spi.entities.SchemaSet; import org.onap.cps.spi.entities.YangResource; import org.onap.cps.spi.exceptions.SchemaSetAlreadyDefinedException; -import org.onap.cps.spi.model.ModuleReference; import org.onap.cps.spi.repository.DataspaceRepository; import org.onap.cps.spi.repository.SchemaSetRepository; import org.onap.cps.spi.repository.YangResourceRepository; -import org.onap.cps.yang.YangTextSchemaSourceSetBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.stereotype.Component; @@ -102,11 +100,10 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ } @Override - public Collection<ModuleReference> getModuleReferences(final String dataspaceName, final String schemaSetName) { + public Map<String, String> getYangSchemaResources(final String dataspaceName, final String schemaSetName) { final Dataspace dataspace = dataspaceRepository.getByName(dataspaceName); final SchemaSet schemaSet = schemaSetRepository.getByDataspaceAndName(dataspace, schemaSetName); - final Map<String, String> yangResourceNameToContent = schemaSet.getYangResources().stream().collect( + return schemaSet.getYangResources().stream().collect( Collectors.toMap(YangResource::getName, YangResource::getContent)); - return YangTextSchemaSourceSetBuilder.of(yangResourceNameToContent).getModuleReferences(); } } |