|
||||||||||
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 nullMethod Detail |
---|
public long getCreationTime()
getCreationTime
in interface HttpSession
public String getId()
getId
in interface HttpSession
public void setId(String id)
id
- the identifierpublic long getLastAccessedTime()
getLastAccessedTime
in interface HttpSession
HttpSession.getLastAccessedTime()
public void updateLastAccessedTime()
public ServletContext getServletContext()
getServletContext
in interface HttpSession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface HttpSession
public void setMaxInactiveInterval(int maxInactiveInterval)
setMaxInactiveInterval
in interface HttpSession
public Object getAttribute(String name)
getAttribute
in interface HttpSession
public void setAttribute(String name, Object value)
setAttribute
in interface HttpSession
public void removeAttribute(String name)
removeAttribute
in interface HttpSession
public HttpSessionContext getSessionContext()
getSessionContext
in interface HttpSession
public Object getValue(String name)
getValue
in interface HttpSession
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface HttpSession
public String[] getValueNames()
getValueNames
in interface HttpSession
public void putValue(String name, Object value)
putValue
in interface HttpSession
public void removeValue(String name)
removeValue
in interface HttpSession
public void invalidate()
invalidate
in interface HttpSession
public boolean isNew()
isNew
in interface HttpSession
public 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 |