org.springframework.mock.web.portlet
Class MockPortletSession

java.lang.Object
  extended by org.springframework.mock.web.portlet.MockPortletSession

public class MockPortletSession
extends java.lang.Object

Mock implementation of the javax.portlet.PortletSession interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Field Summary
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 Summary
MockPortletSession()
          Create a new MockPortletSession with a default MockPortletContext.
MockPortletSession(PortletContext portletContext)
          Create a new MockPortletSession.
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 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
Constructor Detail

MockPortletSession

public MockPortletSession()
Create a new MockPortletSession with a default MockPortletContext.

See Also:
MockPortletContext

MockPortletSession

public MockPortletSession(PortletContext portletContext)
Create a new MockPortletSession.

Parameters:
portletContext - the PortletContext that the session runs in
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     int scope)

getAttributeNames

public java.util.Enumeration<java.lang.String> getAttributeNames()

getAttributeNames

public java.util.Enumeration<java.lang.String> getAttributeNames(int scope)

getCreationTime

public long getCreationTime()

getId

public java.lang.String getId()

access

public void access()

getLastAccessedTime

public long getLastAccessedTime()

getMaxInactiveInterval

public int getMaxInactiveInterval()

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()

isInvalid

public boolean isInvalid()

setNew

public void setNew(boolean value)

isNew

public boolean isNew()

removeAttribute

public void removeAttribute(java.lang.String name)

removeAttribute

public void removeAttribute(java.lang.String name,
                            int scope)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value,
                         int scope)

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)

getPortletContext

public PortletContext getPortletContext()

getAttributeMap

public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()

getAttributeMap

public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap(int scope)