diff options
author | Steve Smokowski <ss835w@att.com> | 2019-06-07 17:38:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-07 17:38:46 +0000 |
commit | 1196db4be81e49b8282908e76c6f0f72a29ccb9f (patch) | |
tree | aa9d43687739b73452513f2c6ff28ec3b37ca2eb /bpmn/so-bpmn-tasks/src/main/java | |
parent | e840e62a5b19755134fc036ab0e3bcbaa06b74c1 (diff) | |
parent | 1520c9b3f95bd2b9c96a89a8cd4b292d78e57ff3 (diff) |
Merge "vrfvalidation exceptions not getting logged"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
2 files changed, 34 insertions, 27 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java index 6e410e9880..9092b68491 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java @@ -8,7 +8,6 @@ import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; -import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -54,11 +53,14 @@ public class VrfValidation { return null; } - protected void aaiVpnBindingValidation(org.onap.aai.domain.yang.VpnBinding aaiVpnBinding) + protected void aaiVpnBindingValidation(String relatedVpnId, org.onap.aai.domain.yang.VpnBinding aaiVpnBinding) throws VrfBondingServiceException { - if (aaiVpnBinding == null || !aaiVpnBinding.getVpnType().equalsIgnoreCase("SERVICE-INFRASTRUCTURE")) { - throw new VrfBondingServiceException("VpnBinding: " + aaiVpnBinding.getVpnId() - + " does not have service type of BONDING and doesn not have service role of INFRASTRUCTURE-VPN"); + if (aaiVpnBinding == null) { + throw new VrfBondingServiceException("The infrastructure vpn " + relatedVpnId + " does not exist in A&AI."); + } else if (aaiVpnBinding.getVpnType() != null + && !aaiVpnBinding.getVpnType().equalsIgnoreCase("SERVICE-INFRASTRUCTURE")) { + throw new VrfBondingServiceException( + "VpnBinding: " + relatedVpnId + " does not have a vpn type of SERVICE-INFRASTRUCTURE."); } } @@ -84,6 +86,13 @@ public class VrfValidation { } } + protected void aaiNetworkValidation(String relatedNetworkid, org.onap.aai.domain.yang.L3Network aaiLocalNetwork) + throws VrfBondingServiceException { + if (aaiLocalNetwork == null) { + throw new VrfBondingServiceException("The local network " + relatedNetworkid + " does not exist in A&AI."); + } + } + protected void aaiSubnetValidation(org.onap.aai.domain.yang.L3Network aaiLocalNetwork) throws VrfBondingServiceException { if (aaiLocalNetwork.getSubnets() == null || aaiLocalNetwork.getSubnets().getSubnet() == null) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 73b0b5483e..4958e123fb 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -368,7 +368,7 @@ public class WorkflowAction { execution.setVariable("isRollbackComplete", false); } catch (Exception ex) { - buildAndThrowException(execution, "Exception in create execution list " + ex.getMessage(), ex); + buildAndThrowException(execution, "Exception in create execution list. " + ex.getMessage(), ex); } } @@ -623,7 +623,8 @@ public class WorkflowAction { } protected void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest, - List<Resource> resourceCounter, List<Pair<WorkflowType, String>> aaiResourceIds) { + List<Resource> resourceCounter, List<Pair<WorkflowType, String>> aaiResourceIds) + throws JsonProcessingException, VrfBondingServiceException { String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId(); org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID); if (service == null) { @@ -646,27 +647,24 @@ public class WorkflowAction { protected void traverseVrfConfiguration(DelegateExecution execution, List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceCounter, org.onap.so.db.catalog.beans.Service service, RelatedInstance relatedVpnBinding, - RelatedInstance relatedLocalNetwork) { - try { - org.onap.aai.domain.yang.L3Network aaiLocalNetwork = - bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId()); - vrfValidation.vrfServiceValidation(service); - vrfValidation.vrfCatalogDbChecks(service); - vrfValidation - .aaiVpnBindingValidation(bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId())); - vrfValidation.aaiSubnetValidation(aaiLocalNetwork); - vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork); - vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork); - String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork); - if (existingAAIVrfConfiguration != null) { - aaiResourceIds - .add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration)); - } - resourceCounter.add(new Resource(WorkflowType.CONFIGURATION, - service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false)); - } catch (VrfBondingServiceException | JsonProcessingException e) { - buildAndThrowException(execution, e.getMessage()); + RelatedInstance relatedLocalNetwork) throws VrfBondingServiceException, JsonProcessingException { + org.onap.aai.domain.yang.L3Network aaiLocalNetwork = + bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId()); + vrfValidation.vrfServiceValidation(service); + vrfValidation.vrfCatalogDbChecks(service); + vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(), + bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId())); + vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork); + vrfValidation.aaiSubnetValidation(aaiLocalNetwork); + vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork); + vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork); + String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork); + if (existingAAIVrfConfiguration != null) { + aaiResourceIds.add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration)); } + resourceCounter.add(new Resource(WorkflowType.CONFIGURATION, + service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false)); + } protected String getExistingAAIVrfConfiguration(RelatedInstance relatedVpnBinding, |