Class SimpleCatalogVersionActivationFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- de.hybris.platform.servicelayer.web.SimpleCatalogVersionActivationFilter
-
- 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
public class SimpleCatalogVersionActivationFilter extends org.springframework.web.filter.GenericFilterBeanSimpleCatalogVersionActivationFilter assures that the configured catalog versions are set as session catalog versions.
Configuration parameters:
- activeCatalogVersions: String specifying the catalog version which should be set as session catalogversion, format is : catalogId:catalogVersion,catalogId2:catalogVersion2. (E.g.hwcatalog:Online,clothescatalog:Online in order to activate the online versions of HWCatalog and ClothesCatalog)
- onlySetOnce: Set to true if order to set the session catalogVersions only once for a http session.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSESSION_CATALOG_VERSIONS_CONFIGURED
-
Constructor Summary
Constructors Constructor Description SimpleCatalogVersionActivationFilter()default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivateCatalogVersions(javax.servlet.http.HttpSession httpSession)Sets the configured CatalogVersions as session catalogversions for the specified httpSession.voidafterPropertiesSet()Stores the configured catalogVersions locally.voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)Before the filterChain gets processed,activateCatalogVersions(HttpSession)gets called.voidsetActiveCatalogVersions(java.lang.String activeCatalogVersions)voidsetCatalogVersionService(CatalogVersionService catalogVersionService)voidsetOnlySetOnce(boolean onlySetOnce)java.lang.StringtoString()
-
-
-
Field Detail
-
SESSION_CATALOG_VERSIONS_CONFIGURED
public static final java.lang.String SESSION_CATALOG_VERSIONS_CONFIGURED
- See Also:
- Constant Field Values
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws javax.servlet.ServletExceptionStores the configured catalogVersions locally. At this point no activation yet.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.web.filter.GenericFilterBean- Throws:
javax.servlet.ServletException
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws java.io.IOException, javax.servlet.ServletExceptionBefore the filterChain gets processed,activateCatalogVersions(HttpSession)gets called.- Parameters:
request- the requestresponse- the responsefilterChain- the filterChain- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
activateCatalogVersions
protected void activateCatalogVersions(javax.servlet.http.HttpSession httpSession)
Sets the configured CatalogVersions as session catalogversions for the specified httpSession. Before trying to set the configured session catalogversions this methods checks if there is at least one catalogversion configured and if the onlySetOnce flag is set to true, if the catalogversions have not been set for this httpSession.- Parameters:
httpSession- the httpSession which is used to set the marker for the onlySetOnce flag to ensure the session catalogversions are only set once for the specified httpSession
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
setOnlySetOnce
public void setOnlySetOnce(boolean onlySetOnce)
-
setActiveCatalogVersions
public void setActiveCatalogVersions(java.lang.String activeCatalogVersions)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-