org.eclipse.jetty.server.session

## Class AbstractSession

- java.lang.Object
- - org.eclipse.jetty.server.session.AbstractSession

- All Implemented Interfaces:
    javax.servlet.http.HttpSession, AbstractSessionManager.SessionIf
  Direct Known Subclasses:
    HashedSession, JDBCSessionManager.Session

      public abstract class AbstractSession
      extends Object
      implements AbstractSessionManager.SessionIf

  Implements `HttpSession` from the `javax.servlet` package.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractSession(AbstractSessionManager abstractSessionManager, javax.servlet.http.HttpServletRequest request)`
    `protected` | `AbstractSession(AbstractSessionManager abstractSessionManager, long created, long accessed, String clusterId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `access(long time)`
    `protected void` | `addAttributes(Map<String,Object> map)`
    `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)`
    `protected Map<String,Object>` | `getAttributeMap()`
    `Enumeration<String>` | `getAttributeNames()`
    `int` | `getAttributes()`
    `String` | `getClusterId()`
    `long` | `getCookieSetTime()`
    `long` | `getCreationTime()`
    `String` | `getId()`
    `long` | `getLastAccessedTime()`
    `int` | `getMaxInactiveInterval()`
    `Set<String>` | `getNames()`
    `String` | `getNodeId()`
    `int` | `getRequests()`
    `javax.servlet.ServletContext` | `getServletContext()`
    `AbstractSession` | `getSession()`
    `javax.servlet.http.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`

- - ### Constructor Detail

    - #### AbstractSession

          protected AbstractSession(AbstractSessionManager abstractSessionManager,
                         javax.servlet.http.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 `javax.servlet.http.HttpSession`

    - #### getAttributes

          public int getAttributes()

    - #### getAttributeNames

          public Enumeration<String> getAttributeNames()

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

    - #### getNames

          public Set<String> getNames()

    - #### getCookieSetTime

          public long getCookieSetTime()

    - #### getCreationTime

          public long getCreationTime()
                               throws IllegalStateException

      Specified by:
        `getCreationTime` in interface `javax.servlet.http.HttpSession`
      Throws:
        `IllegalStateException`

    - #### getId

          public String getId()
                       throws IllegalStateException

      Specified by:
        `getId` in interface `javax.servlet.http.HttpSession`
      Throws:
        `IllegalStateException`

    - #### getNodeId

          public String getNodeId()

    - #### getClusterId

          public String getClusterId()

    - #### getLastAccessedTime

          public long getLastAccessedTime()
                                   throws IllegalStateException

      Specified by:
        `getLastAccessedTime` in interface `javax.servlet.http.HttpSession`
      Throws:
        `IllegalStateException`

    - #### getMaxInactiveInterval

          public int getMaxInactiveInterval()

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

    - #### getServletContext

          public javax.servlet.ServletContext getServletContext()

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

    - #### getSessionContext

          @Deprecated
          public javax.servlet.http.HttpSessionContext getSessionContext()
                                                                  throws IllegalStateException

      Deprecated.
      Specified by:
        `getSessionContext` in interface `javax.servlet.http.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 `javax.servlet.http.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 `javax.servlet.http.HttpSession`
      Throws:
        `IllegalStateException`

    - #### getAttributeMap

          protected Map<String,Object> getAttributeMap()

    - #### addAttributes

          protected void addAttributes(Map<String,Object> map)

    - #### 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 `javax.servlet.http.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 `javax.servlet.http.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 `javax.servlet.http.HttpSession`
      Throws:
        `IllegalStateException`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `javax.servlet.http.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 `javax.servlet.http.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 `javax.servlet.http.HttpSession`

    - #### setIdChanged

          public void setIdChanged(boolean changed)

    - #### setMaxInactiveInterval

          public void setMaxInactiveInterval(int secs)

      Specified by:
        `setMaxInactiveInterval` in interface `javax.servlet.http.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.