@ManagedObject public abstract class AbstractSessionDataStore extends ContainerLifeCycle implements SessionDataStore
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Constructor and Description |
|---|
AbstractSessionDataStore() |
| Modifier and Type | Method and Description |
|---|---|
abstract Set<String> |
doGetExpired(Set<String> candidates)
Implemented by subclasses to resolve which sessions this node
should attempt to expire.
|
abstract SessionData |
doLoad(String id)
Load the session from persistent store.
|
abstract void |
doStore(String id,
SessionData data,
long lastSaveTime)
Store the session data persistently.
|
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.
|
int |
getGracePeriodSec() |
int |
getSavePeriodSec() |
void |
initialize(SessionContext context)
Initialize this data map for the
given context.
|
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 |
setGracePeriodSec(int sec) |
void |
setSavePeriodSec(int savePeriodSec)
The minimum time in seconds between save operations.
|
void |
store(String id,
SessionData data)
Store the session data.
|
String |
toString() |
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, stopequals, getClass, hashCode, notify, notifyAll, wait, wait, waitexists, isPassivatingdeleteaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopdumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic abstract void doStore(String id, SessionData data, long lastSaveTime) throws Exception
id - identity of session to storedata - info of the sessionlastSaveTime - time of previous save or 0 if never savedException - if unable to store datapublic abstract SessionData doLoad(String id) throws Exception
id - the id of the session to loadException - if unable to load the sessionpublic abstract Set<String> doGetExpired(Set<String> candidates)
candidates - the ids of sessions the SessionDataStore thinks has expiredpublic void initialize(SessionContext context) throws Exception
SessionDataMapinitialize in interface SessionDataMapcontext - context associatedException - if unable to initialize thepublic SessionData load(String id) throws Exception
SessionDataMapload in interface SessionDataMapid - identity of session to loadException - if unable to load session datapublic 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 datapublic 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
SessionDataStorepublic 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 milliseconds@ManagedAttribute(value="interval in secs to prevent too eager session scavenging", readonly=true) public int getGracePeriodSec()
public void setGracePeriodSec(int sec)
@ManagedAttribute(value="min secs between saves", readonly=true) public int getSavePeriodSec()
public void setSavePeriodSec(int savePeriodSec)
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.
savePeriodSec - the savePeriodSec to setpublic String toString()
toString in class AbstractLifeCycleCopyright © 2010 - 2020 Adobe. All Rights Reserved