All Packages Class Hierarchy This Package Previous Next Index
Interface Acme.Serve.servlet.http.HttpSession
- public interface HttpSession
An association of HTTP interactions.
This is taken from JavaSoft's Servlet API documentation.
Fetch the software.
Fetch the entire Acme package.
-
getCreationTime()
- Returns the time at which this session representation was created.
-
getId()
- Returns the identifier assigned to this session.
-
getLastAccessedTime()
- Returns the last time the client sent a request carrying the identifier
assigned to the session.
-
getSessionContext()
- Returns the context in which this session is bound.
-
getValue(String)
- Returns the object bound to the given name in the session's application
layer data.
-
invalidate()
- Causes this representation of the session to be invalidated and removed
from its context.
-
isNew()
- A session is considered to be "new" if it has been created by the
server, but the client has not yet acknowledged joining the session.
-
putValue(String, Object)
- Binds the specified object into the session's application layer data
with the given name.
-
removeValue(String)
- Removes the object bound to the given name in the session's application
layer data.
getId
public abstract String getId()
- Returns the identifier assigned to this session. An HttpSession's
identifier is a unique string that is created and maintained by
HttpSessionContext.
getSessionContext
public abstract HttpSessionContext getSessionContext()
- Returns the context in which this session is bound.
getCreationTime
public abstract long getCreationTime()
- Returns the time at which this session representation was created.
getLastAccessedTime
public abstract long getLastAccessedTime()
- Returns the last time the client sent a request carrying the identifier
assigned to the session. Application level operations, such as getting
or setting a value associated with the session, does not affect the
access time.
This information is particularly useful in session management policies.
For example, a session manager could leave all sessions which have not
been used in a long time in a given context. The sessions can be
sorted according to age to optimize some task.
invalidate
public abstract void invalidate()
- Causes this representation of the session to be invalidated and removed
from its context.
- Throws: IllegalStateException
- if an attempt is made to access session data after the session has been invalidated
putValue
public abstract void putValue(String name,
Object value)
- Binds the specified object into the session's application layer data
with the given name. Any existing binding with the same name is
replaced. New (or existing) values that implement the
HttpSessionBindingListener interface will call its valueBound()
method.
getValue
public abstract Object getValue(String name)
- Returns the object bound to the given name in the session's application
layer data. Returns null if there is no such binding.
removeValue
public abstract void removeValue(String name)
- Removes the object bound to the given name in the session's application
layer data. Does nothing if there is no object bound to the given name.
The value that implements the HttpSessionBindingListener interface will
call its valueUnbound() method.
isNew
public abstract boolean isNew()
- A session is considered to be "new" if it has been created by the
server, but the client has not yet acknowledged joining the session.
For example, if the server supported only cookie-based sessions and the
client had completely disabled the use of cookies, then calls to
HttpServletRequest.getSession() would always return "new" sessions.
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs