org.broadleafcommerce.profile.web.core.security
Class CustomerStateFilter

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.broadleafcommerce.profile.web.core.security.CustomerStateFilter
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.ApplicationEventPublisherAware, org.springframework.context.EnvironmentAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware

@Component(value="blCustomerStateFilter")
public class CustomerStateFilter
extends org.springframework.web.filter.GenericFilterBean
implements org.springframework.context.ApplicationEventPublisherAware, org.springframework.core.Ordered


Field Summary
static String ANONYMOUS_CUSTOMER_SESSION_ATTRIBUTE_NAME
           
static String BLC_RULE_MAP_PARAM
           
protected  CustomerService customerService
           
protected  org.apache.commons.logging.Log logger
          Logger for this class and subclasses
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
CustomerStateFilter()
           
 
Method Summary
 void doFilter(javax.servlet.ServletRequest baseRequest, javax.servlet.ServletResponse baseResponse, javax.servlet.FilterChain chain)
           
 String getAnonymousCustomerAttributeName()
          Returns the session attribute to store the anonymous customer.
static String getCustomerRequestAttributeName()
           
 int getOrder()
           
 Customer resolveAnonymousCustomer(javax.servlet.http.HttpServletRequest request)
          Implementors can subclass to change how anonymous customers are created.
 void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
           
static void setCustomerRequestAttributeName(String customerRequestAttributeName)
           
 
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger for this class and subclasses


BLC_RULE_MAP_PARAM

public static final String BLC_RULE_MAP_PARAM
See Also:
Constant Field Values

customerService

protected CustomerService customerService

ANONYMOUS_CUSTOMER_SESSION_ATTRIBUTE_NAME

public static final String ANONYMOUS_CUSTOMER_SESSION_ATTRIBUTE_NAME
See Also:
Constant Field Values
Constructor Detail

CustomerStateFilter

public CustomerStateFilter()
Method Detail

doFilter

public void doFilter(javax.servlet.ServletRequest baseRequest,
                     javax.servlet.ServletResponse baseResponse,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException

resolveAnonymousCustomer

public Customer resolveAnonymousCustomer(javax.servlet.http.HttpServletRequest request)
Implementors can subclass to change how anonymous customers are created.

Parameters:
request -
Returns:

getAnonymousCustomerAttributeName

public String getAnonymousCustomerAttributeName()
Returns the session attribute to store the anonymous customer. Some implementations may wish to have a different anonymous customer instance (and as a result a different cart).

Returns:

getOrder

public int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered

setApplicationEventPublisher

public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
Specified by:
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware

getCustomerRequestAttributeName

public static String getCustomerRequestAttributeName()

setCustomerRequestAttributeName

public static void setCustomerRequestAttributeName(String customerRequestAttributeName)


Copyright © 2013. All Rights Reserved.