Class SiteLanguageInterceptor
- java.lang.Object
-
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
-
- com.hybris.merchandising.interceptors.SiteLanguageInterceptor
-
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor,org.springframework.web.servlet.HandlerInterceptor
public class SiteLanguageInterceptor extends org.springframework.web.servlet.handler.HandlerInterceptorAdapterDefault interceptor to run before controllers' execution to extract the site-id from the request URI and to set the current session value.
-
-
Constructor Summary
Constructors Constructor Description SiteLanguageInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CMSAdminSiteServicegetAdminSiteService()Gets the configuredCMSAdminSiteServiceused to set what site we're currently using.protected BaseSiteServicegetBaseSiteService()Gets the configuredBaseSiteServiceused to set what site we're currently using.booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)Adds the siteId to the session.voidsetAdminSiteService(CMSAdminSiteService adminSiteService)Sets the configuredCMSAdminSiteServiceused to set what site we're currently using.voidsetBaseSiteService(BaseSiteService baseSiteService)Sets the configuredBaseSiteServiceused to set what site we're currently using.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)Adds the siteId to the session. When siteId is not valid, the current session siteId is set to null.
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
Gets the configuredBaseSiteServiceused to set what site we're currently using.- Returns:
- baseSiteService the configured
BaseSiteService.
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
Sets the configuredBaseSiteServiceused to set what site we're currently using.- Parameters:
baseSiteService- theBaseSiteServiceto set.
-
getAdminSiteService
protected CMSAdminSiteService getAdminSiteService()
Gets the configuredCMSAdminSiteServiceused to set what site we're currently using.- Returns:
- adminSiteService the configured
CMSAdminSiteService.
-
setAdminSiteService
public void setAdminSiteService(CMSAdminSiteService adminSiteService)
Sets the configuredCMSAdminSiteServiceused to set what site we're currently using.- Parameters:
adminSiteService- the configuredCMSAdminSiteService.
-
-