2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.config.impl;
19 import java.io.IOException;
20 import javax.servlet.Filter;
21 import javax.servlet.FilterChain;
22 import javax.servlet.FilterConfig;
23 import javax.servlet.ServletException;
24 import javax.servlet.ServletRequest;
25 import javax.servlet.ServletResponse;
26 import javax.servlet.annotation.WebFilter;
27 import org.onap.config.Constants;
28 import org.onap.config.api.Configuration;
32 public class ConfigurationFilter implements Filter {
35 public void init(FilterConfig paramFilterConfig) {
36 //Use the default behavior
40 public void doFilter(ServletRequest paramServletRequest, ServletResponse paramServletResponse,
41 FilterChain paramFilterChain) throws IOException, ServletException {
42 Configuration.TENANT.set(Constants.DEFAULT_TENANT);
44 paramFilterChain.doFilter(paramServletRequest, paramServletResponse);
46 Configuration.TENANT.remove();
51 public void destroy() {
52 //Use the default behavior