org.eclipse.jetty.server.session
Class AbstractSession

java.lang.Object
  extended by org.eclipse.jetty.server.session.AbstractSession
All Implemented Interfaces:
HttpSession, AbstractSessionManager.SessionIf
Direct Known Subclasses:
HashedSession, JDBCSessionManager.Session, NoSqlSession

public abstract class AbstractSession
extends Object
implements AbstractSessionManager.SessionIf

Implements HttpSession from the javax.servlet package.


Field Summary
protected  Map<String,Object> _jdbcAttributes
           
 
Constructor Summary
protected AbstractSession(AbstractSessionManager abstractSessionManager, HttpServletRequest request)
           
protected AbstractSession(AbstractSessionManager abstractSessionManager, long created, long accessed, String clusterId)
           
 
Method Summary
protected  boolean access(long time)
           
 void bindValue(String name, Object value)
          If value implements HttpSessionBindingListener, call valueBound()
protected  void checkValid()
          asserts that the session is valid
 void clearAttributes()
           
protected  void complete()
           
protected  void cookieSet()
           
 void didActivate()
           
protected  Object doGet(String name)
           
protected  void doInvalidate()
           
protected  Object doPutOrRemove(String name, Object value)
           
 long getAccessed()
           
 Object getAttribute(String name)
           
 Enumeration<String> getAttributeNames()
           
 int getAttributes()
           
 String getClusterId()
           
 long getCookieSetTime()
           
 long getCreationTime()
           
 String getId()
           
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
           
 Set<String> getNames()
           
 String getNodeId()
           
 int getRequests()
           
 ServletContext getServletContext()
           
 AbstractSession getSession()
           
 HttpSessionContext getSessionContext()
          Deprecated. 
 Object getValue(String name)
          Deprecated. As of Version 2.2, this method is replaced by getAttribute(java.lang.String)
 String[] getValueNames()
          Deprecated. As of Version 2.2, this method is replaced by getAttributeNames()
 void invalidate()
           
 boolean isIdChanged()
           
 boolean isNew()
           
 boolean isValid()
           
 void putValue(String name, Object value)
          Deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object)
 void removeAttribute(String name)
           
 void removeValue(String name)
          Deprecated. As of Version 2.2, this method is replaced by removeAttribute(java.lang.String)
 void setAttribute(String name, Object value)
           
 void setIdChanged(boolean changed)
           
 void setMaxInactiveInterval(int secs)
           
 void setRequests(int requests)
           
protected  void timeout()
           
 String toString()
           
 void unbindValue(String name, Object value)
          If value implements HttpSessionBindingListener, call valueUnbound()
 void willPassivate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_jdbcAttributes

protected final Map<String,Object> _jdbcAttributes
Constructor Detail

AbstractSession

protected AbstractSession(AbstractSessionManager abstractSessionManager,
                          HttpServletRequest request)

AbstractSession

protected AbstractSession(AbstractSessionManager abstractSessionManager,
                          long created,
                          long accessed,
                          String clusterId)
Method Detail

checkValid

protected void checkValid()
                   throws IllegalStateException
asserts that the session is valid

Throws:
IllegalStateException

getSession

public AbstractSession getSession()
Specified by:
getSession in interface AbstractSessionManager.SessionIf

getAccessed

public long getAccessed()

getAttribute

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

getAttributes

public int getAttributes()

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface HttpSession

getNames

public Set<String> getNames()

getCookieSetTime

public long getCookieSetTime()

getCreationTime

public long getCreationTime()
                     throws IllegalStateException
Specified by:
getCreationTime in interface HttpSession
Throws:
IllegalStateException

getId

public String getId()
             throws IllegalStateException
Specified by:
getId in interface HttpSession
Throws:
IllegalStateException

getNodeId

public String getNodeId()

getClusterId

public String getClusterId()

getLastAccessedTime

public long getLastAccessedTime()
                         throws IllegalStateException
Specified by:
getLastAccessedTime in interface HttpSession
Throws:
IllegalStateException

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface HttpSession

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface HttpSession

getSessionContext

@Deprecated
public HttpSessionContext getSessionContext()
                                     throws IllegalStateException
Deprecated. 

Specified by:
getSessionContext in interface HttpSession
Throws:
IllegalStateException

getValue

@Deprecated
public Object getValue(String name)
                throws IllegalStateException
Deprecated. As of Version 2.2, this method is replaced by getAttribute(java.lang.String)

Specified by:
getValue in interface HttpSession
Throws:
IllegalStateException

getValueNames

@Deprecated
public String[] getValueNames()
                       throws IllegalStateException
Deprecated. As of Version 2.2, this method is replaced by getAttributeNames()

Specified by:
getValueNames in interface HttpSession
Throws:
IllegalStateException

access

protected boolean access(long time)

complete

protected void complete()

timeout

protected void timeout()
                throws IllegalStateException
Throws:
IllegalStateException

invalidate

public void invalidate()
                throws IllegalStateException
Specified by:
invalidate in interface HttpSession
Throws:
IllegalStateException

doInvalidate

protected void doInvalidate()
                     throws IllegalStateException
Throws:
IllegalStateException

clearAttributes

public void clearAttributes()

isIdChanged

public boolean isIdChanged()

isNew

public boolean isNew()
              throws IllegalStateException
Specified by:
isNew in interface HttpSession
Throws:
IllegalStateException

putValue

@Deprecated
public void putValue(String name,
                                Object value)
              throws IllegalStateException
Deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object)

Specified by:
putValue in interface HttpSession
Throws:
IllegalStateException

removeAttribute

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

removeValue

@Deprecated
public void removeValue(String name)
                 throws IllegalStateException
Deprecated. As of Version 2.2, this method is replaced by removeAttribute(java.lang.String)

Specified by:
removeValue in interface HttpSession
Throws:
IllegalStateException

doPutOrRemove

protected Object doPutOrRemove(String name,
                               Object value)

doGet

protected Object doGet(String name)

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface HttpSession

setIdChanged

public void setIdChanged(boolean changed)

setMaxInactiveInterval

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

toString

public String toString()
Overrides:
toString in class Object

bindValue

public void bindValue(String name,
                      Object value)
If value implements HttpSessionBindingListener, call valueBound()


isValid

public boolean isValid()

cookieSet

protected void cookieSet()

getRequests

public int getRequests()

setRequests

public void setRequests(int requests)

unbindValue

public void unbindValue(String name,
                        Object value)
If value implements HttpSessionBindingListener, call valueUnbound()


willPassivate

public void willPassivate()

didActivate

public void didActivate()


Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.