diff options
author | niamhcore <niamh.core@est.tech> | 2021-12-13 10:34:52 +0000 |
---|---|---|
committer | niamhcore <niamh.core@est.tech> | 2021-12-14 14:24:04 +0000 |
commit | 3aeb338680572b151e88c4065a541fc859f585be (patch) | |
tree | 7ad1e4949e60545473fdc75d5484e3d44b2beb81 /cps-ncmp-service/src/main/java/org | |
parent | 5af63eb8c5a32180f1c1d52048fe3390305dc4ac (diff) |
Add exception handling to delete schema set when a registration is removed
Issue-ID: CPS-783
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: Ief4c6727e788822bc29379a757d25dff14f68c94
Diffstat (limited to 'cps-ncmp-service/src/main/java/org')
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 12 |
1 files changed, 10 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 faa2efe3a9..62a0922d03 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 @@ -297,8 +297,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService private void parseAndRemoveCmHandlesInDmiRegistration(final DmiPluginRegistration dmiPluginRegistration) { for (final String cmHandle : dmiPluginRegistration.getRemovedCmHandles()) { try { - cpsModuleService.deleteSchemaSet(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, cmHandle, - CASCADE_DELETE_ALLOWED); + attemptToDeleteSchemaSetWithCascade(cmHandle); cpsDataService.deleteListOrListElement(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, "/dmi-registry/cm-handles[@id='" + cmHandle + "']", NO_TIMESTAMP); } catch (final DataNodeNotFoundException e) { @@ -307,6 +306,15 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } } + private void attemptToDeleteSchemaSetWithCascade(final String schemaSetName) { + try { + cpsModuleService.deleteSchemaSet(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, schemaSetName, + CASCADE_DELETE_ALLOWED); + } catch (final Exception e) { + log.warn("Schema set {} delete failed, reason {}", schemaSetName, e.getMessage()); + } + } + private void syncAndCreateSchemaSet(final PersistenceCmHandle persistenceCmHandle) { final List<ModuleReference> moduleReferencesFromCmHandle = |