aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
authorOren Kleks <orenkle@amdocs.com>2019-02-14 17:31:35 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-02-19 07:37:39 +0000
commitb123ebd394134c95723fb96cf5c05af3580330a8 (patch)
tree053bba3dc7ca1ca380e7651e18816336073670b0 /catalog-be/src
parent5930a00104a710b4c5abb1cfec2f4b7c978378c1 (diff)
Fix Logger Creation
Add dependent child service to service Issue-ID: SDC-1987 Change-Id: Ibfac137cbdc296d4b3fc97937054f879aeeaf46f Signed-off-by: shrek2000 <orenkle@amdocs.com>
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java42
1 files changed, 22 insertions, 20 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
index 9bf442990b..b426d66598 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
@@ -2355,28 +2355,30 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic {
Either<CINodeFilterDataDefinition, StorageOperationStatus> result;
Either<Boolean, ResponseFormat> lockResult = null;
- if (lock) {
- lockResult =
- lockComponent(storedService.getUniqueId(), storedService, "Add or Update Service Filter on Service");
- if (lockResult.isRight()) {
- log.debug("Failed to lock service {}. Response is {}. ", storedService.getName(),
- lockResult.right().value().getFormattedMessage());
- return Either.right(lockResult.right().value());
- } else {
- log.debug("The service with system name {} locked. ", storedService.getSystemName());
+ CINodeFilterDataDefinition serviceFilterResult = null;
+ try {
+ if (lock) {
+ lockResult =
+ lockComponent(storedService.getUniqueId(), storedService, "Add or Update Service Filter on Service");
+ if (lockResult.isRight()) {
+ log.debug("Failed to lock service {}. Response is {}. ", storedService.getName(),
+ lockResult.right().value().getFormattedMessage());
+ return Either.right(lockResult.right().value());
+ } else {
+ log.debug("The service with system name {} locked. ", storedService.getSystemName());
+ }
}
- }
- Optional<ComponentInstance> componentInstanceOptional = storedService.getComponentInstanceById(componentInstanceId);
- if (!componentInstanceOptional.isPresent()){
- return Either.right(ResponseFormatManager.getInstance().getResponseFormat(ActionStatus.NODE_FILTER_NOT_FOUND));
- }
- CINodeFilterDataDefinition serviceFilter = componentInstanceOptional.get().getNodeFilter();
- if(serviceFilter == null){
- return Either.right(ResponseFormatManager.getInstance().getResponseFormat(ActionStatus.NODE_FILTER_NOT_FOUND));
- }
- CINodeFilterDataDefinition serviceFilterResult;
- try {
+ Optional<ComponentInstance> componentInstanceOptional = storedService.getComponentInstanceById(componentInstanceId);
+ if (!componentInstanceOptional.isPresent()){
+ return Either.right(ResponseFormatManager.getInstance().getResponseFormat(ActionStatus.NODE_FILTER_NOT_FOUND));
+ }
+ CINodeFilterDataDefinition serviceFilter = componentInstanceOptional.get().getNodeFilter();
+ if(serviceFilter == null){
+ return Either.right(ResponseFormatManager.getInstance().getResponseFormat(ActionStatus.NODE_FILTER_NOT_FOUND));
+ }
+
+
switch (action) {
case ADD:
RequirementNodeFilterPropertyDataDefinition newProperty = new RequirementNodeFilterPropertyDataDefinition();