Package org.codice.ddf.security.session
Class AttributeSharingHashSessionIdManager
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.session.DefaultSessionIdManager
org.codice.ddf.security.session.AttributeSharingHashSessionIdManager
- All Implemented Interfaces:
org.eclipse.jetty.server.SessionIdManager,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 AttributeSharingHashSessionIdManager
extends org.eclipse.jetty.server.session.DefaultSessionIdManager
Custom implementation of the
SessionIdManager that holds the
latest session attributes for all sessions in the Jetty server. This allows AttributeSharingSessionDataStore instances to retrieve these session attributes when a new
session is being created in their context for a session that exists in another context.
Note: Needed to hook into Jetty with a SessionIdManager because it's the only way
to be notified when a session is invalidated across all contexts. Note: This extends Jetty's impl
instead of the abstract class because of a hack in pax-web.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested 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.DefaultSessionIdManager
__NEW_SESSION_ID, _houseKeeper, _ownHouseKeeper, _random, _reseed, _server, _weakRandom, _workerAttr, _workerName, COUNTERFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionAttributeSharingHashSessionIdManager(org.eclipse.jetty.server.Server server) AttributeSharingHashSessionIdManager(org.eclipse.jetty.server.Server server, Random random) AttributeSharingHashSessionIdManager(org.eclipse.jetty.server.Server server, org.osgi.framework.BundleContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoStart()protected voiddoStop()voidvoidinvalidateAll(String id) protected voidprovideNewSessionAttributes(AttributeSharingSessionDataStore callingDataStore, String id, org.eclipse.jetty.server.session.SessionData sessionData) Called byAttributeSharingSessionDataStorewhen it's storing a session's attributes.Methods inherited from class org.eclipse.jetty.server.session.DefaultSessionIdManager
getExtendedId, getId, getRandom, getReseed, getServer, getSessionHandlers, getSessionHouseKeeper, getWorkerName, initRandom, isIdInUse, newSessionId, newSessionId, renewSessionId, setRandom, setReseed, setServer, setSessionHouseKeeper, setWorkerName, toStringMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Constructor Details
-
AttributeSharingHashSessionIdManager
public AttributeSharingHashSessionIdManager(org.eclipse.jetty.server.Server server, org.osgi.framework.BundleContext context) -
AttributeSharingHashSessionIdManager
public AttributeSharingHashSessionIdManager(org.eclipse.jetty.server.Server server) -
AttributeSharingHashSessionIdManager
-
-
Method Details
-
doStart
- Overrides:
doStartin classorg.eclipse.jetty.server.session.DefaultSessionIdManager- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.server.session.DefaultSessionIdManager- Throws:
Exception
-
invalidateAll
- Specified by:
invalidateAllin interfaceorg.eclipse.jetty.server.SessionIdManager- Overrides:
invalidateAllin classorg.eclipse.jetty.server.session.DefaultSessionIdManager- See Also:
-
SessionIdManager.invalidateAll(String)
-
expireAll
- Specified by:
expireAllin interfaceorg.eclipse.jetty.server.SessionIdManager- Overrides:
expireAllin classorg.eclipse.jetty.server.session.DefaultSessionIdManager- See Also:
-
SessionIdManager.expireAll(String)
-
addSessionDataStore
-
provideNewSessionAttributes
protected void provideNewSessionAttributes(AttributeSharingSessionDataStore callingDataStore, String id, org.eclipse.jetty.server.session.SessionData sessionData) Called byAttributeSharingSessionDataStorewhen it's storing a session's attributes. This method will determine if they're different from what's in the cache. If they are different, it will store it and notify allAttributeSharingSessionDataStoreinstances.- Parameters:
callingDataStore- the datastore providing the attributesid- the session idsessionData- the session attributes
-
sessionAttributes
-