public class MockPortletSession
extends java.lang.Object
javax.portlet.PortletSession
interface.Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
applicationAttributes |
private long |
creationTime |
private java.lang.String |
id |
private boolean |
invalid |
private boolean |
isNew |
private long |
lastAccessedTime |
private int |
maxInactiveInterval |
private static int |
nextId |
private java.util.Map<java.lang.String,java.lang.Object> |
portletAttributes |
private PortletContext |
portletContext |
Constructor and Description |
---|
MockPortletSession()
Create a new MockPortletSession with a default
MockPortletContext . |
MockPortletSession(PortletContext portletContext)
Create a new MockPortletSession.
|
Modifier and Type | Method and Description |
---|---|
void |
access() |
void |
clearAttributes()
Clear all of this session's attributes.
|
protected void |
doClearAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes) |
java.lang.Object |
getAttribute(java.lang.String name) |
java.lang.Object |
getAttribute(java.lang.String name,
int scope) |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap() |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap(int scope) |
java.util.Enumeration<java.lang.String> |
getAttributeNames() |
java.util.Enumeration<java.lang.String> |
getAttributeNames(int scope) |
long |
getCreationTime() |
java.lang.String |
getId() |
long |
getLastAccessedTime() |
int |
getMaxInactiveInterval() |
PortletContext |
getPortletContext() |
void |
invalidate() |
boolean |
isInvalid() |
boolean |
isNew() |
void |
removeAttribute(java.lang.String name) |
void |
removeAttribute(java.lang.String name,
int scope) |
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
void |
setAttribute(java.lang.String name,
java.lang.Object value,
int scope) |
void |
setMaxInactiveInterval(int interval) |
void |
setNew(boolean value) |
private static int nextId
private final java.lang.String id
private final long creationTime
private int maxInactiveInterval
private long lastAccessedTime
private final PortletContext portletContext
private final java.util.Map<java.lang.String,java.lang.Object> portletAttributes
private final java.util.Map<java.lang.String,java.lang.Object> applicationAttributes
private boolean invalid
private boolean isNew
public MockPortletSession()
MockPortletContext
.MockPortletContext
public MockPortletSession(PortletContext portletContext)
portletContext
- the PortletContext that the session runs inpublic java.lang.Object getAttribute(java.lang.String name)
public java.lang.Object getAttribute(java.lang.String name, int scope)
public java.util.Enumeration<java.lang.String> getAttributeNames()
public java.util.Enumeration<java.lang.String> getAttributeNames(int scope)
public long getCreationTime()
public java.lang.String getId()
public void access()
public long getLastAccessedTime()
public int getMaxInactiveInterval()
public void clearAttributes()
protected void doClearAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
public void invalidate()
public boolean isInvalid()
public void setNew(boolean value)
public boolean isNew()
public void removeAttribute(java.lang.String name)
public void removeAttribute(java.lang.String name, int scope)
public void setAttribute(java.lang.String name, java.lang.Object value)
public void setAttribute(java.lang.String name, java.lang.Object value, int scope)
public void setMaxInactiveInterval(int interval)
public PortletContext getPortletContext()
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap(int scope)