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.GenericFilterBean
SimpleCatalogVersionActivationFilter 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.String
SESSION_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 void
activateCatalogVersions(javax.servlet.http.HttpSession httpSession)
Sets the configured CatalogVersions as session catalogversions for the specified httpSession.void
afterPropertiesSet()
Stores the configured catalogVersions locally.void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)
Before the filterChain gets processed,activateCatalogVersions(HttpSession)
gets called.void
setActiveCatalogVersions(java.lang.String activeCatalogVersions)
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setOnlySetOnce(boolean onlySetOnce)
java.lang.String
toString()
-
-
-
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.ServletException
Stores the configured catalogVersions locally. At this point no activation yet.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in 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.ServletException
Before the filterChain gets processed,activateCatalogVersions(HttpSession)
gets called.- Parameters:
request
- the requestresponse
- the responsefilterChain
- the filterChain- Throws:
java.io.IOException
javax.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:
toString
in classjava.lang.Object
-
-