|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.mock.MockHttpSession
public class MockHttpSession
Simple mock implementation of HttpSession that implements most basic operations.
Constructor Summary | |
---|---|
MockHttpSession(ServletContext context)
Default constructor which provides the session with access to the context. |
Method Summary | |
---|---|
Object |
getAttribute(String key)
Returns the value of the named attribute from an internal Map. |
Enumeration<String> |
getAttributeNames()
Returns an enumeration of all the attribute names in the session. |
long |
getCreationTime()
Returns the time in milliseconds when the session was created. |
String |
getId()
Returns an ID that was randomly generated when the session was created. |
long |
getLastAccessedTime()
Always returns the current time. |
int |
getMaxInactiveInterval()
Always returns Integer.MAX_VALUE. |
ServletContext |
getServletContext()
Provides access to the servlet context within which the session exists. |
HttpSessionContext |
getSessionContext()
Deprecated method always returns null. |
Object |
getValue(String key)
Deprecated method. |
String[] |
getValueNames()
Returns a String[] of all the attribute names in session. |
void |
invalidate()
Clears the set of attributes, but has no other effect. |
boolean |
isNew()
Always returns false. |
void |
putValue(String key,
Object value)
Stores the value in session, replacing any existing value with the same key. |
void |
removeAttribute(String key)
Removes any value stored in session with the key supplied. |
void |
removeValue(String key)
Removes any value stored in session with the key supplied. |
void |
setAttribute(String key,
Object value)
Stores the value in session, replacing any existing value with the same key. |
void |
setMaxInactiveInterval(int i)
Has no effect. |
void |
setServletContext(ServletContext context)
Sets the servlet context within which the session exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockHttpSession(ServletContext context)
Method Detail |
---|
public long getCreationTime()
getCreationTime
in interface HttpSession
public String getId()
getId
in interface HttpSession
public long getLastAccessedTime()
getLastAccessedTime
in interface HttpSession
public ServletContext getServletContext()
getServletContext
in interface HttpSession
public void setServletContext(ServletContext context)
public void setMaxInactiveInterval(int i)
setMaxInactiveInterval
in interface HttpSession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface HttpSession
public HttpSessionContext getSessionContext()
getSessionContext
in interface HttpSession
public Object getAttribute(String key)
getAttribute
in interface HttpSession
public Object getValue(String key)
getValue
in interface HttpSession
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface HttpSession
public String[] getValueNames()
getValueNames
in interface HttpSession
public void setAttribute(String key, Object value)
setAttribute
in interface HttpSession
public void putValue(String key, Object value)
putValue
in interface HttpSession
public void removeAttribute(String key)
removeAttribute
in interface HttpSession
public void removeValue(String key)
removeValue
in interface HttpSession
public void invalidate()
invalidate
in interface HttpSession
public boolean isNew()
isNew
in interface HttpSession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |