atg.multisite
Class SiteSessionManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.multisite.SiteSessionManager
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SiteSessionManager
extends GenericService

The SiteSessionManager is a session-scoped component that tracks the session associated with each SiteContext. Each SiteContext has an associated SiteSession that is used to store attributes for the given session.

Every time a request is made that corresponds to a SiteContext, the SiteSessionManager's handleSiteRequest() method is called. This method iterates over its configured SiteSessionStartProcessor componets in the event that the request started a new site session. Next the method iterates over its SiteRequestProcessor components.

A scheduler component is used to periodically check to see if any of the SiteSession have expired, based on the siteSesionTimeout property. For each site session that has expired the SiteSesionEndProcessor components are iterated over.


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
SiteSessionManager()
          Constructs an instanceof SiteSessionManager
 
Method Summary
 void doStartService()
          start service.
 void doStopService()
          stop service
 void endSiteSession(SiteSession pSiteSession)
          end an individual site session
 java.util.List<java.lang.String> getAllVisitedSiteIds()
          get AllVisitedSiteIds
 java.lang.Object getAttribute(java.lang.String pName)
          get a SiteSessionManager attribute
 java.util.Set<java.lang.String> getAttributeNames()
          get a list of names for all the attributes currently stored in this SiteSessionManager
 SiteContextManager getSiteContextManager()
          get SiteContextManager
 java.lang.String getSiteGroupSnapshotCacheId()
          get SiteGroupSnapshotCacheId
 SiteRequestProcessor[] getSiteRequestProcessors()
          get SiteRequestProcessors
 SiteSession getSiteSession(SiteContext pSiteContext)
          get a specific site session
 SiteSession getSiteSession(java.lang.String pSiteContextId)
          get a specific site session
 SiteSessionEndProcessor[] getSiteSessionEndProcessors()
          get SiteSessionEndProcessors
 java.util.Map<java.lang.String,SiteSession> getSiteSessions()
          get the session map.
 SiteSessionStartProcessor[] getSiteSessionStartProcessors()
          get SiteSessionStartProcessors
 java.lang.String getSiteSnapshotCacheId()
          get SiteSnapshotCacheId
 java.lang.String getStickySiteId()
          get StickySiteId
 java.lang.String getURLManagementSnapshotCacheId()
          get URLManagementSnapshotCacheId
 SiteContext handleSiteRequest(SiteContext pSite, DynamoHttpServletRequest pRequest)
          check to see if we already have an entry in the hashmap for the specified SiteContext.
 SiteContext handleSiteRequest(java.lang.String pSiteId, DynamoHttpServletRequest pRequest)
          check to see if we already have an entry in the hashmap for the specified SiteContext.
 void processSiteSessionsEnd()
          perform scheduled task.
 void setAllVisitedSiteIds(java.util.List<java.lang.String> pAllVisitedSiteIds)
          set AllVisitedSiteIds
 void setAttribute(java.lang.String pName, java.lang.Object pValue)
          set a SiteSessionManager attribute
 void setSiteContextManager(SiteContextManager pSiteContextManager)
          set SiteContextManager
 void setSiteGroupSnapshotCacheId(java.lang.String pSiteGroupSnapshotCacheId)
          set SiteGroupSnapshotCacheId
 void setSiteRequestProcessors(SiteRequestProcessor[] pSiteRequestProcessors)
          set SiteRequestProcessors
 void setSiteSessionEndProcessors(SiteSessionEndProcessor[] pSiteSessionEndProcessors)
          set SiteSessionEndProcessors
 void setSiteSessionStartProcessors(SiteSessionStartProcessor[] pSiteSessionStartProcessors)
          set SiteSessionStartProcessors
 void setSiteSnapshotCacheId(java.lang.String pSiteSnapshotCacheId)
          set SiteSnapshotCacheId
 void setStickySiteId(java.lang.String pStickySiteId)
          set StickySiteId
 void setURLManagementSnapshotCacheId(java.lang.String pURLManagementSnapshotCacheId)
          set URLManagementSnapshotCacheId
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

SiteSessionManager

public SiteSessionManager()
Constructs an instanceof SiteSessionManager

Method Detail

setSiteSessionStartProcessors

public void setSiteSessionStartProcessors(SiteSessionStartProcessor[] pSiteSessionStartProcessors)
set SiteSessionStartProcessors

Parameters:
pSiteSessionStartProcessors - the SiteSessionStartProcessors

getSiteSessionStartProcessors

public SiteSessionStartProcessor[] getSiteSessionStartProcessors()
get SiteSessionStartProcessors

Returns:
the SiteSessionStartProcessors

setSiteSessionEndProcessors

public void setSiteSessionEndProcessors(SiteSessionEndProcessor[] pSiteSessionEndProcessors)
set SiteSessionEndProcessors

Parameters:
pSiteSessionEndProcessors - the SiteSessionEndProcessors

getSiteSessionEndProcessors

public SiteSessionEndProcessor[] getSiteSessionEndProcessors()
get SiteSessionEndProcessors

Returns:
the SiteSessionEndProcessors

setSiteRequestProcessors

public void setSiteRequestProcessors(SiteRequestProcessor[] pSiteRequestProcessors)
set SiteRequestProcessors

