X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=mso-api-handlers%2Fmso-api-handler-infra%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fso%2Fapihandlerinfra%2FOrchestrationRequests.java;h=5bf33b417aa0684691a28f5fe12955dc2d9d0163;hb=4eb30b65fcf63b3bd13f3f10bbbfed85057ded4d;hp=c43a0505002246edad0d019d18cfd3fefef0daf7;hpb=f3f71ebedb39bd2cc329cfcb3972acb42ecb7fc8;p=so.git diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index c43a050500..5bf33b417a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -46,10 +46,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.EnumUtils; import org.apache.http.HttpStatus; import org.onap.logging.ref.slf4j.ONAPLogConstants; +import org.onap.logging.filter.base.ErrorCode; import org.onap.so.apihandler.common.ErrorNumbers; import org.onap.so.apihandler.common.ResponseBuilder; import org.onap.so.apihandlerinfra.exceptions.ApiException; -import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException; import org.onap.so.apihandlerinfra.exceptions.ValidateException; import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo; import org.onap.so.constants.OrchestrationRequestFormat; @@ -58,7 +58,6 @@ import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.beans.RequestProcessingData; import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.exceptions.ValidationException; -import org.onap.logging.filter.base.ErrorCode; import org.onap.so.logger.MessageEnum; import org.onap.so.serviceinstancebeans.CloudRequestData; import org.onap.so.serviceinstancebeans.GetOrchestrationListResponse; @@ -214,7 +213,7 @@ public class OrchestrationRequests { if (isRequestProcessingDataRequired(format)) { List requestProcessingData = - requestsDbClient.getRequestProcessingDataBySoRequestId(infraActive.getRequestId()); + requestsDbClient.getExternalRequestProcessingDataBySoRequestId(infraActive.getRequestId()); if (null != requestProcessingData && !requestProcessingData.isEmpty()) { request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData)); } @@ -311,6 +310,19 @@ public class OrchestrationRequests { request.setOriginalRequestId(originalRequestId); } + if (!version.matches("v[1-7]")) { + String workflowName = iar.getWorkflowName(); + if (workflowName == null) { + workflowName = iar.getRequestAction(); + } + request.setWorkflowName(workflowName); + + String operationName = iar.getOperationName(); + if (operationName != null) { + request.setOperationName(operationName); + } + } + InstanceReferences ir = new InstanceReferences(); if (iar.getNetworkId() != null) ir.setNetworkInstanceId(iar.getNetworkId()); @@ -357,16 +369,7 @@ public class OrchestrationRequests { } } catch (IOException e) { - logger.error("Exception occurred", e); - ErrorLoggerInfo errorLoggerInfo = - new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError) - .build(); - ValidateException validateException = - new ValidateException.Builder("Mapping of request to JSON object failed : ", - HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e) - .errorInfo(errorLoggerInfo).build(); - - throw validateException; + logger.error(String.format("Failed to parse request (id: %s) : ", request.getRequestId()), e); } } request.setRequestDetails(requestDetails);