com.ideo.sweetdevria.mock
Class MockHttpSession

java.lang.Object
  extended by com.ideo.sweetdevria.mock.MockHttpSession
All Implemented Interfaces:
javax.servlet.http.HttpSession

public final class MockHttpSession
extends java.lang.Object
implements javax.servlet.http.HttpSession

Mock HttpSession object used for "non web" context (exemple : the excel export in batch mode). This object implements only getter/setter methods for attributes.

Author:
Vitaliy Shevchuk, Gregory Paul

Constructor Summary
MockHttpSession(javax.servlet.ServletContext servletContext)
          Default constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attributeName)
          Get the object stored in the hash map under this attribute name.
 java.util.Enumeration getAttributeNames()
          Get all attributes names.
 long getCreationTime()
          Not implemented !
 java.lang.String getId()
          Not implemented !
 long getLastAccessedTime()
          Not implemented !
 int getMaxInactiveInterval()
          Not implemented !
 javax.servlet.ServletContext getServletContext()
          Not implemented !
 javax.servlet.http.HttpSessionContext getSessionContext()
          Deprecated.  
 java.lang.Object getValue(java.lang.String attributeName)
          Get the value from attribute.
 java.lang.String[] getValueNames()
          Get value names.
 void invalidate()
          Not implemented !
 boolean isNew()
          Not implemented !
 void putValue(java.lang.String attributeName, java.lang.Object object)
          Set an object under the attribute name.
 void removeAttribute(java.lang.String attributeName)
          Remove the attribute.
 void removeValue(java.lang.String attributeName)
          Remove the attribute.
 void setAttribute(java.lang.String attributeName, java.lang.Object attribute)
          Set an object under the attribute name.
 void setMaxInactiveInterval(int i)
          Not implemented !
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockHttpSession

public MockHttpSession(javax.servlet.ServletContext servletContext)
Default constructor.

Parameters:
servletContext - Servlet context
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
Get the object stored in the hash map under this attribute name.

Specified by:
getAttribute in interface javax.servlet.http.HttpSession
Parameters:
attributeName - attribute name
Returns:
Object found for this attribute name

getAttributeNames

public java.util.Enumeration getAttributeNames()
Get all attributes names.

Specified by:
getAttributeNames in interface javax.servlet.http.HttpSession
Returns:
Enumeration containing all attributes names

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attribute)
Set an object under the attribute name.

Specified by:
setAttribute in interface javax.servlet.http.HttpSession
Parameters:
attributeName - Attribute name under which store the object
attribute - object to store

removeAttribute

public void removeAttribute(java.lang.String attributeName)
Remove the attribute.

Specified by:
removeAttribute in interface javax.servlet.http.HttpSession
Parameters:
attributeName - Attribute name under which store the object

getValue

public java.lang.Object getValue(java.lang.String attributeName)
Get the value from attribute.

Specified by:
getValue in interface javax.servlet.http.HttpSession
Parameters:
attributeName - Attribute name under which store the object
Returns:
value object

getValueNames

public java.lang.String[] getValueNames()
Get value names.

Specified by:
getValueNames in interface javax.servlet.http.HttpSession
Returns:
value names

putValue

public void putValue(java.lang.String attributeName,
                     java.lang.Object object)
Set an object under the attribute name.

Specified by:
putValue in interface javax.servlet.http.HttpSession
Parameters:
attributeName - Attribute name under which store the object
object - Value to store

removeValue

public void removeValue(java.lang.String attributeName)
Remove the attribute.

Specified by:
removeValue in interface javax.servlet.http.HttpSession
Parameters:
attributeName - Attribute name under which store the object

getCreationTime

public long getCreationTime()
Not implemented !

Specified by:
getCreationTime in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

getId

public java.lang.String getId()
Not implemented !

Specified by:
getId in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

getLastAccessedTime

public long getLastAccessedTime()
Not implemented !

Specified by:
getLastAccessedTime in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

getServletContext

public javax.servlet.ServletContext getServletContext()
Not implemented !

Specified by:
getServletContext in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

setMaxInactiveInterval

public void setMaxInactiveInterval(int i)
Not implemented !

Specified by:
setMaxInactiveInterval in interface javax.servlet.http.HttpSession
Parameters:
i - value

getMaxInactiveInterval

public int getMaxInactiveInterval()
Not implemented !

Specified by:
getMaxInactiveInterval in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()
Deprecated. 

Not implemented !

Specified by:
getSessionContext in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)

invalidate

public void invalidate()
Not implemented !

Specified by:
invalidate in interface javax.servlet.http.HttpSession

isNew

public boolean isNew()
Not implemented !

Specified by:
isNew in interface javax.servlet.http.HttpSession
Returns:
nothing (RuntimeException)


Copyright © 2010 Ideo Technologies. All Rights Reserved.