@ManagedObject public class FileSessionDataStore extends AbstractSessionDataStore
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Constructor and Description |
|---|
FileSessionDataStore() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String id)
Delete a session
|
boolean |
deleteFile(String filename)
Delete the file associated with a session
|
Set<String> |
doGetExpired(Set<String> candidates)
Check to see which sessions have expired.
|
SessionData |
doLoad(String id)
Load the session from persistent store.
|
void |
doStore(String id,
SessionData data,
long lastSaveTime)
Store the session data persistently.
|
boolean |
exists(String id)
Test if data exists for a given session id.
|
File |
getStoreDir() |
void |
initialize(SessionContext context)
Initialize this data map for the
given context.
|
void |
initializeStore()
Read the names of the existing session files and build a map of
fully qualified session ids (ie with context) to filename.
|
boolean |
isDeleteUnrestorableFiles() |
boolean |
isPassivating()
True if this type of datastore will passivate session objects
|
void |
setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles) |
void |
setStoreDir(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,
Path p)
Check to see if the expiry on the file is very old, and
delete the file if so.
|
String |
toString() |
getExpired, getGracePeriodSec, getSavePeriodSec, load, newSessionData, setGracePeriodSec, setSavePeriodSec, storeaddBean, 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, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopdumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic void initialize(SessionContext context) throws Exception
SessionDataMapinitialize in interface SessionDataMapinitialize in class AbstractSessionDataStorecontext - context associatedException - if unable to initialize the@ManagedAttribute(value="dir where sessions are stored", readonly=true) public File getStoreDir()
public void setStoreDir(File storeDir)
public boolean isDeleteUnrestorableFiles()
public void setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles)
public boolean delete(String id) throws Exception
id - session idException - if unable to delete session datapublic boolean deleteFile(String filename) throws Exception
filename - name of the file containing the session's informationException - indicating delete failurepublic Set<String> doGetExpired(Set<String> candidates)
doGetExpired in class AbstractSessionDataStorecandidates - the set of session ids that the SessionCache believes
have expiredpublic void sweepDisk()
public void sweepFile(long now,
Path p)
throws Exception
now - the time now in msecp - the file to checkException - indicating error in sweeppublic SessionData doLoad(String id) throws Exception
AbstractSessionDataStoredoLoad in class AbstractSessionDataStoreid - the id of the session to loadException - if unable to load the sessionpublic void doStore(String id, SessionData data, long lastSaveTime) throws Exception
AbstractSessionDataStoredoStore in class AbstractSessionDataStoreid - identity of session to storedata - info of the sessionlastSaveTime - time of previous save or 0 if never savedException - if unable to store datapublic void initializeStore()
throws Exception
Exception - if storeDir doesn't exist, isn't readable/writeable
or contains 2 files with the same lastmodify time for the same session. Throws IOException
if the lastmodifytimes can't be read.@ManagedAttribute(value="are sessions serialized by this store", readonly=true) public boolean isPassivating()
SessionDataStorepublic boolean exists(String id) throws Exception
SessionDataStoreid - Identity of session whose existence should be checkedException - if problem checking existence with persistence layerpublic String toString()
toString in class AbstractSessionDataStoreCopyright © 2010 - 2020 Adobe. All Rights Reserved