|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectokapi.util.OkapiSession
public class OkapiSession
The OkapiSession class provides a mechanism for tracking users within an
OkapiSite and maintaining state within the application. It allows servlets to
view and manipulate session-specific information, such as creation time and
the unique session identifier. It also includes methods to bind objects to
the session for later retrieval allowing the application to hold onto data
between connections. OkapiSession
utilizes a DB table to hold
the session info, so that session-tracking can occur within a multi-server
installation of an OkapiSite. However, a method is provided to cache the
OkapiSession as an HttpSession
, so that as long as a user is
hitting the same server, DB calls are not required. Thus many methods have
parallels in the javax.servlet.http.HttpSession interface.
Constructor Summary | |
---|---|
OkapiSession()
Constructs OkapiSession with a new sessionID. |
|
OkapiSession(java.lang.String sessionID)
Constructs OkapiSession with this sessionID. |
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound in the session under the specified name or null if there is no matching binding. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration of String objects containing the names of all the objects bound to this session, or null if there are no bindings. |
java.util.Hashtable |
getAttributes()
Returns all the name/value pairs in the session as a hashtable. |
java.util.Date |
getCreationTime()
Returns the time at which the session was created. |
java.lang.String |
getID()
Returns the unique String identifier assigned to this session. |
java.util.Date |
getLastAccessTime()
Returns the time at which the client last sent a request associated with this session, as an Date object. |
java.lang.String |
getUserID()
Returns the unique userID for the owner of this session. |
void |
invalidate()
Causes the session to be immediately invalidated. |
boolean |
isNew()
Returns whether the session is new. |
void |
removeAttribute(java.lang.String name)
Removes the object bound to the specified name or does nothing if there is no binding. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds the specified object value under the specified name in the session. |
void |
updateHttpSession(javax.servlet.http.HttpSession servletSession)
Updates the HttpSession with the values from the OkapiSession. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OkapiSession(java.lang.String sessionID)
public OkapiSession()
Method Detail |
---|
public java.util.Date getCreationTime()
public java.lang.String getID()
public java.lang.String getUserID()
public java.util.Date getLastAccessTime()
public java.lang.Object getAttribute(java.lang.String name)
public java.util.Enumeration getAttributeNames()
public void invalidate()
public boolean isNew()
public void setAttribute(java.lang.String name, java.lang.Object value)
public void removeAttribute(java.lang.String name)
public java.util.Hashtable getAttributes()
public void updateHttpSession(javax.servlet.http.HttpSession servletSession)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |