|
||||||||||
| 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 HttpSessionpublic String getId()
getId in interface HttpSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface HttpSessionpublic ServletContext getServletContext()
getServletContext in interface HttpSessionpublic void setServletContext(ServletContext context)
public void setMaxInactiveInterval(int i)
setMaxInactiveInterval in interface HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface HttpSessionpublic HttpSessionContext getSessionContext()
getSessionContext in interface HttpSessionpublic Object getAttribute(String key)
getAttribute in interface HttpSessionpublic Object getValue(String key)
getValue in interface HttpSessionpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface HttpSessionpublic 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 HttpSessionpublic void removeAttribute(String key)
removeAttribute in interface HttpSessionpublic void removeValue(String key)
removeValue in interface HttpSessionpublic void invalidate()
invalidate in interface HttpSessionpublic boolean isNew()
isNew in interface HttpSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||