| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected boolean | |
| protected long | |
| protected Map | |
| protected File | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | delete(String
session id id)Implements org. Delete a session |
| public boolean | Returns: true if file was deleted, false otherwisename of the file containing the session's information filename)Delete the file associated with a session |
| public Set | Returns: the complete set of sessions that have expired, including those that are not currently loaded into the SessionCachethe set of session ids that the SessionCache believes
have expired candidates, long the time at which to check for expiry time)Implements abstract org. Check to see which sessions have expired. |
| public void | doCleanOrphans(long
the upper limit of the expiry time to check in msec time)Implements abstract org. Implemented by subclasses to delete sessions for other contexts that expired at or before the timeLimit. |
| public boolean | doExists(String
the session id to check id)Implements abstract org. Check if a session for the given id exists. |
| public Set | doGetExpired(long
the upper limit of expiry times to check. Sessions expired
at or before this timestamp will match. timeLimit)Implements abstract org. 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 SessionData | doLoad(String
the id of the session to load id)Implements abstract org. Load the session from persistent store. |
| protected void | doStart()
Overrides org. Starts the managed lifecycle beans in the order they were added. |
| protected void | doStop()
Overrides org. Stops the managed lifecycle beans in the reverse order they were added. |
| public 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)Implements abstract org. Store the session data persistently. |
| protected String | |
| protected long | |
| protected String | |
| protected String | Returns: the session id plus contextidentity of session id)Get the session id with its context. |
| protected String | Returns: the session id plus context and expirythe session data data)Get the session id with its context and its expiry time |
| protected String | Returns: the session id plus contextthe name of the file to use filename)Extract the session id and context from the filename |
| public File | |
| public void | initialize(SessionContext
context associated context)Overrides org. Implements org. Initialize this data map for the given context. |
| public void | initializeStore()
Read the names of the existing session files and build a map of fully qualified session ids (ie with context) to filename. |
| public boolean | |
| protected boolean | Returns: true if the filename has the correct filename format and is for this contextthe filename to check filename)Check if the filename matches our session pattern and is a session for our context. |
| public boolean | isPassivating()
Implements org. True if this type of datastore will passivate session objects |
| protected boolean | Returns: true if the filename has the correct filename formatthe filename to check filename)Check if the filename is a session filename. |
| protected SessionData | Returns: the session datafile input stream containing session data is, String the id we've been told to load expectedId)Load the session data from a file. |
| protected void | save(OutputStream
the output stream to save to os, String identity of the session id, SessionData the info of the session data)Save the session data. |
| public void | |
| public void | |
| protected void | sweepDisk(long time)
Check all session files for any context and remove any that expired at or before the time limit. |
| protected void | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| _contextString | back to summary |
|---|---|
| protected String _contextString | |
| _deleteUnrestorableFiles | back to summary |
|---|---|
| protected boolean _deleteUnrestorableFiles | |
| _lastSweepTime | back to summary |
|---|---|
| protected long _lastSweepTime | |
| _sessionFileMap | back to summary |
|---|---|
| protected Map<String, String> _sessionFileMap | |
| _storeDir | back to summary |
|---|---|
| protected File _storeDir | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| FileSessionDataStore | back to summary |
|---|---|
| public FileSessionDataStore() | |
| delete | back to summary |
|---|---|
| public boolean delete(String id) throws Exception Implements org. Delete a session
| |
| deleteFile | back to summary |
|---|---|
| public boolean deleteFile(String filename) throws Exception Delete the file associated with a session | |
| doCheckExpired | back to summary |
|---|---|
| public Set Implements abstract org. Check to see which sessions have expired.
| |
| doCleanOrphans | back to summary |
|---|---|
| public void doCleanOrphans(long time) Implements abstract org. Doc from org. 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 boolean doExists(String id) throws Exception Implements abstract org. Doc from org. Check if a session for the given id exists. | |
| doGetExpired | back to summary |
|---|---|
| public Set Implements abstract org. Doc from org. 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 SessionData doLoad(String id) throws Exception Implements abstract org. Doc from org. 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.
| |
| doStop | back to summary |
|---|---|
| protected void doStop() throws Exception Overrides org. Doc from org. Stops the managed lifecycle beans in the reverse order they were added.
| |
| doStore | back to summary |
|---|---|
| public void doStore(String id, SessionData data, long lastSaveTime) throws Exception Implements abstract org. Doc from org. Store the session data persistently.
| |
| getContextFromFilename | back to summary |
|---|---|
| protected String getContextFromFilename(String filename) | |
| getExpiryFromFilename | back to summary |
|---|---|
| protected long getExpiryFromFilename(String filename) | |
| getIdFromFilename | back to summary |
|---|---|
| protected String getIdFromFilename(String filename) | |
| getIdWithContext | back to summary |
|---|---|
| protected String getIdWithContext(String id) Get the session id with its context. | |
| getIdWithContextAndExpiry | back to summary |
|---|---|
| protected String getIdWithContextAndExpiry(SessionData data) Get the session id with its context and its expiry time
| |
| getIdWithContextFromFilename | back to summary |
|---|---|
| protected String getIdWithContextFromFilename(String filename) Extract the session id and context from the filename | |
| getStoreDir | back to summary |
|---|---|
public File getStoreDir()
| |
| initialize | back to summary |
|---|---|
| public void initialize(SessionContext context) throws Exception Overrides org. Implements org. Doc from org. Initialize this data map for the given context. A SessionDataMap can only be used by one context(/session manager).
| |
| initializeStore | back to summary |
|---|---|
| public void initializeStore() throws Exception Read the names of the existing session files and build a map of fully qualified session ids (ie with context) to filename. If there is more than one file for the same session, only the most recently modified will be kept and the rest deleted. At the same time, any files - for any context - that expired a long time ago will be cleaned up.
| |
| isDeleteUnrestorableFiles | back to summary |
|---|---|
| public boolean isDeleteUnrestorableFiles() | |
| isOurContextSessionFilename | back to summary |
|---|---|
| protected boolean isOurContextSessionFilename(String filename) Check if the filename matches our session pattern and is a session for our context.
| |
| isPassivating | back to summary |
|---|---|
| public boolean isPassivating() Implements org. Doc from org. True if this type of datastore will passivate session objects
| |
| isSessionFilename | back to summary |
|---|---|
| protected boolean isSessionFilename(String filename) Check if the filename is a session filename.
| |
| load | back to summary |
|---|---|
| protected SessionData load(InputStream is, String expectedId) throws Exception Load the session data from a file.
| |
| save | back to summary |
|---|---|
| protected void save(OutputStream os, String id, SessionData data) throws Exception Save the session data.
| |
| setDeleteUnrestorableFiles | back to summary |
|---|---|
| public void setDeleteUnrestorableFiles(boolean deleteUnrestorableFiles) | |
| setStoreDir | back to summary |
|---|---|
| public void setStoreDir(File storeDir) | |
| sweepDisk | back to summary |
|---|---|
| protected void sweepDisk(long time) Check all session files for any context and remove any that expired at or before the time limit. | |
| sweepFile | back to summary |
|---|---|
| protected void sweepFile(long time, Path p) Delete file (from any context) that expired at or before the given time
| |
| 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- | |