diff options
author | 2020-12-01 11:48:20 -0800 | |
---|---|---|
committer | 2020-12-01 11:48:20 -0800 | |
commit | 32fb53c13342d5ad353c839b7ffd0ca85d14bd48 (patch) | |
tree | f1b92068cf7b79d29e96243899e12495abb4795a /filters/provider/src/main/java | |
parent | 53eacd8519a535f96d8b4231e48925324f1086dd (diff) |
Migrate sli-core files
Migrate sli-core repo files into new
directory "core".
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Diffstat (limited to 'filters/provider/src/main/java')
2 files changed, 0 insertions, 47 deletions
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java deleted file mode 100644 index 7805e365d..000000000 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.onap.ccsdk.sli.core.filters; - -import javax.servlet.http.HttpServletRequest; -import org.onap.logging.filter.base.AuditLogServletFilter; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.slf4j.MDC; - -public class ControllerAuditLogFilter extends AuditLogServletFilter { - private static final String MDC_HTTP_METHOD_KEY = "HttpMethod"; - - @Override - protected void additionalPreHandling(HttpServletRequest httpServletRequest) { - // Don't overwrite service instance id if it was set outside of this automated method - if (MDC.get(ONAPLogConstants.MDCs.SERVICE_INSTANCE_ID) == null) { - String serviceInstanceId = getServiceInstanceId(httpServletRequest.getPathInfo()); - if (serviceInstanceId != null) { - MDC.put(ONAPLogConstants.MDCs.SERVICE_INSTANCE_ID, serviceInstanceId); - } - } - MDC.put(MDC_HTTP_METHOD_KEY, httpServletRequest.getMethod()); - } - - // restconf URLs follow a pattern, this method attempts to extract the service instance id according to that pattern - protected String getServiceInstanceId(String path) { - int idx = path.indexOf("service-list"); - if (idx != -1) { - // chomp off service-list/ - String str = path.substring(idx + 13); - idx = str.indexOf("/"); - //if there is another forward slash with more information chomp it off - if (idx != -1) { - return str.substring(0, idx); - } else { - return str; - } - } - return null; - } - -} diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java deleted file mode 100644 index 3f9f93fc5..000000000 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.onap.ccsdk.sli.core.filters; - -import org.onap.logging.filter.base.PayloadLoggingServletFilter; - -public class ControllerPayloadLoggingFilter extends PayloadLoggingServletFilter { - -} |