diff options
author | shrek2000 <orenkle@amdocs.com> | 2018-07-02 16:59:18 +0300 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-07-10 06:04:27 +0000 |
commit | b781a6d5303945f23b995b7c24d11fe7d44624a4 (patch) | |
tree | 600dd47927f1d21d36b60c7e26711fcb3b33e40b /catalog-be/src/main/java | |
parent | 83ef2673b1ac333559e512a006316cf740172bd6 (diff) |
Corrupted forwarding paths
When a component is deleted from service canvas, the related forwarding paths are not being deleted , and create corrupted data
Change-Id: If6a0837572e92e66d31ddf28a30f1ad3893bb8ec
Issue-ID: SDC-1449
Signed-off-by: shrek2000 <orenkle@amdocs.com>
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java index 306fadda1f..81b7c6a9c1 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java @@ -896,7 +896,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic { if (resultOp.isRight()){ return resultOp; } - Either<ComponentInstance, ResponseFormat> deleteEither = deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentId, componentInstanceId, + Either<ComponentInstance, ResponseFormat> deleteEither = deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentId, containerComponentType, resultOp); if (deleteEither.isRight()){ return deleteEither; @@ -911,17 +911,16 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } } - public Either<ComponentInstance, ResponseFormat> deleteForwardingPathsRelatedTobeDeletedComponentInstance(String containerComponentId, - String componentInstanceId, ComponentTypeEnum containerComponentType, - Either<ComponentInstance, ResponseFormat> resultOp) { + public Either<ComponentInstance, ResponseFormat> deleteForwardingPathsRelatedTobeDeletedComponentInstance(String containerComponentId, ComponentTypeEnum containerComponentType, + Either<ComponentInstance, ResponseFormat> resultOp) { if(containerComponentType.equals(ComponentTypeEnum.SERVICE) && resultOp.isLeft() ){ - - List<String> pathIDsToBeDeleted = getForwardingPathsRelatedToComponentInstance(containerComponentId, componentInstanceId); - if (!pathIDsToBeDeleted.isEmpty()) { - Either<Set<String>, ResponseFormat> deleteForwardingPathsEither = deleteForwardingPaths(containerComponentId, - pathIDsToBeDeleted); - if(deleteForwardingPathsEither.isRight()) { - resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + final ComponentInstance componentInstance = resultOp.left().value(); + List<String> pathIDsToBeDeleted = getForwardingPathsRelatedToComponentInstance(containerComponentId, componentInstance.getName()); + if (!pathIDsToBeDeleted.isEmpty()) { + Either<Set<String>, ResponseFormat> deleteForwardingPathsEither = deleteForwardingPaths(containerComponentId, + pathIDsToBeDeleted); + if(deleteForwardingPathsEither.isRight()) { + resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); } } |