Class GuestRoleFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
de.hybris.platform.ycommercewebservices.auth.GuestRoleFilter
- 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 GuestRoleFilter
extends org.springframework.web.filter.OncePerRequestFilter
This filter should be used after spring security filters and it is responsible for setting current authentication as
guest when user decided to do the checkout as a guest. During the guest checkout the userService gets current user as
'anonymous', but cartService returns dedicated user.
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleancanProcessAuthentication(CustomerModel customerModel) protected org.springframework.security.core.Authenticationprotected voiddoFilterInternal(javax.servlet.http.HttpServletRequest httpservletrequest, javax.servlet.http.HttpServletResponse httpservletresponse, javax.servlet.FilterChain filterchain) org.springframework.security.authentication.AuthenticationEventPublisherprotected Optional<CustomerModel>getGuest()protected Optional<CustomerModel>protected booleanisGuest(CustomerModel cm) protected voidvoidsetAuthenticationEventPublisher(org.springframework.security.authentication.AuthenticationEventPublisher authenticationEventPublisher) voidsetCartService(CartService cartService) voidsetGuestRole(String guestRole) voidsetUserFacade(UserFacade userFacade) Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
GuestRoleFilter
public GuestRoleFilter()
-
-
Method Details
-
canProcessAuthentication
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest httpservletrequest, javax.servlet.http.HttpServletResponse httpservletresponse, javax.servlet.FilterChain filterchain) throws javax.servlet.ServletException, IOException - Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
javax.servlet.ServletExceptionIOException
-
getGuest
-
getSessionCartUser
-
processAuthentication
-
createGuestAuthentication
-
isGuest
-
getAuthenticationEventPublisher
public org.springframework.security.authentication.AuthenticationEventPublisher getAuthenticationEventPublisher() -
setAuthenticationEventPublisher
public void setAuthenticationEventPublisher(org.springframework.security.authentication.AuthenticationEventPublisher authenticationEventPublisher) -
getGuestRole
-
setGuestRole
-
getUserFacade
-
setUserFacade
-
getCartService
-
setCartService
-