Class FileSessionStore
- java.lang.Object
-
- com.aspectran.core.component.AbstractComponent
-
- com.aspectran.core.component.session.AbstractSessionStore
-
- com.aspectran.core.component.session.FileSessionStore
-
- All Implemented Interfaces:
Component,SessionStore
public class FileSessionStore extends AbstractSessionStore
A file-based store of session data.
-
-
Constructor Summary
Constructors Constructor Description FileSessionStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(java.lang.String id)Delete session data.protected voiddoDestroy()java.util.Set<java.lang.String>doGetExpired(java.util.Set<java.lang.String> candidates)Check to see which sessions have expired.protected voiddoInitialize()voiddoSave(java.lang.String id, SessionData data, long lastSaveTime)Store the session data persistently.booleanexists(java.lang.String id)Test if data exists for a given session id.java.io.FilegetStoreDir()booleanisDeleteUnrestorableFiles()SessionDataload(java.lang.String id)Read in session data.voidsetDeleteUnrestorableFiles(boolean deleteUnrestorableFiles)voidsetStoreDir(java.io.File storeDir)java.lang.StringtoString()-
Methods inherited from class com.aspectran.core.component.session.AbstractSessionStore
checkAlreadyInitialized, getExpired, getGracePeriodSecs, getLastExpiryCheckTime, getNonPersistentAttributes, getSavePeriodSecs, isNonPersistentAttributes, save, setGracePeriodSecs, setNonPersistentAttributes, setSavePeriodSecs
-
Methods inherited from class com.aspectran.core.component.AbstractComponent
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.aspectran.core.component.Component
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
-
-
-
Method Detail
-
getStoreDir
public java.io.File getStoreDir()
-
setStoreDir
public void setStoreDir(java.io.File storeDir)
-
isDeleteUnrestorableFiles
public boolean isDeleteUnrestorableFiles()
-
setDeleteUnrestorableFiles
public void setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles)
-
load
public SessionData load(java.lang.String id) throws java.lang.Exception
Description copied from interface:SessionStoreRead in session data.- Parameters:
id- identity of session to load- Returns:
- the SessionData matching the id
- Throws:
java.lang.Exception- if unable to load session data
-
delete
public boolean delete(java.lang.String id) throws java.lang.ExceptionDescription copied from interface:SessionStoreDelete session data.- Parameters:
id- identity of session to delete- Returns:
- true if the session was deleted
- Throws:
java.lang.Exception- if unable to delete session data
-
exists
public boolean exists(java.lang.String id)
Description copied from interface:SessionStoreTest if data exists for a given session id.- Parameters:
id- Identity of session whose existence should be checked- Returns:
- true if valid, non-expired session exists
-
doSave
public void doSave(java.lang.String id, SessionData data, long lastSaveTime) throws java.lang.ExceptionDescription copied from class:AbstractSessionStoreStore the session data persistently.- Specified by:
doSavein classAbstractSessionStore- Parameters:
id- identity of session to storedata- info of the sessionlastSaveTime- time of previous save or 0 if never saved- Throws:
java.lang.Exception- if unable to store data
-
doGetExpired
public java.util.Set<java.lang.String> doGetExpired(java.util.Set<java.lang.String> candidates)
Check to see which sessions have expired.- Specified by:
doGetExpiredin classAbstractSessionStore- Parameters:
candidates- the set of session ids that the SessionCache believes have expired- Returns:
- the complete set of sessions that have expired, including those that are not currently loaded into the SessionCache
-
doInitialize
protected void doInitialize() throws java.lang.Exception- Specified by:
doInitializein classAbstractComponent- Throws:
java.lang.Exception
-
doDestroy
protected void doDestroy()
- Specified by:
doDestroyin classAbstractComponent
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-