|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.servlet.sessions.HTTPSession
HTTPSession is an implementation of the standard HttpSession interface.
Constructor Summary | |
HTTPSession(HTTPContext context)
Construct an HTTPSession associated with the specified context. |
Method Summary | |
void |
accessed()
Set the last accessed time to the current time. |
boolean |
expired()
|
java.lang.Object |
getAttribute(java.lang.String name)
Return the attribute associated with the specified name. |
java.util.Enumeration |
getAttributeNames()
Return an enumeration over all the attribute names. |
long |
getCreationTime()
Return my creation time as milliseconds since midnight January 1, 1970 GMT |
static int |
getDefaultTimeout()
Return the default maximum inactive interval, in seconds. |
java.lang.String |
getId()
Return my id. |
long |
getLastAccessedTime()
Return the last accessed time. |
int |
getMaxInactiveInterval()
Return the maximum number of seconds that I can remain inactive before being invalidated. |
javax.servlet.ServletContext |
getServletContext()
|
javax.servlet.http.HttpSessionContext |
getSessionContext()
Deprecated. |
int |
getTimeout()
|
java.lang.Object |
getValue(java.lang.String name)
Deprecated. |
java.lang.String[] |
getValueNames()
Deprecated. |
void |
invalidate()
Invalidates this session then unbinds any objects bound to it. |
boolean |
isNew()
Return true if I have not been accessed yet. |
boolean |
isValid()
Check if the session is still valid. |
void |
putValue(java.lang.String name,
java.lang.Object value)
Deprecated. |
void |
removeAttribute(java.lang.String name)
Remove the attribute with the specified name. |
void |
removeValue(java.lang.String name)
Deprecated. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set an attribute with the specified name and value. |
static void |
setDefaultTimeout(int seconds)
Set the default maximum inactive interval, in seconds |
void |
setMaxInactiveInterval(int interval)
Set the maximum number of seconds that I can remain inactive before being invalidated. |
void |
setTimeout(int interval)
Set the maximum number of seconds that I can remain inactive before being invalidated. |
java.lang.String |
toString()
Return a description. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HTTPSession(HTTPContext context)
context
- The context.Method Detail |
public java.lang.String toString()
public java.lang.String getId()
getId
in interface javax.servlet.http.HttpSession
public long getCreationTime() throws java.lang.IllegalStateException
getCreationTime
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public void setTimeout(int interval)
ISession
setTimeout
in interface ISession
interval
- public void setMaxInactiveInterval(int interval)
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
interval
- The time interval in seconds.public int getTimeout()
getTimeout
in interface ISession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public boolean isNew() throws java.lang.IllegalStateException
isNew
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public long getLastAccessedTime()
getLastAccessedTime
in interface javax.servlet.http.HttpSession
public void accessed()
accessed
in interface ISession
public boolean expired()
expired
in interface ISession
public static void setDefaultTimeout(int seconds)
seconds
- The new maximum.public static int getDefaultTimeout()
public java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalStateException
getAttribute
in interface javax.servlet.http.HttpSession
name
- The name.
java.lang.IllegalStateException
- If the session is invalidated.public java.util.Enumeration getAttributeNames() throws java.lang.IllegalStateException
getAttributeNames
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
- If the session is invalidated.public void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalStateException
setAttribute
in interface javax.servlet.http.HttpSession
name
- The attribute name.value
- The attribute value.
java.lang.IllegalStateException
- If the session is invalidated.public void removeAttribute(java.lang.String name) throws java.lang.IllegalStateException
removeAttribute
in interface javax.servlet.http.HttpSession
name
- The name.
java.lang.IllegalStateException
- If the session is invalidated.public java.lang.Object getValue(java.lang.String name) throws java.lang.IllegalStateException
getValue
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public void putValue(java.lang.String name, java.lang.Object value) throws java.lang.IllegalStateException
putValue
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public void removeValue(java.lang.String name) throws java.lang.IllegalStateException
removeValue
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public java.lang.String[] getValueNames() throws java.lang.IllegalStateException
getValueNames
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
public void invalidate() throws java.lang.IllegalStateException
invalidate
in interface javax.servlet.http.HttpSession
java.lang.IllegalStateException
- if this method is called
on an already invalidated session.public boolean isValid()
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.http.HttpSession
public javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext
in interface javax.servlet.http.HttpSession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |