|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.slim3.struts.test.MockHttpSession
public class MockHttpSession
A mock implementation for HttpSession.
| Field Summary | |
|---|---|
protected Map<String,Object> |
attributeMap
The map for the attributes. |
protected long |
creationTime
The creation time. |
protected String |
id
The identifier. |
protected long |
lastAccessedTime
The last accessed time. |
protected int |
maxInactiveInterval
The max inactive internal. |
protected boolean |
newFlag
Whether this session is created by the current request. |
protected ServletContext |
servletContext
The servlet context. |
protected boolean |
valid
Whether this session is valid. |
| Constructor Summary | |
|---|---|
MockHttpSession(ServletContext servletContext)
Constructor. |
|
| Method Summary | |
|---|---|
Object |
getAttribute(String name)
|
Enumeration<String> |
getAttributeNames()
|
long |
getCreationTime()
|
String |
getId()
|
long |
getLastAccessedTime()
|
int |
getMaxInactiveInterval()
|
ServletContext |
getServletContext()
|
HttpSessionContext |
getSessionContext()
|
Object |
getValue(String name)
|
String[] |
getValueNames()
|
void |
invalidate()
|
boolean |
isNew()
|
boolean |
isValid()
Determines if this session is valid. |
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 the identifier. |
void |
setMaxInactiveInterval(int maxInactiveInterval)
|
void |
setNew(boolean newFlag)
Sets the new flag. |
void |
updateLastAccessedTime()
Reuses this session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final long creationTime
protected long lastAccessedTime
protected ServletContext servletContext
protected String id
protected boolean newFlag
protected int maxInactiveInterval
protected Map<String,Object> attributeMap
protected boolean valid
| Constructor Detail |
|---|
public MockHttpSession(ServletContext servletContext)
throws NullPointerException
servletContext - the servlet context
NullPointerException - if the servletContext parameter is null| Method Detail |
|---|
public long getCreationTime()
getCreationTime in interface HttpSessionpublic String getId()
getId in interface HttpSessionpublic void setId(String id)
id - the identifierpublic long getLastAccessedTime()
getLastAccessedTime in interface HttpSessionHttpSession.getLastAccessedTime()public void updateLastAccessedTime()
public ServletContext getServletContext()
getServletContext in interface HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface HttpSessionpublic void setMaxInactiveInterval(int maxInactiveInterval)
setMaxInactiveInterval in interface HttpSessionpublic Object getAttribute(String name)
getAttribute in interface HttpSession
public void setAttribute(String name,
Object value)
setAttribute in interface HttpSessionpublic void removeAttribute(String name)
removeAttribute in interface HttpSessionpublic HttpSessionContext getSessionContext()
getSessionContext in interface HttpSessionpublic Object getValue(String name)
getValue in interface HttpSessionpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface HttpSessionpublic String[] getValueNames()
getValueNames in interface HttpSession
public void putValue(String name,
Object value)
putValue in interface HttpSessionpublic void removeValue(String name)
removeValue in interface HttpSessionpublic void invalidate()
invalidate in interface HttpSessionpublic boolean isNew()
isNew in interface HttpSessionpublic void setNew(boolean newFlag)
newFlag - the new flagpublic boolean isValid()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||