diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java')
3 files changed, 17 insertions, 2 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index d5500b8d7a..d26a59b054 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -393,7 +393,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } private void batchDeleteCmHandlesFromDbAndModuleSyncMap(final Collection<String> tobeRemovedCmHandles) { - tobeRemovedCmHandles.forEach(inventoryPersistence::deleteSchemaSetWithCascade); + inventoryPersistence.deleteSchemaSetsWithCascade(tobeRemovedCmHandles); inventoryPersistence.deleteDataNodes(mapCmHandleIdsToXpaths(tobeRemovedCmHandles)); tobeRemovedCmHandles.forEach(this::removeDeletedCmHandleFromModuleSyncMap); } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java index d22cf0e16a..cbd30a8fef 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java @@ -115,6 +115,13 @@ public interface InventoryPersistence { void deleteSchemaSetWithCascade(String schemaSetName); /** + * Method to delete multiple schema sets. + * + * @param schemaSetNames schema set names + */ + void deleteSchemaSetsWithCascade(Collection<String> schemaSetNames); + + /** * Get data node via xpath. * * @param xpath xpath diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java index 1c799c6b26..c8d6c05f96 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java @@ -169,6 +169,14 @@ public class InventoryPersistenceImpl implements InventoryPersistence { } @Override + @Timed(value = "cps.ncmp.inventory.persistence.schemaset.delete.batch", + description = "Time taken to delete multiple schemaset") + public void deleteSchemaSetsWithCascade(final Collection<String> schemaSetNames) { + cpsValidator.validateNameCharacters(schemaSetNames); + cpsModuleService.deleteSchemaSetsWithCascade(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, schemaSetNames); + } + + @Override @Timed(value = "cps.ncmp.inventory.persistence.datanode.get", description = "Time taken to get a data node (from ncmp dmi registry)") public Collection<DataNode> getDataNode(final String xpath) { @@ -239,4 +247,4 @@ public class InventoryPersistenceImpl implements InventoryPersistence { private static String createCmHandleJsonData(final String cmHandleId) { return "{\"cm-handles\":[" + cmHandleId + "]}"; } -}
\ No newline at end of file +} |