atg.multisite
Class SiteSession

java.lang.Object
  extended by atg.multisite.SiteSession

public class SiteSession
extends java.lang.Object

This class maintains state about the current site session


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
SiteSession(Site pSite, SiteSessionManager pSiteSessionManager)
          Constructs an instanceof SiteSession
 
Method Summary
 void end()
          end a site session manually.
 java.lang.Object getAttribute(java.lang.String pName)
          get an attribute on the session
 java.util.Set<java.lang.String> getAttributeNames()
          get a list of names for all the attributes currently stored in this SiteSession
 java.lang.String getHttpSessionId()
          get HttpSessionId
 long getLastAccessTime()
          get LastAccessTime, this records the last time a request was made for this site session.
 Site getReferringSite()
          get ReferringSite - the site visited before this site session started
 Site getSite()
          get Site - the site associated with this SiteSession
 SiteSessionManager getSiteSessionManager()
          get the SiteSessionManager component that is associated with this SiteSession
 long getStartTime()
          get StartTime, this records when the site session started
 void setAttribute(java.lang.String pName, java.lang.Object pValue)
          set an attribute on the session
 void setHttpSessionId(java.lang.String pHttpSessionId)
          set HttpSessionId
 void setLastAccessTime(long pLastAccessTime)
          set LastAccessTime, this records the last time a request was made for this site session.
 void setReferringSite(Site pReferringSite)
          set ReferringSite - the site visited before this site session started
 void setStartTime(long pStartTime)
          set StartTime, this records when the site session started
 java.lang.String toString()
          override toString, print the referring site
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SiteSession

public SiteSession(Site pSite,
                   SiteSessionManager pSiteSessionManager)
Constructs an instanceof SiteSession

Parameters:
pSite - the site associated with this SiteSession
pSiteSessionManager - the SiteSessionManager associated with this SiteSession
Method Detail

getSite

public Site getSite()
get Site - the site associated with this SiteSession

Returns:
the Site associated with this SiteSession

setStartTime

public void setStartTime(long pStartTime)
set StartTime, this records when the site session started

Parameters:
pStartTime - the StartTime

getStartTime

public long getStartTime()
get StartTime, this records when the site session started

Returns:
the StartTime

setLastAccessTime

public void setLastAccessTime(long pLastAccessTime)
set LastAccessTime, this records the last time a request was made for this site session. used to determine if the site session has timed out.

Parameters:
pLastAccessTime - the LastAccessTime

getLastAccessTime

public long getLastAccessTime()
get LastAccessTime, this records the last time a request was made for this site session. used to determine if the site session has timed out.

Returns:
the LastAccessTime

setReferringSite

public void setReferringSite(Site pReferringSite)
set ReferringSite - the site visited before this site session started

Parameters:
pReferringSite - the ReferringSite

getReferringSite

public Site getReferringSite()
get ReferringSite - the site visited before this site session started

Returns:
the ReferringSite

getSiteSessionManager

public SiteSessionManager getSiteSessionManager()
get the SiteSessionManager component that is associated with this SiteSession

Returns:
the SiteSessionManager

setHttpSessionId

public void setHttpSessionId(java.lang.String pHttpSessionId)
set HttpSessionId

Parameters:
pHttpSessionId - the HttpSessionId

getHttpSessionId

public java.lang.String getHttpSessionId()
get HttpSessionId

Returns:
the HttpSessionId

getAttributeNames

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

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

setAttribute

public void setAttribute(java.lang.String pName,
                         java.lang.Object pValue)
set an attribute on the session

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

getAttribute

public java.lang.Object getAttribute(java.lang.String pName)
get an attribute on the session

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

end

public void end()
end a site session manually. normally the SiteSessionManager will end all SiteSessions when the corresponding http session expires. This method allows one to expire a SiteSession explicitly


toString

public java.lang.String toString()
override toString, print the referring site

Overrides:
toString in class java.lang.Object