}
}
-
- // AH:TODO: return ChangeManagementResponse
return null;
}
return currentRequestDetails.getVnfInstanceId();
}
- protected String extractServiceInstanceId(RequestDetails currentRequestDetails, String requestType) {
- try {
- String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0).getRelatedInstance().getInstanceId();
- serviceInstanceId.toString(); //throw exception in case that serviceInstanceId is null...
- return serviceInstanceId;
- } catch (Exception e) {
+ protected String extractServiceInstanceId(RequestDetails currentRequestDetails,
+ String requestType) {
+ String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0)
+ .getRelatedInstance().getInstanceId();
+ if (serviceInstanceId == null) {
logger.error("Failed to extract serviceInstanceId");
throw new BadRequestException("No instanceId in request " + requestType);
}
+ return serviceInstanceId;
}
@Override
dataAccessService.saveDomainObject(vnfList.get(0), null);
} catch (NonUniqueObjectException e) {
//In case the relation already exists, we continue running on the list
+ logger.debug("NonUniqueObjectException in addVnfWorkflowRelation", e);
}
}
return vnfWorkflowRelationResponse;
}
private boolean validateJsonOutput(org.json.JSONObject json) {
- if (!json.has(PRIMARY_KEY) || !json.getJSONObject(PRIMARY_KEY).keySet().containsAll(REQUIRED_KEYS))
- return false;
- return true;
+ boolean isValid = true;
+ if (!json.has(PRIMARY_KEY)
+ || !json.getJSONObject(PRIMARY_KEY).keySet().containsAll(REQUIRED_KEYS)) {
+ isValid = false;
+ }
+ return isValid;
}
}
lcpCloudRegionId = msoRequest.extractValueByPathUsingAdditionalProperties(LCP_CLOUD_REGION_ID_PATH, String.class);
}
catch (NotFoundException exception) {
- LOGGER.debug("Can't find lcp region in RequestDetails. Assume no cloudOwner enrichment is needed. Reason: "+exception.getMessage());
+ LOGGER.debug("Can't find lcp region in RequestDetails. Assume no cloudOwner enrichment is needed. Reason: ", exception);
return;
}
String cloudOwner = aaiClient.getCloudOwnerByCloudRegionId(lcpCloudRegionId);