// Path: spring-best-practice-hibernate-search-multi-tenancy/src/main/java/practice/mvc/CurrentTenantIdentifierChangeInterceptor.java
// public class CurrentTenantIdentifierChangeInterceptor extends HandlerInterceptorAdapter {
// 
// 	@Override
// 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 		Map<String, Object> pathVariables = (Map<String, Object>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
// 		if (pathVariables.containsKey("tenant")) {
// 			request.setAttribute(CurrentTenantIdentifierResolverImpl.IDENTIFIER_ATTRIBUTE, pathVariables.get("tenant"));
// 		}
// 		return true;
// 	}
// }


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import practice.mvc.CurrentTenantIdentifierChangeInterceptor;
package practice.configure;


@Configuration
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
// Path: spring-best-practice-hibernate-search-multi-tenancy/src/main/java/practice/mvc/CurrentTenantIdentifierChangeInterceptor.java
// public class CurrentTenantIdentifierChangeInterceptor extends HandlerInterceptorAdapter {
// 
// 	@Override
// 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 		Map<String, Object> pathVariables = (Map<String, Object>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
// 		if (pathVariables.containsKey("tenant")) {
// 			request.setAttribute(CurrentTenantIdentifierResolverImpl.IDENTIFIER_ATTRIBUTE, pathVariables.get("tenant"));
// 		}
// 		return true;
// 	}
// }


// Path: spring-best-practice-hibernate-search-multi-tenancy/src/main/java/practice/configure/WebMvcConfiguration.java
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import practice.mvc.CurrentTenantIdentifierChangeInterceptor;

package practice.configure;


@Configuration
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new CurrentTenantIdentifierChangeInterceptor());