aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
diff options
context:
space:
mode:
authorshrek2000 <orenkle@amdocs.com>2018-07-02 16:59:18 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-07-10 06:04:27 +0000
commitb781a6d5303945f23b995b7c24d11fe7d44624a4 (patch)
tree600dd47927f1d21d36b60c7e26711fcb3b33e40b /catalog-be/src/main/java/org
parent83ef2673b1ac333559e512a006316cf740172bd6 (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/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java21
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));
}
}