diff options
author | Plummer, Brittany <brittany.plummer@att.com> | 2019-05-31 11:48:34 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-05-31 11:48:47 -0400 |
commit | a5af334f3b70d927565c33390807d5c49593822e (patch) | |
tree | 460d2272b7c3f53c7182344f9cdf28f6a3e8f615 /mso-api-handlers/mso-api-handler-infra/src/main/java | |
parent | ec71f01963e4c5c70d11f41842c7cd9cfd38316d (diff) |
apih to populate original request id
Updated schema.sql to fix failing tests
Added constants for request parameters
Added originalRequestId to be saved on resume request
Added originalRequestId to orchestrationRequests response
Change-Id: If2b86d233ee3db9bbe0e1185d92874bca2b3a07a
Issue-ID: SO-1960
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java')
3 files changed, 10 insertions, 3 deletions
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 ff8b5d14cd..e14b01792a 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 @@ -290,7 +290,7 @@ public class OrchestrationRequests { return Response.status(HttpStatus.SC_NO_CONTENT).entity("").build(); } - private Request mapInfraActiveRequestToRequest(InfraActiveRequests iar, boolean includeCloudRequest) + protected Request mapInfraActiveRequestToRequest(InfraActiveRequests iar, boolean includeCloudRequest) throws ApiException { String requestBody = iar.getRequestBody(); Request request = new Request(); @@ -304,6 +304,11 @@ public class OrchestrationRequests { String flowStatusMessage = iar.getFlowStatus(); String retryStatusMessage = iar.getRetryStatusMessage(); + String originalRequestId = iar.getOriginalRequestId(); + if (originalRequestId != null) { + request.setOriginalRequestId(originalRequestId); + } + InstanceReferences ir = new InstanceReferences(); if (iar.getNetworkId() != null) ir.setNetworkInstanceId(iar.getNetworkId()); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java index f6fc88d559..2a0718aeba 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java @@ -621,7 +621,8 @@ public class RequestHandlerUtils { } protected InfraActiveRequests createNewRecordCopyFromInfraActiveRequest(InfraActiveRequests infraActiveRequest, - String requestId, Timestamp startTimeStamp, String source, String requestUri, String requestorId) { + String requestId, Timestamp startTimeStamp, String source, String requestUri, String requestorId, + String originalRequestId) { InfraActiveRequests request = new InfraActiveRequests(); request.setRequestId(requestId); request.setStartTime(startTimeStamp); @@ -630,6 +631,7 @@ public class RequestHandlerUtils { request.setProgress(new Long(5)); request.setRequestorId(requestorId); request.setRequestStatus(Status.IN_PROGRESS.toString()); + request.setOriginalRequestId(originalRequestId); request.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER); if (infraActiveRequest != null) { request.setTenantId(infraActiveRequest.getTenantId()); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java index 6ca23a339b..abf3729215 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java @@ -106,7 +106,7 @@ public class ResumeOrchestrationRequest { } InfraActiveRequests currentActiveRequest = requestHandlerUtils.createNewRecordCopyFromInfraActiveRequest( - infraActiveRequest, currentRequestId, startTimeStamp, source, requestUri, requestorId); + infraActiveRequest, currentRequestId, startTimeStamp, source, requestUri, requestorId, requestId); if (infraActiveRequest == null) { logger.error("No infraActiveRequest record found for requestId: {} in requesteDb lookup", requestId); |