summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
index bf76cd3174..64c42a0498 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
@@ -451,7 +451,7 @@ public class MsoRequest {
}
public void createErrorRequestRecord(Status status, String requestId, String errorMessage, Actions action,
- String requestScope, String requestJSON, String serviceInstanceId) {
+ String requestScope, String requestJSON, String serviceInstanceId, ServiceInstancesRequest sir) {
try {
InfraActiveRequests request = new InfraActiveRequests(requestId);
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
@@ -469,6 +469,17 @@ public class MsoRequest {
Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
request.setEndTime(endTimeStamp);
request.setRequestUrl(MDC.get(LogConstants.HTTP_URL));
+ if (sir != null) {
+ if (sir.getRequestDetails() != null && sir.getRequestDetails().getRequestInfo() != null) {
+ request.setRequestorId(sir.getRequestDetails().getRequestInfo().getRequestorId());
+ request.setSource(sir.getRequestDetails().getRequestInfo().getSource());
+ if (ModelType.service.name().equalsIgnoreCase(requestScope)) {
+ if (sir.getRequestDetails().getRequestInfo().getInstanceName() != null) {
+ request.setServiceInstanceName(sir.getRequestDetails().getRequestInfo().getInstanceName());
+ }
+ }
+ }
+ }
requestsDbClient.save(request);
} catch (Exception e) {
logger.error("Exception when updating record in DB", e);
@@ -476,7 +487,6 @@ public class MsoRequest {
}
}
-
public Response buildResponse(int httpResponseCode, String errorCode, InfraActiveRequests inProgress) {
return buildResponseWithError(httpResponseCode, errorCode, inProgress, null);
}