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

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience constructor using the constructor TenantActivationFilter(String) with 'master' as the 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 Type
    Method
    Description
    void
    doFilter(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 filterChain setCurrentTenant() is called.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets current tenant by calling Registry.setCurrentTenantByID(String) using the configured tenantId.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unsets current tenant by calling Registry.unsetCurrentTenant().

    Methods inherited from class org.springframework.web.filter.GenericFilterBean

    addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TenantActivationFilter

      public TenantActivationFilter()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convenience constructor using the constructor TenantActivationFilter(String) with 'master' as the tenantId.
    • TenantActivationFilter

      public 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. If not, an IllegalArgumentException is 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 filterChain setCurrentTenant() is called. After the filerChain has been processed, unsetCurrentTenant() gets called.
      Parameters:
      request - the request
      response - the response
      filterChain - the filterChain
      Throws:
      IOException
      javax.servlet.ServletException
    • setCurrentTenant

      protected void setCurrentTenant()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets current tenant by calling Registry.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 calling Registry.unsetCurrentTenant().
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object