diff options
Diffstat (limited to 'aai-els-onap-logging/src/main/java/org/onap/logging/filter/base')
10 files changed, 21 insertions, 40 deletions
diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java index ce2f4489..222b98c2 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java @@ -21,6 +21,7 @@ package org.onap.logging.filter.base; import javax.servlet.http.HttpServletRequest; + import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java index ab1daab5..dea496a5 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java @@ -24,6 +24,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.UUID; + import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractServletFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractServletFilter.java index 28495c84..7f8017f7 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractServletFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AbstractServletFilter.java @@ -21,6 +21,7 @@ package org.onap.logging.filter.base; import java.util.Enumeration; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.core.HttpHeaders; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogContainerFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogContainerFilter.java index a0194850..530d53b3 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogContainerFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogContainerFilter.java @@ -21,15 +21,14 @@ package org.onap.logging.filter.base; import java.io.IOException; + import javax.annotation.Priority; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.container.*; import javax.ws.rs.core.Context; -import javax.ws.rs.ext.Provider; import javax.ws.rs.ext.Providers; + import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.slf4j.MDC; @Priority(1) diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogServletFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogServletFilter.java index a8f5eae9..c2d8a96f 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogServletFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/AuditLogServletFilter.java @@ -23,6 +23,7 @@ package org.onap.logging.filter.base; import java.io.IOException; + import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; @@ -31,6 +32,7 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.MDC; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java index 369a9f20..9b2503b7 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java @@ -27,9 +27,11 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.UUID; + import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; + import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,7 +88,7 @@ public class MDCSetup { return requestId; } if (requestId != null && !requestId.isEmpty()) { - //invalid + // invalid return UUID.randomUUID().toString(); } logger.trace("No valid X-ONAP-RequestID header value. Checking X-RequestID header for requestId."); @@ -95,7 +97,7 @@ public class MDCSetup { return requestId; } if (requestId != null && !requestId.isEmpty()) { - //invalid + // invalid return UUID.randomUUID().toString(); } logger.trace("No valid X-RequestID header value. Checking X-TransactionID header for requestId."); @@ -104,7 +106,7 @@ public class MDCSetup { return requestId; } if (requestId != null && !requestId.isEmpty()) { - //invalid + // invalid return UUID.randomUUID().toString(); } logger.trace("No valid X-TransactionID header value. Checking X-ECOMP-RequestID header for requestId."); @@ -113,11 +115,12 @@ public class MDCSetup { return requestId; } if (requestId != null && !requestId.isEmpty()) { - //invalid + // invalid return UUID.randomUUID().toString(); } return requestId; } + protected boolean isValidUUID(String transId) { try { UUID.fromString(transId); @@ -126,6 +129,7 @@ public class MDCSetup { } return true; } + public void setInvocationId(SimpleMap headers) { String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID); if (invocationId == null || invocationId.isEmpty()) @@ -200,7 +204,7 @@ public class MDCSetup { } public void clearClientMDCs() { - //MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID); + // MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID); MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION); MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE); MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE); @@ -230,7 +234,7 @@ public class MDCSetup { logger.info("System property was null or empty. Checking environment variable for: {}", property); propertyValue = System.getenv(property); if (propertyValue == null || propertyValue.isEmpty()) { - logger.info("Environment variable: {} was null or empty", property ); + logger.info("Environment variable: {} was null or empty", property); } } return propertyValue; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MetricLogClientFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MetricLogClientFilter.java index da4d9827..986d1895 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MetricLogClientFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MetricLogClientFilter.java @@ -25,10 +25,8 @@ import javax.ws.rs.client.ClientRequestContext; import javax.ws.rs.client.ClientRequestFilter; import javax.ws.rs.client.ClientResponseContext; import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.container.PreMatching; import javax.ws.rs.core.Context; import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; import javax.ws.rs.ext.Providers; @Priority(0) diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/ONAPComponents.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/ONAPComponents.java index 06fbba9a..5465b7ce 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/ONAPComponents.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/ONAPComponents.java @@ -24,35 +24,7 @@ import java.util.EnumSet; import java.util.Set; public enum ONAPComponents implements ONAPComponentsList { - OPENSTACK_ADAPTER, - BPMN, - GRM, - AAI, - DMAAP, - POLICY, - CATALOG_DB, - REQUEST_DB, - SNIRO, - SDC, - EXTERNAL, - VNF_ADAPTER, - SDNC_ADAPTER, - MULTICLOUD, - CLAMP, - PORTAL, - VID, - APPC, - DCAE, - HOLMES, - SDNC, - SO, - VFC, - ESR, - DBC, - DR, - MR, - OPTF; - + OPENSTACK_ADAPTER, BPMN, GRM, AAI, DMAAP, POLICY, CATALOG_DB, REQUEST_DB, SNIRO, SDC, EXTERNAL, VNF_ADAPTER, SDNC_ADAPTER, MULTICLOUD, CLAMP, PORTAL, VID, APPC, DCAE, HOLMES, SDNC, SO, VFC, ESR, DBC, DR, MR, OPTF; public static Set<ONAPComponents> getSOInternalComponents() { return EnumSet.of(OPENSTACK_ADAPTER, BPMN, CATALOG_DB, REQUEST_DB, VNF_ADAPTER, SDNC_ADAPTER); diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingClientFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingClientFilter.java index 88c95aa4..1908d45f 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingClientFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingClientFilter.java @@ -28,6 +28,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; + import javax.ws.rs.WebApplicationException; import javax.ws.rs.client.ClientRequestContext; import javax.ws.rs.client.ClientRequestFilter; @@ -38,6 +39,7 @@ import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.WriterInterceptor; import javax.ws.rs.ext.WriterInterceptorContext; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingServletFilter.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingServletFilter.java index fa8533a7..cae4ebd6 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingServletFilter.java +++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/PayloadLoggingServletFilter.java @@ -30,6 +30,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.zip.GZIPInputStream; + import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; |