From b9fdb7afe2a453c14c39c500d26c6abd2db4cfc9 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan" Date: Wed, 5 Aug 2020 10:17:14 -0400 Subject: requestorId not equal to request header pull requestorId from MDC Issue-ID: SO-3126 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I619be7ed480f40ba880499c418c6078681cbd77c --- .../org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java | 3 ++- .../main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java | 5 +++-- .../java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java | 5 +++-- .../main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java | 5 +++-- .../src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java | 5 +++-- .../main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java | 5 +++-- 6 files changed, 17 insertions(+), 11 deletions(-) (limited to 'mso-api-handlers') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java index e8046a2cd9..6e7947bb58 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java @@ -38,6 +38,7 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFou import org.onap.so.constants.Status; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; @@ -436,7 +437,7 @@ public class BpmnRequestBuilder { RequestInfo requestInfo = new RequestInfo(); requestInfo.setSuppressRollback(false); requestInfo.setSource(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)); - requestInfo.setRequestorId(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)); + requestInfo.setRequestorId(MDC.get(HttpHeadersConstants.REQUESTOR_ID)); return requestInfo; } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java index 3104c8415f..81ad3106b0 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java @@ -32,7 +32,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.fasterxml.jackson.core.JsonProcessingException; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.filters.ResponseUpdater; import org.onap.so.apihandlerinfra.Action; @@ -43,12 +42,14 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.WorkflowEngineConnection import org.onap.so.apihandlerinfra.infra.rest.handler.NetworkRestHandler; import org.onap.so.db.catalog.beans.Recipe; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -80,7 +81,7 @@ public class Network { ValidateException { String requestId = networkRestHandler.getRequestId(requestContext); - String requestorId = "Unknown"; + String requestorId = MDC.get(HttpHeadersConstants.REQUESTOR_ID); String source = MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME); String requestURI = requestContext.getUriInfo().getAbsolutePath().toString(); InfraActiveRequests currentRequest = networkRestHandler.createInfraActiveRequestForDelete(requestId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java index 7aaf470e18..515862e249 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java @@ -32,7 +32,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.fasterxml.jackson.core.JsonProcessingException; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.filters.ResponseUpdater; import org.onap.so.apihandlerinfra.Action; @@ -43,12 +42,14 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.WorkflowEngineConnection import org.onap.so.apihandlerinfra.infra.rest.handler.ServiceInstanceRestHandler; import org.onap.so.db.catalog.beans.Recipe; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -79,7 +80,7 @@ public class ServiceInstance { ValidateException { String requestId = requestHandler.getRequestId(requestContext); - String requestorId = "Unknown"; + String requestorId = MDC.get(HttpHeadersConstants.REQUESTOR_ID); String source = MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME); String requestURI = requestContext.getUriInfo().getAbsolutePath().toString(); InfraActiveRequests currentRequest = requestHandler.createInfraActiveRequestForDelete(requestId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java index ddbced98a4..81879c4281 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java @@ -32,7 +32,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.fasterxml.jackson.core.JsonProcessingException; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.filters.ResponseUpdater; import org.onap.so.apihandlerinfra.Action; @@ -43,6 +42,7 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.WorkflowEngineConnection import org.onap.so.apihandlerinfra.infra.rest.handler.VFModuleRestHandler; import org.onap.so.db.catalog.beans.Recipe; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; @@ -50,6 +50,7 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -81,7 +82,7 @@ public class VfModules { ValidateException { String requestId = restHandler.getRequestId(requestContext); - String requestorId = "Unknown"; + String requestorId = MDC.get(HttpHeadersConstants.REQUESTOR_ID); String source = MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME); String requestURL = requestContext.getUriInfo().getAbsolutePath().toString(); InfraActiveRequests currentRequest = restHandler.createInfraActiveRequestForDelete(requestId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java index 68e6eb5858..f1331a3185 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java @@ -32,7 +32,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.fasterxml.jackson.core.JsonProcessingException; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.filters.ResponseUpdater; import org.onap.so.apihandlerinfra.exceptions.ValidateException; @@ -41,12 +40,14 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.WorkflowEngineConnection import org.onap.so.apihandlerinfra.infra.rest.handler.VnfRestHandler; import org.onap.so.db.catalog.beans.Recipe; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -77,7 +78,7 @@ public class Vnf { throws AAIEntityNotFound, JsonProcessingException, WorkflowEngineConnectionException, ValidateException { String requestId = vnfRestHandler.getRequestId(requestContext); - String requestorId = "Unknown"; + String requestorId = MDC.get(HttpHeadersConstants.REQUESTOR_ID); String source = MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME); String requestURL = requestContext.getUriInfo().getAbsolutePath().toString(); InfraActiveRequests currentRequest = vnfRestHandler.createInfraActiveRequestForDelete(requestId, diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java index b842580b3f..001a8069d9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java @@ -32,7 +32,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.fasterxml.jackson.core.JsonProcessingException; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.filters.ResponseUpdater; import org.onap.so.apihandlerinfra.Action; @@ -44,6 +43,7 @@ import org.onap.so.apihandlerinfra.infra.rest.handler.VFModuleRestHandler; import org.onap.so.apihandlerinfra.infra.rest.handler.VolumeRestHandler; import org.onap.so.db.catalog.beans.Recipe; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; @@ -51,6 +51,7 @@ import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -85,7 +86,7 @@ public class Volumes { ValidateException { String requestId = volumeRestHandler.getRequestId(requestContext); - String requestorId = "Unknown"; + String requestorId = MDC.get(HttpHeadersConstants.REQUESTOR_ID); String source = MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME); String requestURL = requestContext.getUriInfo().getAbsolutePath().toString(); InfraActiveRequests currentRequest = volumeRestHandler.createInfraActiveRequestForDelete(requestId, -- cgit 1.2.3-korg