update sliapi-springboot
[ccsdk/sli/core.git] / sliapi / springboot / src / main / java / org / onap / ccsdk / sli / core / sliapi / springboot / core / ServletFilters.java
diff --git a/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/ServletFilters.java b/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/ServletFilters.java
new file mode 100644 (file)
index 0000000..c56cf3b
--- /dev/null
@@ -0,0 +1,42 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - CCSDK\r
+ * ================================================================================\r
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.onap.ccsdk.sli.core.sliapi.springboot.core;\r
+\r
+import javax.servlet.ServletException;\r
+\r
+import org.onap.logging.filter.base.PayloadLoggingServletFilter;\r
+import org.springframework.boot.web.servlet.FilterRegistrationBean;\r
+import org.springframework.context.annotation.Bean;\r
+import org.springframework.context.annotation.Configuration;\r
+\r
+@Configuration\r
+public class ServletFilters {\r
+\r
+       @Bean\r
+       public FilterRegistrationBean<PayloadLoggingServletFilter> payloadFilterRegistration() throws ServletException {\r
+               FilterRegistrationBean<PayloadLoggingServletFilter> registration = new FilterRegistrationBean<PayloadLoggingServletFilter>();\r
+               registration.setFilter(new PayloadLoggingServletFilter());\r
+               registration.addUrlPatterns("/*");\r
+               registration.setName("payloadFilter");\r
+               registration.setOrder(0);\r
+               return registration;\r
+       }\r
+}
\ No newline at end of file