atg.servlet.pipeline
Class SessionPipelineServlet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.servlet.pipeline.PipelineableServletImpl
                  extended by atg.servlet.pipeline.SessionPipelineServlet
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class SessionPipelineServlet
extends PipelineableServletImpl

This adds an attribute factory for the HttpSessionRequest object that contains session information about this request's session. The attribute is javax.servlet.http.HttpSessionRequest.

The first time this attribute is accessed, it will examine the request's URL arguments and cookies for a session id, and will then find or create the session. It will also send back a cookie in the case where a cookie is needed. Note that all of this happens only the first time the attribute is accessed, not necessarily at the time the request runs through this servlet. This servlet does nothing more than register an attribute factory. There is, however, a property called "accessSessionImmediately" that, if true, will cause the session to be accessed at the same time that the request passes through this servlet. If that flag is false, then the session access is delayed until the first access. By default, this flag is set to true.

The session request attribute should be accessed after the request has run through a URLArgumentPipelineServlet and a CookiePipelineServlet, and before any output is rendered (because it might need to send a cookie).

Note that if the attribute is never accessed, then the session will never be accessed or created, nor will a cookie be sent out. Remember that by default, this servlet will access the session as soon as the request runs through this servlet. You must turn accessSessionImmediately to false to delay access of the session.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SessionPipelineServlet()
          Constructs a new SessionPipelineServlet
 
Method Summary
 boolean getAccessSessionImmediately()
          Returns the flag indicating if the session should be accessed immediately when the request runs through this pipeline element.
 java.lang.String getErrorURL()
          Returns the errorURL property
 atg.servlet.sessiontracking.SessionManagerService getSessionManager()
          Returns the SessionManager
 HttpSessionRequest getSessionRequest(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Returns the SessionRequest
 boolean isAdminPipeline()
          Returns flag determining whether this component is part of the admin pipeline or not.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Services a DynamoHttpServletRequest/Response pair
 void setAccessSessionImmediately(boolean pAccessSessionImmediately)
          Sets the flag indicating if the session should be accessed immediately when the request runs through this pipeline element.
 void setAdminPipeline(boolean pIsAdminPipeline)
          Set flag to denote whether this component is part of the admin pipeline or not.
 void setErrorURL(java.lang.String pErrorURL)
          A URL to redirect the request to if the session limit has been exceeded
 void setSessionManager(atg.servlet.sessiontracking.SessionManagerService pSessionManager)
          Sets the SessionManager
 
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStartService, doStopService, getAbsoluteName, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SessionPipelineServlet

public SessionPipelineServlet()
Constructs a new SessionPipelineServlet

Method Detail

getSessionRequest

public HttpSessionRequest getSessionRequest(DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
Returns the SessionRequest


getSessionManager

public atg.servlet.sessiontracking.SessionManagerService getSessionManager()
Returns the SessionManager


setSessionManager

public void setSessionManager(atg.servlet.sessiontracking.SessionManagerService pSessionManager)
Sets the SessionManager


getAccessSessionImmediately

public boolean getAccessSessionImmediately()
Returns the flag indicating if the session should be accessed immediately when the request runs through this pipeline element. If false, then the session is accessed the first time the attribute is accessed.


setAccessSessionImmediately

public void setAccessSessionImmediately(boolean pAccessSessionImmediately)
Sets the flag indicating if the session should be accessed immediately when the request runs through this pipeline element. If false, then the session is accessed the first time the attribute is accessed.


setErrorURL

public void setErrorURL(java.lang.String pErrorURL)
A URL to redirect the request to if the session limit has been exceeded


getErrorURL

public java.lang.String getErrorURL()
Returns the errorURL property


setAdminPipeline

public void setAdminPipeline(boolean pIsAdminPipeline)
Set flag to denote whether this component is part of the admin pipeline or not. Default is false.

Parameters:
pIsAdminPipeline - true if part of admin pipeline.

isAdminPipeline

public boolean isAdminPipeline()
Returns flag determining whether this component is part of the admin pipeline or not.

Returns:
true if part of the admin pipeline

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Services a DynamoHttpServletRequest/Response pair

Overrides:
service in class PipelineableServletImpl
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request