public class CachingSessionDataStore extends ContainerLifeCycle implements SessionDataStore
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Constructor and Description |
|---|
CachingSessionDataStore(SessionDataMap cache,
SessionDataStore store) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String id)
Delete session data
|
boolean |
exists(String id)
Test if data exists for a given session id.
|
Set<String> |
getExpired(Set<String> candidates)
Called periodically, this method should search the data store
for sessions that have been expired for a 'reasonable' amount
of time.
|
SessionDataMap |
getSessionDataMap() |
SessionDataStore |
getSessionStore() |
void |
initialize(SessionContext context)
Initialize this data map for the
given context.
|
boolean |
isPassivating()
True if this type of datastore will passivate session objects
|
SessionData |
load(String id)
Read in session data.
|
SessionData |
newSessionData(String id,
long created,
long accessed,
long lastAccessed,
long maxInactiveMs)
Create a new SessionData
|
void |
store(String id,
SessionData data)
Store the session data.
|
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, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopdumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic CachingSessionDataStore(SessionDataMap cache, SessionDataStore store)
cache - the front cache to usestore - the actual store for the the session datapublic SessionDataStore getSessionStore()
public SessionDataMap getSessionDataMap()
public SessionData load(String id) throws Exception
SessionDataMapload in interface SessionDataMapid - identity of session to loadException - if unable to load session dataSessionDataMap.load(java.lang.String)public boolean delete(String id) throws Exception
SessionDataMapdelete in interface SessionDataMapid - identity of session to deleteException - if unable to delete session dataSessionDataMap.delete(java.lang.String)public Set<String> getExpired(Set<String> candidates)
SessionDataStoregetExpired in interface SessionDataStorecandidates - if provided, these are keys of sessions that
the SessionDataStore thinks has expired and should be verified by the
SessionDataStoreSessionDataStore.getExpired(Set)public void store(String id, SessionData data) throws Exception
SessionDataMapstore in interface SessionDataMapid - identity of session to storedata - info of session to storeException - if unable to write session dataSessionDataMap.store(java.lang.String, org.eclipse.jetty.server.session.SessionData)public boolean isPassivating()
SessionDataStoreisPassivating in interface SessionDataStoreSessionDataStore.isPassivating()public boolean exists(String id) throws Exception
SessionDataStoreexists in interface SessionDataStoreid - Identity of session whose existence should be checkedException - if problem checking existence with persistence layerSessionDataStore.exists(java.lang.String)public void initialize(SessionContext context) throws Exception
SessionDataMapinitialize in interface SessionDataMapcontext - context associatedException - if unable to initialize theSessionDataMap.initialize(org.eclipse.jetty.server.session.SessionContext)public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs)
SessionDataStorenewSessionData in interface SessionDataStoreid - the idcreated - the timestamp when createdaccessed - the timestamp when accessedlastAccessed - the timestamp when last accessedmaxInactiveMs - the max inactive time in millisecondsSessionDataStore.newSessionData(java.lang.String, long, long, long, long)Copyright © 2010 - 2020 Adobe. All Rights Reserved