aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-01-23 15:56:05 +0200
committerIttay Stern <ittay.stern@att.com>2020-01-23 16:25:08 +0200
commit29a97a7fe7fa9c3c50fba299a7b1cf121be05b07 (patch)
treecc0ba104e456bddcf77bd0a20c3b1e2b2427794e /vid-app-common/src/main/java
parentc0fdfc29078390e1fcf9276af12613855cf7ca37 (diff)
Revert "Promise Request-id header: Check MDC value if no header"
This reverts commit 1420dc49 Issue-ID: VID-647 Change-Id: Ib33ae33ba0d1482eddf4d85fcc15f9bc6569e00c Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseRequestIdFilter.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseRequestIdFilter.java b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseRequestIdFilter.java
index 1c96819c8..faaf55ae7 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseRequestIdFilter.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseRequestIdFilter.java
@@ -41,10 +41,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
-import org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs;
import org.onap.vid.logging.Headers;
import org.onap.vid.logging.RequestIdHeader;
-import org.slf4j.MDC;
import org.springframework.web.filter.GenericFilterBean;
@WebFilter(urlPatterns = "/*")
@@ -84,17 +82,12 @@ public class PromiseRequestIdFilter extends GenericFilterBean {
if (isWrapNeeded(highestPriorityHeader, originalRequestId)) {
// Copy originalRequestId to the promised header value
- request = new PromiseRequestIdRequestWrapper(httpRequest,
- firstValidUuidOrElse(originalRequestId, requestIdFromMDC(), UUID::randomUUID));
+ request = new PromiseRequestIdRequestWrapper(httpRequest, toUuidOrElse(originalRequestId, UUID::randomUUID));
}
return request;
}
- private String requestIdFromMDC() {
- return MDC.get(MDCs.REQUEST_ID);
- }
-
private boolean verifyAndValidateUuid(String value) {
return isNotEmpty(value) && uuidRegex.matcher(value).matches();
}
@@ -106,10 +99,6 @@ public class PromiseRequestIdFilter extends GenericFilterBean {
return !headerExistsAndValid;
}
- UUID firstValidUuidOrElse(String uuid1, String uuid2, Supplier<UUID> uuidSupplier) {
- return toUuidOrElse(uuid1, () -> toUuidOrElse(uuid2, uuidSupplier));
- }
-
UUID toUuidOrElse(String uuid, Supplier<UUID> uuidSupplier) {
if (verifyAndValidateUuid(uuid)) {
try {