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.
  • Constructor Details

    • GuestRoleFilter

      public GuestRoleFilter()
  • Method Details

    • canProcessAuthentication

      protected static boolean canProcessAuthentication(CustomerModel customerModel)
    • 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:
      doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
      Throws:
      javax.servlet.ServletException
      IOException
    • getGuest

      protected Optional<CustomerModel> getGuest()
    • getSessionCartUser

      protected Optional<CustomerModel> getSessionCartUser()
    • processAuthentication

      protected void processAuthentication(String uid)
    • createGuestAuthentication

      protected org.springframework.security.core.Authentication createGuestAuthentication(String uid)
    • isGuest

      protected boolean isGuest(CustomerModel cm)
    • getAuthenticationEventPublisher

      public org.springframework.security.authentication.AuthenticationEventPublisher getAuthenticationEventPublisher()
    • setAuthenticationEventPublisher

      public void setAuthenticationEventPublisher(org.springframework.security.authentication.AuthenticationEventPublisher authenticationEventPublisher)
    • getGuestRole

      public String getGuestRole()
    • setGuestRole

      public void setGuestRole(String guestRole)
    • getUserFacade

      public UserFacade getUserFacade()
    • setUserFacade

      public void setUserFacade(UserFacade userFacade)
    • getCartService

      public CartService getCartService()
    • setCartService

      public void setCartService(CartService cartService)