Class TenantActivationFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
de.hybris.platform.servicelayer.web.TenantActivationFilter
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
@Deprecated(since="ages",
forRemoval=true)
public class TenantActivationFilter
extends org.springframework.web.filter.GenericFilterBean
Deprecated, for removal: This API element is subject to removal in a future version.
since ages - please use the filter chain.
Filter which takes care of setting and unsetting the current tenant during request processing. If no tenantId is
specified (by using the constructor
TenantActivationFilter(String) the master tenant
is used.-
Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Convenience constructor using the constructorTenantActivationFilter(String)with 'master' as the tenantId.TenantActivationFilter(String tenantId) Deprecated, for removal: This API element is subject to removal in a future version.This constructor checks if a tenant with specified tenantId does exist. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) Deprecated, for removal: This API element is subject to removal in a future version.Before the control is passed on to the filterChainsetCurrentTenant()is called.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Sets current tenant by callingRegistry.setCurrentTenantByID(String)using the configured tenantId.toString()Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.Unsets current tenant by callingRegistry.unsetCurrentTenant().Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
TenantActivationFilter
public TenantActivationFilter()Deprecated, for removal: This API element is subject to removal in a future version.Convenience constructor using the constructorTenantActivationFilter(String)with 'master' as the tenantId. -
TenantActivationFilter
Deprecated, for removal: This API element is subject to removal in a future version.This constructor checks if a tenant with specified tenantId does exist. If not, anIllegalArgumentExceptionis thrown.- Parameters:
tenantId- the id of the tenant which will be activated before the rest of the chain gets executed and deactivated at the end.- Throws:
IllegalArgumentException- is specified tenant does not exist.
-
-
Method Details
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException Deprecated, for removal: This API element is subject to removal in a future version.Before the control is passed on to the filterChainsetCurrentTenant()is called. After the filerChain has been processed,unsetCurrentTenant()gets called.- Parameters:
request- the requestresponse- the responsefilterChain- the filterChain- Throws:
IOExceptionjavax.servlet.ServletException
-
setCurrentTenant
protected void setCurrentTenant()Deprecated, for removal: This API element is subject to removal in a future version.Sets current tenant by callingRegistry.setCurrentTenantByID(String)using the configured tenantId. -
unsetCurrentTenant
public void unsetCurrentTenant()Deprecated, for removal: This API element is subject to removal in a future version.Unsets current tenant by callingRegistry.unsetCurrentTenant(). -
toString
Deprecated, for removal: This API element is subject to removal in a future version.
-