Fish & Chips Club 4.10.0.0

hirondelle.fish.test.doubles
Class FakeSession

Object
  extended by hirondelle.fish.test.doubles.FakeSession
All Implemented Interfaces:
HttpSession

public class FakeSession
extends Object
implements HttpSession

Fake implementation of HttpSession, used only for testing outside of the regular runtime environment.


Method Summary
 Object getAttribute(String aName)
           
 Enumeration getAttributeNames()
           
 long getCreationTime()
          Returns the time this session object was created.
 String getId()
          Return the session id.
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
          Default value 30 minutes.
 ServletContext getServletContext()
          Returns a fake ServletContext.
 HttpSessionContext getSessionContext()
          Returns null - deprecated.
 Object getValue(String aName)
          Returns null - deprecated.
 String[] getValueNames()
          Returns null - deprecated.
 void invalidate()
           
 boolean isNew()
          Returns true only if no request has yet joined this session.
static HttpSession joinOrCreate(String aRequestedSessionId, boolean aCreateNew)
          Each incoming request calls this method in order to join an existing session, or create a new one.
 void putValue(String aName, Object aValue)
          Does nothing - deprecated.
 void removeAttribute(String aName)
           
 void removeValue(String aName)
          Does nothing - deprecated.
 void setAttribute(String aName, Object aObject)
           
 void setMaxInactiveInterval(int aInterval)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

joinOrCreate

public static HttpSession joinOrCreate(String aRequestedSessionId,
                                       boolean aCreateNew)
Each incoming request calls this method in order to join an existing session, or create a new one.

Parameters:
aRequestedSessionId - identifies the session that the request wishes to join.
aCreateNew - if the request fails to join an existing session and aCreateNew is true, then a new session is created. If aCreateNew is false, then no such new session is created.
Returns:
the session which the request has joined, or null if no session was joined.

getCreationTime

public long getCreationTime()
Returns the time this session object was created.

Specified by:
getCreationTime in interface HttpSession

getId

public String getId()
Return the session id.

Specified by:
getId in interface HttpSession

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface HttpSession

getServletContext

public ServletContext getServletContext()
Returns a fake ServletContext.

Specified by:
getServletContext in interface HttpSession

setMaxInactiveInterval

public void setMaxInactiveInterval(int aInterval)
Specified by:
setMaxInactiveInterval in interface HttpSession

getMaxInactiveInterval

public int getMaxInactiveInterval()
Default value 30 minutes.

Specified by:
getMaxInactiveInterval in interface HttpSession

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface HttpSession

getAttribute

public Object getAttribute(String aName)
Specified by:
getAttribute in interface HttpSession

setAttribute

public void setAttribute(String aName,
                         Object aObject)
Specified by:
setAttribute in interface HttpSession

removeAttribute

public void removeAttribute(String aName)
Specified by:
removeAttribute in interface HttpSession

invalidate

public void invalidate()
Specified by:
invalidate in interface HttpSession

isNew

public boolean isNew()
Returns true only if no request has yet joined this session.

Specified by:
isNew in interface HttpSession

putValue

public void putValue(String aName,
                     Object aValue)
Does nothing - deprecated.

Specified by:
putValue in interface HttpSession

removeValue

public void removeValue(String aName)
Does nothing - deprecated.

Specified by:
removeValue in interface HttpSession

getValue

public Object getValue(String aName)
Returns null - deprecated.

Specified by:
getValue in interface HttpSession

getSessionContext

public HttpSessionContext getSessionContext()
Returns null - deprecated.

Specified by:
getSessionContext in interface HttpSession

getValueNames

public String[] getValueNames()
Returns null - deprecated.

Specified by:
getValueNames in interface HttpSession

Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26