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 java.lang.Object
      implements AbstractSessionManager.SessionIf

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,java.lang.Object>` | `_jdbcAttributes`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `access(long time)`
    `void` | `bindValue(java.lang.String name, java.lang.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 java.lang.Object` | `doGet(java.lang.String name)`
    `protected void` | `doInvalidate()`
    `protected java.lang.Object` | `doPutOrRemove(java.lang.String name, java.lang.Object value)`
    `long` | `getAccessed()`
    `java.lang.Object` | `getAttribute(java.lang.String name)`
    `java.util.Enumeration<java.lang.String>` | `getAttributeNames()`
    `int` | `getAttributes()`
    `java.lang.String` | `getClusterId()`
    `long` | `getCookieSetTime()`
    `long` | `getCreationTime()`
    `java.lang.String` | `getId()`
    `long` | `getLastAccessedTime()`
    `int` | `getMaxInactiveInterval()`
    `java.util.Set<java.lang.String>` | `getNames()`
    `java.lang.String` | `getNodeId()`
    `int` | `getRequests()`
    `javax.servlet.ServletContext` | `getServletContext()`
    `AbstractSession` | `getSession()`
    `javax.servlet.http.HttpSessionContext` | `getSessionContext()` Deprecated.
    `java.lang.Object` | `getValue(java.lang.String name)` Deprecated. As of Version 2.2, this method is replaced by `getAttribute(java.lang.String)`
    `java.lang.String[]` | `getValueNames()` Deprecated. As of Version 2.2, this method is replaced by `getAttributeNames()`
    `void` | `invalidate()`
    `boolean` | `isIdChanged()`
    `boolean` | `isNew()`
    `boolean` | `isValid()`
    `void` | `putValue(java.lang.String name, java.lang.Object value)` Deprecated. As of Version 2.2, this method is replaced by `setAttribute(java.lang.String, java.lang.Object)`
    `void` | `removeAttribute(java.lang.String name)`
    `void` | `removeValue(java.lang.String name)` Deprecated. As of Version 2.2, this method is replaced by `removeAttribute(java.lang.String)`
    `void` | `setAttribute(java.lang.String name, java.lang.Object value)`
    `void` | `setIdChanged(boolean changed)`
    `void` | `setMaxInactiveInterval(int secs)`
    `void` | `setRequests(int requests)`
    `protected void` | `timeout()`
    `java.lang.String` | `toString()`
    `void` | `unbindValue(java.lang.String name, java.lang.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 java.util.Map<java.lang.String,java.lang.Object> _jdbcAttributes

  - ### Constructor Detail

    - #### AbstractSession

          protected AbstractSession(AbstractSessionManager abstractSessionManager,
                         javax.servlet.http.HttpServletRequest request)

    - #### AbstractSession

          protected AbstractSession(AbstractSessionManager abstractSessionManager,
                         long created,
                         long accessed,
                         java.lang.String clusterId)

  - ### Method Detail

    - #### checkValid

          protected void checkValid()
                             throws java.lang.IllegalStateException

      asserts that the session is valid
      Throws:
        `java.lang.IllegalStateException`

    - #### getSession

          public AbstractSession getSession()

      Specified by:
        `getSession` in interface `AbstractSessionManager.SessionIf`

    - #### getAccessed

          public long getAccessed()

    - #### getAttribute

          public java.lang.Object getAttribute(java.lang.String name)

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

    - #### getAttributes

          public int getAttributes()

    - #### getAttributeNames

          public java.util.Enumeration<java.lang.String> getAttributeNames()

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

    - #### getNames

          public java.util.Set<java.lang.String> getNames()

    - #### getCookieSetTime

          public long getCookieSetTime()

    - #### getCreationTime

          public long getCreationTime()
                               throws java.lang.IllegalStateException

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

    - #### getId

          public java.lang.String getId()
                                 throws java.lang.IllegalStateException

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

    - #### getNodeId

          public java.lang.String getNodeId()

    - #### getClusterId

          public java.lang.String getClusterId()

    - #### getLastAccessedTime

          public long getLastAccessedTime()
                                   throws java.lang.IllegalStateException

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

      Deprecated.
      Specified by:
        `getSessionContext` in interface `javax.servlet.http.HttpSession`
      Throws:
        `java.lang.IllegalStateException`

    - #### getValue

          @Deprecated
          public java.lang.Object getValue(java.lang.String name)
                                    throws java.lang.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:
        `java.lang.IllegalStateException`

    - #### getValueNames

          @Deprecated
          public java.lang.String[] getValueNames()
                                           throws java.lang.IllegalStateException

      Deprecated. As of Version 2.2, this method is replaced by `getAttributeNames()`
      Specified by:
        `getValueNames` in interface `javax.servlet.http.HttpSession`
      Throws:
        `java.lang.IllegalStateException`

    - #### access

          protected boolean access(long time)

    - #### complete

          protected void complete()

    - #### timeout

          protected void timeout()
                          throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`

    - #### invalidate

          public void invalidate()
                          throws java.lang.IllegalStateException

      Specified by:
        `invalidate` in interface `javax.servlet.http.HttpSession`
      Throws:
        `java.lang.IllegalStateException`

    - #### doInvalidate

          protected void doInvalidate()
                               throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`

    - #### clearAttributes

          public void clearAttributes()

    - #### isIdChanged

          public boolean isIdChanged()

    - #### isNew

          public boolean isNew()
                        throws java.lang.IllegalStateException

      Specified by:
        `isNew` in interface `javax.servlet.http.HttpSession`
      Throws:
        `java.lang.IllegalStateException`

    - #### putValue

          @Deprecated
          public void putValue(java.lang.String name,
                                 java.lang.Object value)
                        throws java.lang.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:
        `java.lang.IllegalStateException`

    - #### removeAttribute

          public void removeAttribute(java.lang.String name)

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

    - #### removeValue

          @Deprecated
          public void removeValue(java.lang.String name)
                           throws java.lang.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:
        `java.lang.IllegalStateException`

    - #### doPutOrRemove

          protected java.lang.Object doPutOrRemove(java.lang.String name,
                                       java.lang.Object value)

    - #### doGet

          protected java.lang.Object doGet(java.lang.String name)

    - #### setAttribute

          public void setAttribute(java.lang.String name,
                          java.lang.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 java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### bindValue

          public void bindValue(java.lang.String name,
                       java.lang.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(java.lang.String name,
                         java.lang.Object value)

      If value implements HttpSessionBindingListener, call valueUnbound()

    - #### willPassivate

          public void willPassivate()

    - #### didActivate

          public void didActivate()

Copyright © 2013 FuseSource, Corp.. All Rights Reserved.