org.springframework.mock.web.portlet
Class MockPortletSession
java.lang.Object
org.springframework.mock.web.portlet.MockPortletSession
- All Implemented Interfaces:
- javax.portlet.PortletSession
public class MockPortletSession
- extends java.lang.Object
- implements javax.portlet.PortletSession
Mock implementation of the PortletSession
interface.
- Since:
- 2.0
- Author:
- John A. Lewis, Juergen Hoeller
Fields inherited from interface javax.portlet.PortletSession |
APPLICATION_SCOPE, PORTLET_SCOPE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nextId
private static int nextId
id
private final java.lang.String id
creationTime
private final long creationTime
maxInactiveInterval
private int maxInactiveInterval
lastAccessedTime
private long lastAccessedTime
portletContext
private final javax.portlet.PortletContext portletContext
portletAttributes
private final java.util.Map<java.lang.String,java.lang.Object> portletAttributes
applicationAttributes
private final java.util.Map<java.lang.String,java.lang.Object> applicationAttributes
invalid
private boolean invalid
isNew
private boolean isNew
MockPortletSession
public MockPortletSession()
- Create a new MockPortletSession with a default
MockPortletContext
.
- See Also:
MockPortletContext
MockPortletSession
public MockPortletSession(javax.portlet.PortletContext portletContext)
- Create a new MockPortletSession.
- Parameters:
portletContext
- the PortletContext that the session runs in
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Specified by:
getAttribute
in interface javax.portlet.PortletSession
getAttribute
public java.lang.Object getAttribute(java.lang.String name,
int scope)
- Specified by:
getAttribute
in interface javax.portlet.PortletSession
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNames
in interface javax.portlet.PortletSession
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames(int scope)
- Specified by:
getAttributeNames
in interface javax.portlet.PortletSession
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTime
in interface javax.portlet.PortletSession
getId
public java.lang.String getId()
- Specified by:
getId
in interface javax.portlet.PortletSession
access
public void access()
getLastAccessedTime
public long getLastAccessedTime()
- Specified by:
getLastAccessedTime
in interface javax.portlet.PortletSession
getMaxInactiveInterval
public int getMaxInactiveInterval()
- Specified by:
getMaxInactiveInterval
in interface javax.portlet.PortletSession
clearAttributes
public void clearAttributes()
- Clear all of this session's attributes.
doClearAttributes
protected void doClearAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
invalidate
public void invalidate()
- Specified by:
invalidate
in interface javax.portlet.PortletSession
isInvalid
public boolean isInvalid()
setNew
public void setNew(boolean value)
isNew
public boolean isNew()
- Specified by:
isNew
in interface javax.portlet.PortletSession
removeAttribute
public void removeAttribute(java.lang.String name)
- Specified by:
removeAttribute
in interface javax.portlet.PortletSession
removeAttribute
public void removeAttribute(java.lang.String name,
int scope)
- Specified by:
removeAttribute
in interface javax.portlet.PortletSession
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value)
- Specified by:
setAttribute
in interface javax.portlet.PortletSession
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
- Specified by:
setAttribute
in interface javax.portlet.PortletSession
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveInterval
in interface javax.portlet.PortletSession
getPortletContext
public javax.portlet.PortletContext getPortletContext()
- Specified by:
getPortletContext
in interface javax.portlet.PortletSession
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
- Specified by:
getAttributeMap
in interface javax.portlet.PortletSession
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap(int scope)
- Specified by:
getAttributeMap
in interface javax.portlet.PortletSession