| java.lang.Object com.meterware.servletunit.ServletUnitHttpSession
Method Summary | |
void | access() This method should be invoked when a servlet joins an existing session. | public Object | getAttribute(String name) Returns the object bound with the specified name in this session or null if no object of that name exists. | public Enumeration | getAttributeNames() Returns an array containing the names of all the objects bound to this session. | public long | getCreationTime() Returns the time when this session was created, measured
in milliseconds since midnight January 1, 1970 GMT. | public String | getId() Returns a string containing the unique identifier assigned to this session. | public long | getLastAccessedTime() Returns the last time the client sent a request associated with this session,
as the number of milliseconds since midnight January 1, 1970 GMT. | public int | getMaxInactiveInterval() Returns the maximum time interval, in seconds, that the servlet engine will keep this session open
between client requests. | URL | getOriginalURL() | String[] | getRoles() | public ServletContext | getServletContext() Returns the ServletContext to which this session belongs. | public HttpSessionContext | getSessionContext() | String | getUserName() | public Object | getValue(String name) | public String[] | getValueNames() | public void | invalidate() Invalidates this session and unbinds any objects bound to it. | boolean | isInvalid() | public boolean | isNew() Returns true if the Web server has created a session but the client
has not yet joined. | public void | putValue(String name, Object value) | public void | removeAttribute(String name) Removes the object bound with the specified name from this session. | public void | removeValue(String name) | public void | setAttribute(String name, Object value) Binds an object to this session, using the name specified. | public void | setMaxInactiveInterval(int interval) Specifies the maximum length of time, in seconds, that the servlet engine keeps this session
if no user requests have been made of the session. | void | setOriginalURL(URL originalURL) | void | setUserInformation(String userName, String[] roles) Sets the authenticated user information for a session. |
SESSION_COOKIE_NAME | final public static String SESSION_COOKIE_NAME(Code) | | |
access | void access()(Code) | | This method should be invoked when a servlet joins an existing session. It will update the last access time
and mark the session as no longer new.
|
getAttribute | public Object getAttribute(String name)(Code) | | Returns the object bound with the specified name in this session or null if no object of that name exists.
|
getAttributeNames | public Enumeration getAttributeNames()(Code) | | Returns an array containing the names of all the objects bound to this session.
This method is useful, for example, when you want to delete all the objects bound to this session.
|
getCreationTime | public long getCreationTime()(Code) | | Returns the time when this session was created, measured
in milliseconds since midnight January 1, 1970 GMT.
exception: IllegalStateException - if you attempt to get the session'screation time after the session hasbeen invalidated |
getId | public String getId()(Code) | | Returns a string containing the unique identifier assigned to this session.
The identifier is assigned by the servlet engine and is implementation dependent.
|
getLastAccessedTime | public long getLastAccessedTime()(Code) | | Returns the last time the client sent a request associated with this session,
as the number of milliseconds since midnight January 1, 1970 GMT.
|
getMaxInactiveInterval | public int getMaxInactiveInterval()(Code) | | Returns the maximum time interval, in seconds, that the servlet engine will keep this session open
between client requests. You can set the maximum time interval with the setMaxInactiveInterval method.
|
getServletContext | public ServletContext getServletContext()(Code) | | Returns the ServletContext to which this session belongs.
since: 1.3 |
invalidate | public void invalidate()(Code) | | Invalidates this session and unbinds any objects bound to it.
|
isInvalid | boolean isInvalid()(Code) | | |
isNew | public boolean isNew()(Code) | | Returns true if the Web server has created a session but the client
has not yet joined. For example, if the server used only
cookie-based sessions, and the client had disabled the use of cookies,
then a session would be new.
|
removeAttribute | public void removeAttribute(String name)(Code) | | Removes the object bound with the specified name from this session. If the session does not
have an object bound with the specified name, this method does nothing.
|
setAttribute | public void setAttribute(String name, Object value)(Code) | | Binds an object to this session, using the name specified. If an object of the same name
is already bound to the session, the object is replaced.
|
setMaxInactiveInterval | public void setMaxInactiveInterval(int interval)(Code) | | Specifies the maximum length of time, in seconds, that the servlet engine keeps this session
if no user requests have been made of the session.
|
setOriginalURL | void setOriginalURL(URL originalURL)(Code) | | |
setUserInformation | void setUserInformation(String userName, String[] roles)(Code) | | Sets the authenticated user information for a session.
Parameters: userName - the name the user supplied when logging in Parameters: roles - an array of role names assigned to the user |
|
|