| Modifier and Type | Field and Description |
|---|---|
| protected SessionContext | |
| protected int | |
| protected long | |
| protected long | |
| protected int | |
| public static final int | |
| public static final int | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | cleanOrphans(long
the time before which the sessions must have expired. timeLimit)Remove all sessions for any context that expired at or before the given time. |
| public abstract Set | Returns: the reconciled set of session ids that have been checked in the storethe ids of sessions the SessionCache thinks has expired candidates, long the time at which to check for expiry time)Implemented by subclasses to resolve which sessions in this context that are being managed by this node that should be expired. |
| public abstract void | doCleanOrphans(long
the upper limit of the expiry time to check in msec time)Implemented by subclasses to delete sessions for other contexts that expired at or before the timeLimit. |
| public abstract boolean | |
| public abstract Set | Returns: the empty set if there are no sessions expired as at the time, or otherwise a set of session ids.the upper limit of expiry times to check. Sessions expired
at or before this timestamp will match. before)Implemented by subclasses to find sessions for this context in the store that expired at or before the time limit and thus not being actively managed by any node. |
| public abstract SessionData | |
| protected void | doStart()
Overrides org. Starts the managed lifecycle beans in the order they were added. |
| public abstract void | doStore(String
identity of session to store id, SessionData info of the session data, long time of previous save or 0 if never saved lastSaveTime)Store the session data persistently. |
| public boolean | exists(String
Identity of session whose existence should be checked id)Implements org. Test if data exists for a given session id. |
| public Set | getExpired(Set<String>
if provided, these are keys of sessions that
the SessionDataStore thinks has expired and should be verified by the
SessionDataStore candidates)Implements org. Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time. |
| public int | |
| public int | |
| public void | initialize(SessionContext
context associated context)Implements org. Initialize this data map for the given context. |
| public SessionData | load(String
identity of session to load id)Implements org. Read in session data. |
| public SessionData | newSessionData(String
the id id, long the timestamp when created created, long the timestamp when accessed accessed, long the timestamp when last accessed lastAccessed, long the max inactive time in milliseconds maxInactiveMs)Implements org. Create a new SessionData |
| public void | |
| public void | setSavePeriodSec(int
the savePeriodSec to set savePeriodSec)The minimum time in seconds between save operations. |
| public void | store(String
identity of session to store id, SessionData info of session to store data)Implements org. Store the session data. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| _context | back to summary |
|---|---|
| protected SessionContext _context | |
| _gracePeriodSec | back to summary |
|---|---|
| protected int _gracePeriodSec | |
| _lastExpiryCheckTime | back to summary |
|---|---|
| protected long _lastExpiryCheckTime | |
| _lastOrphanSweepTime | back to summary |
|---|---|
| protected long _lastOrphanSweepTime | |
| _savePeriodSec | back to summary |
|---|---|
| protected int _savePeriodSec | |
| DEFAULT_GRACE_PERIOD_SEC | back to summary |
|---|---|
| public static final int DEFAULT_GRACE_PERIOD_SEC | |
| DEFAULT_SAVE_PERIOD_SEC | back to summary |
|---|---|
| public static final int DEFAULT_SAVE_PERIOD_SEC | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| AbstractSessionDataStore | back to summary |
|---|---|
| public AbstractSessionDataStore() | |
| checkStarted | back to summary |
|---|---|
| protected void checkStarted() throws IllegalStateException | |
| cleanOrphans | back to summary |
|---|---|
| public void cleanOrphans(long timeLimit) Remove all sessions for any context that expired at or before the given time.
| |
| doCheckExpired | back to summary |
|---|---|
| public abstract Set Implemented by subclasses to resolve which sessions in this context that are being managed by this node that should be expired. | |
| doCleanOrphans | back to summary |
|---|---|
| public abstract void doCleanOrphans(long time) Implemented by subclasses to delete sessions for other contexts that expired at or before the timeLimit. These are 'orphaned' sessions that are no longer being actively managed by any node. These are explicitly sessions that do NOT belong to this context (other mechanisms such as doGetExpired take care of those). As they don't belong to this context, they cannot be loaded by us. This is called only periodically to avoid placing excessive load on the store.
| |
| doExists | back to summary |
|---|---|
| public abstract boolean doExists(String id) throws Exception Check if a session for the given id exists.
| |
| doGetExpired | back to summary |
|---|---|
| public abstract Set Implemented by subclasses to find sessions for this context in the store that expired at or before the time limit and thus not being actively managed by any node. This method is only called periodically (the period is configurable) to avoid putting too much load on the store. | |
| doLoad | back to summary |
|---|---|
| public abstract SessionData doLoad(String id) throws Exception Load the session from persistent store.
| |
| doStart | back to summary |
|---|---|
| protected void doStart() throws Exception Overrides org. Doc from org. Starts the managed lifecycle beans in the order they were added.
| |
| doStore | back to summary |
|---|---|
| public abstract void doStore(String id, SessionData data, long lastSaveTime) throws Exception Store the session data persistently.
| |
| exists | back to summary |
|---|---|
| public boolean exists(String id) throws Exception Implements org. Doc from org. Test if data exists for a given session id. | |
| getExpired | back to summary |
|---|---|
| public Set Implements org. Doc from org. Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time. | |
| getGracePeriodSec | back to summary |
|---|---|
public int getGracePeriodSec()
| |
| getSavePeriodSec | back to summary |
|---|---|
public int getSavePeriodSec()
| |
| initialize | back to summary |
|---|---|
| public void initialize(SessionContext context) throws Exception Implements org. Doc from org. Initialize this data map for the given context. A SessionDataMap can only be used by one context(/session manager).
| |
| load | back to summary |
|---|---|
| public SessionData load(String id) throws Exception Implements org. Doc from org. Read in session data.
| |
| newSessionData | back to summary |
|---|---|
| public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs) Implements org. Doc from org. Create a new SessionData
| |
| setGracePeriodSec | back to summary |
|---|---|
| public void setGracePeriodSec(int sec) | |
| setSavePeriodSec | back to summary |
|---|---|
| public void setSavePeriodSec(int savePeriodSec) 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.
| |
| store | back to summary |
|---|---|
| public void store(String id, SessionData data) throws Exception Implements org. Doc from org. Store the session data.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |