Class AttributeSharingSessionDataStore

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.session.AbstractSessionDataStore
org.codice.ddf.security.session.AttributeSharingSessionDataStore
All Implemented Interfaces:
org.eclipse.jetty.server.session.SessionDataMap, org.eclipse.jetty.server.session.SessionDataStore, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

public class AttributeSharingSessionDataStore extends org.eclipse.jetty.server.session.AbstractSessionDataStore
This implementation of SessionDataStore communicates with the AttributeSharingHashSessionIdManager to retrieve the most up-to-date session attributes.

There is one SessionDataStore instance for each HTTP context on the Jetty server. In the current way we use pax-web with our jax-rs servers, session attributes are not shared across contexts. Our SSO solution necessitates a way to share those session attributes since the security token is stored on the session as an attribute.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.server.session.AbstractSessionDataStore

    _context, _gracePeriodSec, _lastExpiryCheckTime, _savePeriodSec

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    doGetExpired(Set<String> candidates)
     
    org.eclipse.jetty.server.session.SessionData
     
    void
    doStore(String id, org.eclipse.jetty.server.session.SessionData data, long lastSaveTime)
     
     
    boolean
     
    Map<String,org.eclipse.jetty.server.session.SessionData>
     
    void
    initialize(org.eclipse.jetty.server.session.SessionContext context)
     
    boolean
     
    org.eclipse.jetty.server.session.SessionData
     
    org.eclipse.jetty.server.session.SessionData
    newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs)
     
    void
    updateSessionAttributes(String id, org.eclipse.jetty.server.session.SessionData updatedSessionData)
    Called by the AttributeSharingHashSessionIdManager whenever it updates one of its session's attributes.

    Methods inherited from class org.eclipse.jetty.server.session.AbstractSessionDataStore

    checkStarted, doStart, getExpired, getGracePeriodSec, getSavePeriodSec, setGracePeriodSec, setSavePeriodSec, store, toString

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
  • Constructor Details

    • AttributeSharingSessionDataStore

      public AttributeSharingSessionDataStore()
  • Method Details

    • updateSessionAttributes

      public void updateSessionAttributes(String id, org.eclipse.jetty.server.session.SessionData updatedSessionData)
      Called by the AttributeSharingHashSessionIdManager whenever it updates one of its session's attributes.
      Parameters:
      id - the session id
      updatedSessionData - the session's attributes
    • getSessionDataMap

      public Map<String,org.eclipse.jetty.server.session.SessionData> getSessionDataMap()
    • initialize

      public void initialize(org.eclipse.jetty.server.session.SessionContext context) throws Exception
      Specified by:
      initialize in interface org.eclipse.jetty.server.session.SessionDataMap
      Overrides:
      initialize in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • doStore

      public void doStore(String id, org.eclipse.jetty.server.session.SessionData data, long lastSaveTime)
      Specified by:
      doStore in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • newSessionData

      public org.eclipse.jetty.server.session.SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs)
      Specified by:
      newSessionData in interface org.eclipse.jetty.server.session.SessionDataStore
      Overrides:
      newSessionData in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • doGetExpired

      public Set<String> doGetExpired(Set<String> candidates)
      Specified by:
      doGetExpired in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • isPassivating

      public boolean isPassivating()
    • exists

      public boolean exists(String id)
    • load

      public org.eclipse.jetty.server.session.SessionData load(String id)
      Specified by:
      load in interface org.eclipse.jetty.server.session.SessionDataMap
      Overrides:
      load in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • delete

      public boolean delete(String id)
    • doLoad

      public org.eclipse.jetty.server.session.SessionData doLoad(String id) throws Exception
      Specified by:
      doLoad in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • dumpSelf

      public String dumpSelf()