Package org.eclipse.jetty.server.session
Class AbstractSessionDataStore
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.session.AbstractSessionDataStore
- All Implemented Interfaces:
SessionDataMap
,SessionDataStore
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
FileSessionDataStore
,JDBCSessionDataStore
,NullSessionDataStore
@ManagedObject
@Deprecated(since="2021-05-27")
public abstract class AbstractSessionDataStore
extends ContainerLifeCycle
implements SessionDataStore
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
AbstractSessionDataStore
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoGetExpired
(Set<String> candidates) Deprecated.Implemented by subclasses to resolve which sessions this node should attempt to expire.abstract SessionData
Deprecated.Load the session from persistent store.abstract void
doStore
(String id, SessionData data, long lastSaveTime) Deprecated.Store the session data persistently.getExpired
(Set<String> candidates) Deprecated.Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time.int
Deprecated.int
Deprecated.void
initialize
(SessionContext context) Deprecated.Initialize this data map for the given context.Deprecated.Read in session data.newSessionData
(String id, long created, long accessed, long lastAccessed, long maxInactiveMs) Deprecated.Create a new SessionDatavoid
setGracePeriodSec
(int sec) Deprecated.void
setSavePeriodSec
(int savePeriodSec) Deprecated.The minimum time in seconds between save operations.void
store
(String id, SessionData data) Deprecated.Store the session data.toString()
Deprecated.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, 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
equals, 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
Methods inherited from interface org.eclipse.jetty.server.session.SessionDataMap
delete
Methods inherited from interface org.eclipse.jetty.server.session.SessionDataStore
exists, isPassivating
-
Constructor Details
-
AbstractSessionDataStore
public AbstractSessionDataStore()Deprecated.
-
-
Method Details
-
doStore
Deprecated.Store the session data persistently.- Parameters:
id
- identity of session to storedata
- info of the sessionlastSaveTime
- time of previous save or 0 if never saved- Throws:
Exception
- if unable to store data
-
doLoad
Deprecated.Load the session from persistent store.- Parameters:
id
- the id of the session to load- Returns:
- the re-inflated session
- Throws:
Exception
- if unable to load the session
-
doGetExpired
Deprecated.Implemented by subclasses to resolve which sessions this node should attempt to expire.- Parameters:
candidates
- the ids of sessions the SessionDataStore thinks has expired- Returns:
- the reconciled set of session ids that this node should attempt to expire
-
initialize
Deprecated.Description copied from interface:SessionDataMap
Initialize this data map for the given context. A SessionDataMap can only be used by one context(/session manager).- Specified by:
initialize
in interfaceSessionDataMap
- Parameters:
context
- context associated- Throws:
Exception
- if unable to initialize the
-
load
Deprecated.Description copied from interface:SessionDataMap
Read in session data.- Specified by:
load
in interfaceSessionDataMap
- Parameters:
id
- identity of session to load- Returns:
- the SessionData matching the id
- Throws:
Exception
- if unable to load session data
-
store
Deprecated.Description copied from interface:SessionDataMap
Store the session data.- Specified by:
store
in interfaceSessionDataMap
- Parameters:
id
- identity of session to storedata
- info of session to store- Throws:
Exception
- if unable to write session data
-
getExpired
Deprecated.Description copied from interface:SessionDataStore
Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time.- Specified by:
getExpired
in interfaceSessionDataStore
- Parameters:
candidates
- if provided, these are keys of sessions that the SessionDataStore thinks has expired and should be verified by the SessionDataStore- Returns:
- set of session ids
-
newSessionData
public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs) Deprecated.Description copied from interface:SessionDataStore
Create a new SessionData- Specified by:
newSessionData
in interfaceSessionDataStore
- Parameters:
id
- the idcreated
- the timestamp when createdaccessed
- the timestamp when accessedlastAccessed
- the timestamp when last accessedmaxInactiveMs
- the max inactive time in milliseconds- Returns:
- a new SessionData object
-
getGracePeriodSec
@ManagedAttribute(value="interval in secs to prevent too eager session scavenging", readonly=true) public int getGracePeriodSec()Deprecated. -
setGracePeriodSec
public void setGracePeriodSec(int sec) Deprecated. -
getSavePeriodSec
Deprecated.- Returns:
- the savePeriodSec
-
setSavePeriodSec
public void setSavePeriodSec(int savePeriodSec) Deprecated.The minimum time in seconds between save operations. Saves normally occur every time the last request exits as session. If nothing changes on the session except for the access time and the persistence technology is slow, this can cause delays.By default the value is 0, which means we save after the last request exists. A non zero value means that we will skip doing the save if the session isn't dirty if the elapsed time since the session was last saved does not exceed this value.
- Parameters:
savePeriodSec
- the savePeriodSec to set
-
toString
Deprecated.- Overrides:
toString
in classAbstractLifeCycle
-