net.noderunner.http.servlet
Class BasicHttpSession

java.lang.Object
  extended by net.noderunner.http.servlet.BasicHttpSession
All Implemented Interfaces:
javax.servlet.http.HttpSession

public class BasicHttpSession
extends Object
implements javax.servlet.http.HttpSession

Basic (mostly dummy) implementation of HTTP session.

Author:
Elias Ross

Constructor Summary
BasicHttpSession()
           
 
Method Summary
 Object getAttribute(String name)
          Returns attribute value by name.
 Enumeration<String> getAttributeNames()
          Returns attribute enumeration.
 long getCreationTime()
          Returns time this object was created.
 String getId()
          Returns ID based on timestamp.
 long getLastAccessedTime()
          Returns zero.
 int getMaxInactiveInterval()
          Returns zero.
 javax.servlet.ServletContext getServletContext()
          Returns null.
 javax.servlet.http.HttpSessionContext getSessionContext()
          Returns null.
 Object getValue(String name)
          Returns the value of the attribute.
 String[] getValueNames()
          Returns the value names.
 void invalidate()
          Clears attributes.
 boolean isNew()
          Returns true.
 void putValue(String name, Object value)
          Puts the value.
 void removeAttribute(String name)
          Removes an attribute by name.
 void removeValue(String name)
          Removes a value by name.
 void setAttribute(String name, Object arg1)
          Sets an attribute.
 void setMaxInactiveInterval(int arg0)
          Sets inactive interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicHttpSession

public BasicHttpSession()
Method Detail

getAttribute

public Object getAttribute(String name)
Returns attribute value by name.

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

getAttributeNames

public Enumeration<String> getAttributeNames()
Returns attribute enumeration.

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

getCreationTime

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

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

getId

public String getId()
Returns ID based on timestamp.

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

getLastAccessedTime

public long getLastAccessedTime()
Returns zero.

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

getMaxInactiveInterval

public int getMaxInactiveInterval()
Returns zero.

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

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns null.

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

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()
Returns null.

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

getValue

public Object getValue(String name)
Returns the value of the attribute.

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

getValueNames

public String[] getValueNames()
Returns the value names.

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

invalidate

public void invalidate()
Clears attributes.

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

isNew

public boolean isNew()
Returns true.

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

putValue

public void putValue(String name,
                     Object value)
Puts the value.

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

removeAttribute

public void removeAttribute(String name)
Removes an attribute by name.

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

removeValue

public void removeValue(String name)
Removes a value by name.

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

setAttribute

public void setAttribute(String name,
                         Object arg1)
Sets an attribute.

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

setMaxInactiveInterval

public void setMaxInactiveInterval(int arg0)
Sets inactive interval.

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


Copyright © 2011. All Rights Reserved.