diff options
author | Manamohan <MS00534989@Techmahindra.com> | 2019-08-16 11:45:52 +0530 |
---|---|---|
committer | Manamohan <MS00534989@Techmahindra.com> | 2019-08-16 11:45:52 +0530 |
commit | 35de0e3132b7bce8eb3c289456edafdbf4a17ba2 (patch) | |
tree | 82fcae05e311e22571a00d8e436cfaf3e16be7e5 /bpmn/so-bpmn-tasks | |
parent | f075d8a5830e36960036c18c28064e3959e03da4 (diff) |
Javadoc and logging improvement
Added Javadocs and logging for these classes.
Change-Id: I365fc0677c0d5136e4579de3947d0478b26c22d3
Issue-ID: SO-2052
Signed-off-by: Manamohan <MS00534989@Techmahindra.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks')
4 files changed, 33 insertions, 8 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java index 9396f9dbfc..4285e9aa84 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java @@ -47,6 +47,7 @@ import static org.apache.commons.lang3.StringUtils.*; @Component public class VnfAdapterCreateTasks { + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class); public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_"; private static final String VNFREST_REQUEST = "VNFREST_Request"; @@ -85,7 +86,9 @@ public class VnfAdapterCreateTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BBObjectNotFoundException bbException) { - // If there is not a vf module in the general building block (in aLaCarte case), we will not retrieve + logger.error("Exception occurred", bbException); + // If there is not a vf module in the general building block (in aLaCarte case), + // we will not retrieve // the SDNCQueryResponse and proceed as normal without throwing an error } @@ -94,6 +97,7 @@ public class VnfAdapterCreateTasks { genericVnf, volumeGroup, sdncVfModuleQueryResponse); execution.setVariable(VNFREST_REQUEST, createVolumeGroupRequest.toXmlString()); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -117,6 +121,8 @@ public class VnfAdapterCreateTasks { try { volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID); } catch (BBObjectNotFoundException bbException) { + logger.error("Exception occurred if bb objrct not found in VnfAdapterCreateTasks createVfModule ", + bbException); } CloudRegion cloudRegion = gBBInput.getCloudRegion(); RequestContext requestContext = gBBInput.getRequestContext(); @@ -129,9 +135,9 @@ public class VnfAdapterCreateTasks { volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse); execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString()); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } - } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java index 1dcdfa912c..b8f5c8629d 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java @@ -96,6 +96,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.SERVICE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -117,7 +118,6 @@ public class SDNCAssignTasks extends AbstractSDNCTask { Customer customer = gBBInput.getCustomer(); CloudRegion cloudRegion = gBBInput.getCloudRegion(); SDNCRequest sdncRequest = new SDNCRequest(); - GenericResourceApiVnfOperationInformation req = sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext, Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest)); @@ -125,10 +125,12 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VNF); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** * BPMN access method to assigning the vfModule in SDNC. * @@ -160,6 +162,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VFMODULE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java index 7478479a86..080d6d34b1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java @@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * This class is used for quering the SDNC + * This class is used for querying the SDNC. */ @Component public class SDNCQueryTasks { @@ -78,16 +78,19 @@ public class SDNCQueryTasks { String response = sdncVnfResources.queryVnf(genericVnf); execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response); } catch (BadResponseException ex) { + logger.error("Exception occurred", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } + /** * BPMN access method to query the SDNC for fetching the VfModule details. * @@ -116,12 +119,14 @@ public class SDNCQueryTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BadResponseException ex) { + logger.error("Exception occurred for BadResponse ", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -144,20 +149,26 @@ public class SDNCQueryTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BBObjectNotFoundException bbException) { - // If there is not a vf module in the general building block, we will not call SDNC and proceed as normal + logger.error("Error occurred if bb object not found in SDNCQueryTasks queryVfModuleForVolumeGroup ", + bbException); + // If there is not a vf module in the general building block, we will not call + // SDNC and proceed as normal // without throwing an error - // If we see a bb object not found exception for something that is not a vf module id, then we should throw + // If we see a bb object not found exception for something that is not a vf + // module id, then we should throw // the error as normal if (!ResourceKey.VF_MODULE_ID.equals(bbException.getResourceKey())) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, TargetEntity.SO); } } catch (BadResponseException ex) { + logger.error("Error occurred for BadResponseException in SDNCQueryTasks queryVfModuleForVolumeGroup ", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 7eaf011c75..8822bc39dd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -55,7 +55,6 @@ public class OrchestrationStatusValidator { private static final String MULTI_STAGE_DESIGN_OFF = "false"; private static final String MULTI_STAGE_DESIGN_ON = "true"; - @Autowired private ExtractPojosForBB extractPojosForBB; @Autowired @@ -63,6 +62,7 @@ public class OrchestrationStatusValidator { @Autowired private CatalogDbClient catalogDbClient; + /** * This method validate's the status of the OrchestrationStatus against the buildingBlockDetail ResourceType * @@ -137,7 +137,8 @@ public class OrchestrationStatusValidator { OrchestrationStatusValidationDirective.VALIDATION_SKIPPED); return; default: - // can't currently get here, so not tested. Added in case enum is expanded without a change to this + // can't currently get here, so not tested. Added in case enum is expanded + // without a change to this // code throw new OrchestrationStatusValidationException( String.format(UNKNOWN_RESOURCE_TYPE, buildingBlockFlowName, @@ -172,6 +173,9 @@ public class OrchestrationStatusValidator { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, orchestrationStatusStateTransitionDirective.getFlowDirective()); } catch (BBObjectNotFoundException ex) { + logger.error( + "Error occurred for bb object notfound in OrchestrationStatusValidator validateOrchestrationStatus ", + ex); if (execution.getFlowToBeCalled().contains("Unassign")) { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, OrchestrationStatusValidationDirective.SILENT_SUCCESS); @@ -179,6 +183,7 @@ public class OrchestrationStatusValidator { exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex); } } catch (Exception e) { + logger.error("Exception occurred", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e); } } |