|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.click.servlet.MockSession
Mock implementation of HttpSession.
| Constructor Summary | |
MockSession()
Create a default MockSession. |
|
MockSession(ServletContext servletContext)
Create a MockSession for the specified servletContext. |
|
MockSession(String id)
Create a MockSession for the specified session identifier. |
|
MockSession(String id,
ServletContext servletContext)
Create a MockSession for the specified id and servletContext. |
|
| Method Summary | |
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
long |
getCreationTime()
|
String |
getId()
|
long |
getLastAccessedTime()
This method will return the current time by invoking System.currentTimeMillis(). |
int |
getMaxInactiveInterval()
|
ServletContext |
getServletContext()
|
HttpSessionContext |
getSessionContext()
|
Object |
getValue(String name)
|
String[] |
getValueNames()
|
void |
invalidate()
|
boolean |
isNew()
|
void |
putValue(String name,
Object value)
|
void |
removeAttribute(String name)
|
void |
removeValue(String name)
|
void |
setAttribute(String name,
Object value)
|
void |
setId(String id)
Sets session unique identifier. |
void |
setMaxInactiveInterval(int maxInterval)
|
void |
setServletContext(ServletContext servletContext)
Sets the servletContext to which the session belong. |
String |
toString()
Return a string representation of the session. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MockSession()
public MockSession(String id)
id - session unique identifier.public MockSession(ServletContext servletContext)
servletContext - the servletContext to which this session belong
public MockSession(String id,
ServletContext servletContext)
id - session unique identifier.servletContext - the servletContext to which this session belong| Method Detail |
public void setId(String id)
id - a unique session identifierpublic void setServletContext(ServletContext servletContext)
servletContext - the servletContext to which this session belongpublic Enumeration getAttributeNames()
getAttributeNames in interface HttpSessionHttpSession.getAttributeNames()public long getCreationTime()
getCreationTime in interface HttpSessionHttpSession.getCreationTime()public String getId()
getId in interface HttpSessionHttpSession.getId()public long getLastAccessedTime()
getLastAccessedTime in interface HttpSessionHttpSession.getLastAccessedTime()public int getMaxInactiveInterval()
getMaxInactiveInterval in interface HttpSessionHttpSession.getMaxInactiveInterval()public ServletContext getServletContext()
getServletContext in interface HttpSessionHttpSession.getServletContext()public HttpSessionContext getSessionContext()
getSessionContext in interface HttpSessionHttpSession.getSessionContext()public String[] getValueNames()
getValueNames in interface HttpSessionHttpSession.getValueNames()public void invalidate()
invalidate in interface HttpSessionHttpSession.invalidate()public boolean isNew()
isNew in interface HttpSessionHttpSession.isNew()public void setMaxInactiveInterval(int maxInterval)
setMaxInactiveInterval in interface HttpSessionmaxInterval - an integer specifying the number of secondsHttpSession.setMaxInactiveInterval(int)public void removeValue(String name)
removeValue in interface HttpSessionname - the name of the object to remove from this sessionHttpSession.removeValue(java.lang.String)public void removeAttribute(String name)
removeAttribute in interface HttpSessionname - the name of the object to remove from this sessionHttpSession.removeAttribute(java.lang.String)public Object getAttribute(String name)
getAttribute in interface HttpSessionname - a string specifying the name of the object
HttpSession.getAttribute(java.lang.String)public Object getValue(String name)
getValue in interface HttpSessionname - a string specifying the name of the object
HttpSession.getValue(java.lang.String)
public void setAttribute(String name,
Object value)
setAttribute in interface HttpSessionname - the name to which the object is bound; cannot be nullvalue - the object to be boundHttpSession.setAttribute(java.lang.String, java.lang.Object)
public void putValue(String name,
Object value)
putValue in interface HttpSessionname - the name to which the object is bound; cannot be nullvalue - the object to be bound; cannot be nullHttpSession.putValue(java.lang.String, java.lang.Object)public String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||