com.elasticpath.sfweb.filters
Class CustomerSessionFilter

java.lang.Object
  extended by com.elasticpath.sfweb.filters.CustomerSessionFilter
All Implemented Interfaces:
javax.servlet.Filter

public class CustomerSessionFilter
extends java.lang.Object
implements javax.servlet.Filter

This filter manages customer session.
If a new customer send a request without customer session id, a new customer session will be created and stored.
If a return customer send a request with a valid customer session id, the customer information will be loaded for controllers' usage. The customer-information-load operation will only be done once for a session.
The customer session id is written back to customer browser as a cookie.


Constructor Summary
CustomerSessionFilter()
           
 
Method Summary
 void destroy()
          Destroy the filter.
 void doFilter(javax.servlet.ServletRequest inRequest, javax.servlet.ServletResponse inResponse, javax.servlet.FilterChain inFilterChain)
          Filter the request.
 void init(javax.servlet.FilterConfig arg0)
          Initialize the filter.
 void setWebCustomerSessionService(WebCustomerSessionService webCustomerSessionService)
          Set the web customer session service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerSessionFilter

public CustomerSessionFilter()
Method Detail

destroy

public void destroy()
Destroy the filter.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest inRequest,
                     javax.servlet.ServletResponse inResponse,
                     javax.servlet.FilterChain inFilterChain)
              throws java.io.IOException,
                     javax.servlet.ServletException,
                     EpLicensingInvalidException
Filter the request.

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
inRequest - the request
inResponse - the response
inFilterChain - the filter chain
Throws:
java.io.IOException - in case of error
javax.servlet.ServletException - in case of error
EpLicensingInvalidException - in case of error

init

public void init(javax.servlet.FilterConfig arg0)
          throws javax.servlet.ServletException
Initialize the filter.

Specified by:
init in interface javax.servlet.Filter
Parameters:
arg0 - not used
Throws:
javax.servlet.ServletException - in case of error.

setWebCustomerSessionService

public void setWebCustomerSessionService(WebCustomerSessionService webCustomerSessionService)
Set the web customer session service.

Parameters:
webCustomerSessionService - the web customer session service to set.