2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.openecomp.sparky.config.oxm;
28 import java.io.IOException;
29 import java.net.UnknownHostException;
31 import javax.servlet.Filter;
32 import javax.servlet.FilterChain;
33 import javax.servlet.FilterConfig;
34 import javax.servlet.ServletException;
35 import javax.servlet.ServletRequest;
36 import javax.servlet.ServletResponse;
38 import org.openecomp.sparky.util.NodeUtils;
40 import org.openecomp.cl.mdc.MdcContext;
43 * The Class OxmModelLoaderFilter.
45 public class OxmModelLoaderFilter implements Filter {
47 * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
50 public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
51 throws IOException, ServletException {
54 * However, we will setup the filtermap with a url that should never get it, so we shouldn't
58 chain.doFilter(request, response);
62 * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
65 public void init(FilterConfig filterConfig) throws ServletException {
66 String txnID = NodeUtils.getRandomTxnId();
67 MdcContext.initialize(txnID, "OxmModelLoaderFilter", "",
71 OxmModelLoader.getInstance();
72 } catch (Exception exc) {
73 throw new ServletException("Caught an exception while initializing OXM model loader filter",
80 * @see javax.servlet.Filter#destroy()
83 public void destroy() {
84 // TODO Auto-generated method stub