Component, SessionDataStorepublic class FileSessionDataStore extends AbstractSessionDataStore
gracePeriodSec, lastExpiryCheckTime, savePeriodSec| Constructor | Description |
|---|---|
FileSessionDataStore() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
delete(java.lang.String id) |
Delete session data.
|
protected void |
doDestroy() |
|
java.util.Set<java.lang.String> |
doGetExpired(java.util.Set<java.lang.String> candidates) |
Check to see which sessions have expired.
|
protected void |
doInitialize() |
|
void |
doStore(java.lang.String id,
SessionData data,
long lastSaveTime) |
Store the session data persistently.
|
boolean |
exists(java.lang.String id) |
Test if data exists for a given session id.
|
java.io.File |
getStoreDir() |
|
boolean |
isDeleteUnrestorableFiles() |
|
boolean |
isPassivating() |
True if this type of datastore will passivate session objects.
|
SessionData |
load(java.lang.String id) |
Read in session data.
|
void |
setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles) |
|
void |
setStoreDir(java.io.File storeDir) |
|
void |
sweepDisk() |
Check all session files that do not belong to this context and
remove any that expired long ago (ie at least 5 gracePeriods ago).
|
void |
sweepFile(long now,
java.nio.file.Path p) |
Check to see if the expiry on the file is very old, and
delete the file if so.
|
java.lang.String |
toString() |
destroy, getComponentName, initialize, isAvailable, isDestroyed, isInitializedcheckInitialized, getExpired, getGracePeriodSec, getSavePeriodSec, newSessionData, setGracePeriodSec, setSavePeriodSec, storedestroy, getComponentName, initialize, isAvailable, isDestroyed, isInitializedpublic java.io.File getStoreDir()
public void setStoreDir(java.io.File storeDir)
public boolean isDeleteUnrestorableFiles()
public void setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles)
public boolean delete(java.lang.String id)
throws java.lang.Exception
SessionDataStoreid - identity of session to deletejava.lang.Exception - if unable to delete session datapublic java.util.Set<java.lang.String> doGetExpired(java.util.Set<java.lang.String> candidates)
doGetExpired in class AbstractSessionDataStorecandidates - the set of session ids that the SessionCache believes
have expiredpublic SessionData load(java.lang.String id) throws java.lang.Exception
SessionDataStoreid - identity of session to loadjava.lang.Exception - if unable to load session datapublic void doStore(java.lang.String id,
SessionData data,
long lastSaveTime)
throws java.lang.Exception
AbstractSessionDataStoredoStore in class AbstractSessionDataStoreid - identity of session to storedata - info of the sessionlastSaveTime - time of previous save or 0 if never savedjava.lang.Exception - if unable to store datapublic boolean isPassivating()
SessionDataStorepublic boolean exists(java.lang.String id)
throws java.lang.Exception
SessionDataStoreid - Identity of session whose existence should be checkedjava.lang.Exception - if there is a problem checking the existence with persistence layerpublic void sweepDisk()
public void sweepFile(long now,
java.nio.file.Path p)
throws java.lang.Exception
now - the time now in msecp - the file to checkjava.lang.Exception - indicating error in sweepprotected void doInitialize()
throws java.lang.Exception
doInitialize in class AbstractSessionDataStorejava.lang.Exceptionprotected void doDestroy()
doDestroy in class AbstractSessionDataStorepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2018 The Aspectran Project. All rights reserved.