diff options
Diffstat (limited to 'cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java')
-rwxr-xr-x | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java | 7 |
1 files changed, 3 insertions, 4 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 ddbfeb228..1b8f1968b 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 @@ -27,8 +27,7 @@ import org.onap.cps.spi.CpsAdminPersistenceService; import org.onap.cps.spi.entities.AnchorEntity; import org.onap.cps.spi.entities.DataspaceEntity; import org.onap.cps.spi.entities.SchemaSetEntity; -import org.onap.cps.spi.exceptions.AnchorAlreadyDefinedException; -import org.onap.cps.spi.exceptions.DataspaceAlreadyDefinedException; +import org.onap.cps.spi.exceptions.AlreadyDefinedException; import org.onap.cps.spi.model.Anchor; import org.onap.cps.spi.repository.AnchorRepository; import org.onap.cps.spi.repository.DataspaceRepository; @@ -54,7 +53,7 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic try { dataspaceRepository.save(new DataspaceEntity(dataspaceName)); } catch (final DataIntegrityViolationException e) { - throw new DataspaceAlreadyDefinedException(dataspaceName, e); + throw AlreadyDefinedException.forDataspace(dataspaceName, e); } } @@ -71,7 +70,7 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic try { anchorRepository.save(anchorEntity); } catch (final DataIntegrityViolationException e) { - throw new AnchorAlreadyDefinedException(dataspaceName, anchorName, e); + throw AlreadyDefinedException.forAnchor(anchorName, dataspaceName, e); } } |