Parameters:
pSiteRequestProcessors - the SiteRequestProcessors

getSiteRequestProcessors

public SiteRequestProcessor[] getSiteRequestProcessors()
get SiteRequestProcessors

Returns:
the SiteRequestProcessors

setSiteContextManager

public void setSiteContextManager(SiteContextManager pSiteContextManager)
set SiteContextManager

Parameters:
pSiteContextManager - the SiteContextManager

getSiteContextManager

public SiteContextManager getSiteContextManager()
get SiteContextManager

Returns:
the SiteContextManager

setSiteSnapshotCacheId

public void setSiteSnapshotCacheId(java.lang.String pSiteSnapshotCacheId)
set SiteSnapshotCacheId

Parameters:
pSiteSnapshotCacheId - the SiteSnapshotCacheId

getSiteSnapshotCacheId

public java.lang.String getSiteSnapshotCacheId()
get SiteSnapshotCacheId

Returns:
the SiteSnapshotCacheId

setSiteGroupSnapshotCacheId

public void setSiteGroupSnapshotCacheId(java.lang.String pSiteGroupSnapshotCacheId)
set SiteGroupSnapshotCacheId

Parameters:
pSiteGroupSnapshotCacheId - the SiteGroupSnapshotCacheId

getSiteGroupSnapshotCacheId

public java.lang.String getSiteGroupSnapshotCacheId()
get SiteGroupSnapshotCacheId

Returns:
the SiteGroupSnapshotCacheId

setURLManagementSnapshotCacheId

public void setURLManagementSnapshotCacheId(java.lang.String pURLManagementSnapshotCacheId)
set URLManagementSnapshotCacheId

Parameters:
pURLManagementSnapshotCacheId - the URLManagementSnapshotCacheId

getURLManagementSnapshotCacheId

public java.lang.String getURLManagementSnapshotCacheId()
get URLManagementSnapshotCacheId

Returns:
the URLManagementSnapshotCacheId

setStickySiteId

public void setStickySiteId(java.lang.String pStickySiteId)
set StickySiteId

Parameters:
pStickySiteId - the StickySiteId

getStickySiteId

public java.lang.String getStickySiteId()
get StickySiteId

Returns:
the StickySiteId

setAllVisitedSiteIds

public void setAllVisitedSiteIds(java.util.List<java.lang.String> pAllVisitedSiteIds)
set AllVisitedSiteIds

Parameters:
pAllVisitedSiteIds - the AllVisitedSiteIds

getAllVisitedSiteIds

public java.util.List<java.lang.String> getAllVisitedSiteIds()
get AllVisitedSiteIds

Returns:
the AllVisitedSiteIds

doStartService

public void doStartService()
                    throws ServiceException
start service. register this component as a scheduled job.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

doStopService

public void doStopService()
                   throws ServiceException
stop service

Overrides:
doStopService in class GenericService
Throws:
ServiceException - if the Service had a problem shutting down

handleSiteRequest

public SiteContext handleSiteRequest(SiteContext pSite,
                                     DynamoHttpServletRequest pRequest)
check to see if we already have an entry in the hashmap for the specified SiteContext. if we don't, then add it, and execute any siteSessionStartProcessor components.
For all request iterate over the SiteRequestProcessor components.

Parameters:
pSiteId - the id of the site for this request
pRequest - the request object

handleSiteRequest

public SiteContext handleSiteRequest(java.lang.String pSiteId,
                                     DynamoHttpServletRequest pRequest)
check to see if we already have an entry in the hashmap for the specified SiteContext. if we don't, then add it, and execute any siteSessionStartProcessor components.
For all request iterate over the SiteRequestProcessor components.

Parameters:
pSiteId - the id of the site for this request
pRequest - the request object

processSiteSessionsEnd

public void processSiteSessionsEnd()
perform scheduled task. Check for any expired SiteSessions. Itertate through the SiteSessionEndProcessor components for each expired SiteSession. Removed the expired SiteSession.


endSiteSession

public void endSiteSession(SiteSession pSiteSession)
end an individual site session

Parameters:
pSiteSession - the SiteSession to end

getSiteSessions

public java.util.Map<java.lang.String,SiteSession> getSiteSessions()
get the session map. allow access to the SiteSessions

Returns:
a map containing SiteContext Ids for keys, and their corresponding SiteSession objects as values.

getSiteSession

public SiteSession getSiteSession(SiteContext pSiteContext)
get a specific site session

Parameters:
pSiteContext - the site context for the session to get
Returns:
the SiteSession corresponding to the passed in SiteContext

getSiteSession

public SiteSession getSiteSession(java.lang.String pSiteContextId)
get a specific site session

Parameters:
pSiteContextId - the Id for the site context
Returns:
the SiteSession corresponding to the passed in SiteContext id

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
get a list of names for all the attributes currently stored in this SiteSessionManager

Returns:
a Set containing all the attribute names for this SiteContext

getAttribute

public java.lang.Object getAttribute(java.lang.String pName)
get a SiteSessionManager attribute

Parameters:
pName - the attribute name
Returns:
the attribute value

setAttribute

public void setAttribute(java.lang.String pName,
                         java.lang.Object pValue)
set a SiteSessionManager attribute

Parameters:
pName - the attribute name
pValue - the attribute value