| java.lang.Object com.quadcap.http.server22.HSession
HSession | public class HSession implements HttpSession(Code) | | This class implements the javax.servlet.http.HttpSession interface.
author: Stan Bailes |
Method Summary | |
public Object | getAttribute(String name) Returns the object bound to the given name in the session's
application layer data. | public Enumeration | getAttributeNames() Return an enumeration of the names of objects in the session's
application layer data. | public long | getCreationTime() Returns the time at which this session representation was created,
in milliseconds since midnight, January 1, 1970 UTC. | public String | getId() Returns the identifier assigned to this session. | public long | getLastAccessedTime() Returns the last time the client sent a request carrying the identifier
assigned to the session. | public int | getMaxInactiveInterval() | public HttpSessionContext | getSessionContext() Returns the context in which this session is bound. | public Object | getValue(String name) | public String[] | getValueNames() Returns an array of the names of all the application layer
data objects bound into the session. | public void | invalidate() Causes this representation of the session to be invalidated and removed
from its context. | public 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. | boolean | isValid() | public void | putValue(String name, Object value) | public void | removeAttribute(String name) Removes the object bound to the given name in the session's
application layer data. | public void | removeValue(String name) | public void | setAttribute(String name, Object value) Binds the specified object into the session's application layer data
with the given name. | public void | setMaxInactiveInterval(int ivl) | void | setNotNew() | void | updateLastAccess() |
creationTime | long creationTime(Code) | | |
lastAccessTime | long lastAccessTime(Code) | | |
maxInactiveInterval | int maxInactiveInterval(Code) | | |
newSession | boolean newSession(Code) | | |
HSession | public HSession(WebApplication app, String sessionId, int maxInactiveInterval)(Code) | | Construct a new session object.
Parameters: app - the server context (session context) owning this session. Parameters: sessionId - this session's id. |
getAttribute | public Object getAttribute(String name)(Code) | | Returns the object bound to the given name in the session's
application layer data. Returns null if there is no such binding.
Parameters: name - the name of the binding to find the value bound to that name, or null if the binding doesnot exist. exception: IllegalStateException - if an attempt is made to access HttpSession's session data after it has been invalidated |
getAttributeNames | public Enumeration getAttributeNames()(Code) | | Return an enumeration of the names of objects in the session's
application layer data.
an enumeration of names |
getCreationTime | public long getCreationTime()(Code) | | Returns the time at which this session representation was created,
in milliseconds since midnight, January 1, 1970 UTC.
the time when the session was created exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
getId | public String getId()(Code) | | Returns the identifier assigned to this session. An HttpSession's
identifier is a unique string that is created and maintained by
HttpSessionContext.
the identifier assigned to this session exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
getLastAccessedTime | public long getLastAccessedTime()(Code) | | Returns the last time the client sent a request carrying the identifier
assigned to the session. Time is expressed
as milliseconds since midnight, January 1,
1970 UTC.
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.
the last time the client sent a request carrying the identifier assigned to the session exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
getMaxInactiveInterval | public int getMaxInactiveInterval()(Code) | | |
getSessionContext | public HttpSessionContext getSessionContext()(Code) | | Returns the context in which this session is bound.
the name of the context in which this session is bound exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
getValueNames | public String[] getValueNames()(Code) | | Returns an array of the names of all the application layer
data objects bound into the session. For example, if you want to delete
all of the data objects bound into the session, use this method to
obtain their names.
an array containing the names of all of the application layer data objects bound into the session exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
invalidate | public void invalidate()(Code) | | Causes this representation of the session to be invalidated and removed
from its context.
exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
isNew | public boolean isNew()(Code) | | 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.
true if the session has been created by the server but the client has not yet acknowledged joining the session; false otherwise exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
isValid | boolean isValid()(Code) | | ---- Package-private implementation -----
|
removeAttribute | public void removeAttribute(String name)(Code) | | 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.
Parameters: name - the name of the object to remove exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated |
setAttribute | public void setAttribute(String name, Object value)(Code) | | 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.
Parameters: name - the name to which the data object will be bound. Thisparameter cannot be null. Parameters: value - the data object to be bound.This parameter cannot be null. exception: IllegalStateException - if an attempt is made to access session data after the session has been invalidated. |
setMaxInactiveInterval | public void setMaxInactiveInterval(int ivl)(Code) | | |
setNotNew | void setNotNew()(Code) | | |
updateLastAccess | void updateLastAccess()(Code) | | |
|
|