diff options
Diffstat (limited to 'cps-ri/src/main')
-rwxr-xr-x | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java index 56a046496e..13710dbec0 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java @@ -107,6 +107,12 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic } @Override + public Anchor getAnchor(final String dataspaceName, final String anchorName) { + final AnchorEntity anchorEntity = getAnchorEntity(dataspaceName, anchorName); + return toAnchor(anchorEntity); + } + + @Override public Collection<Anchor> getAnchors(final String dataspaceName) { final var dataspaceEntity = dataspaceRepository.getByName(dataspaceName); final Collection<AnchorEntity> anchorEntities = anchorRepository.findAllByDataspace(dataspaceEntity); @@ -114,7 +120,14 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic } @Override - public Collection<Anchor> getAnchors(final String dataspaceName, final String schemaSetName) { + public Collection<Anchor> getAnchors(final String dataspaceName, final Collection<String> anchorNames) { + final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); + return anchorRepository.findAllByDataspaceAndNameIn(dataspaceEntity, anchorNames) + .stream().map(CpsAdminPersistenceServiceImpl::toAnchor).collect(Collectors.toSet()); + } + + @Override + public Collection<Anchor> getAnchorsBySchemaSetName(final String dataspaceName, final String schemaSetName) { final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); final SchemaSetEntity schemaSetEntity = schemaSetRepository.getByDataspaceAndName( dataspaceEntity, schemaSetName); @@ -124,7 +137,8 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic } @Override - public Collection<Anchor> getAnchors(final String dataspaceName, final Collection<String> schemaSetNames) { + public Collection<Anchor> getAnchorsBySchemaSetNames(final String dataspaceName, + final Collection<String> schemaSetNames) { final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); return anchorRepository.findAllByDataspaceAndSchemaSetNameIn(dataspaceEntity, schemaSetNames) .stream().map(CpsAdminPersistenceServiceImpl::toAnchor).collect(Collectors.toSet()); @@ -137,11 +151,6 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic inputModuleNames.size()); } - @Override - public Anchor getAnchor(final String dataspaceName, final String anchorName) { - return toAnchor(getAnchorEntity(dataspaceName, anchorName)); - } - @Transactional @Override public void deleteAnchor(final String dataspaceName, final String anchorName) { |