AbstractSessionCache, DefaultSessionCachepublic interface SessionCache
Created: 2017. 6. 24.
| Modifier and Type | Field | Description |
|---|---|---|
static int |
EVICT_ON_INACTIVITY |
|
static int |
EVICT_ON_SESSION_EXIT |
|
static int |
NEVER_EVICT |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<java.lang.String> |
checkExpiration(java.util.Set<java.lang.String> candidates) |
Check a list of session ids that belong to potentially expired
sessions.
|
void |
checkInactiveSession(Session session) |
Check a Session to see if it might be appropriate to
evict or expire.
|
void |
clear() |
|
boolean |
contains(java.lang.String id) |
Check to see if a Session is in the cache.
|
Session |
delete(java.lang.String id) |
Remove a Session completely: from both this
cache and the SessionDataStore.
|
boolean |
exists(java.lang.String id) |
Check to see if a session exists: WILL consult the
SessionDataStore.
|
Session |
get(java.lang.String id) |
Get an existing Session.
|
int |
getEvictionPolicy() |
|
SessionDataStore |
getSessionDataStore() |
|
long |
getSessionsCurrent() |
|
long |
getSessionsMax() |
|
long |
getSessionsTotal() |
Returns a running total of sessions in the cache.
|
boolean |
isRemoveUnloadableSessions() |
|
boolean |
isSaveOnCreate() |
|
boolean |
isSaveOnInactiveEviction() |
|
Session |
newSession(SessionData data) |
Re-materialize a Session that has previously existed.
|
Session |
newSession(java.lang.String id,
long time,
long maxInactiveIntervalMS) |
|
void |
put(java.lang.String id,
Session session) |
Finish using a Session.
|
void |
resetStats() |
Resets the running total session count in the cache.
|
void |
setEvictionPolicy(int policy) |
Sessions in this cache can be:
never evicted
evicted once the last request exits
evicted after a configurable period of inactivity
|
void |
setRemoveUnloadableSessions(boolean removeUnloadableSessions) |
If the data for a session exists but is unreadable,
the SessionCache can instruct the SessionDataStore to delete it.
|
void |
setSaveOnCreate(boolean saveOnCreate) |
Whether or not a session that is newly created should be
immediately saved.
|
void |
setSaveOnInactiveEviction(boolean saveOnEvict) |
Whether or not a a session that is about to be evicted should
be saved before being evicted.
|
void |
setSessionDataStore(SessionDataStore sds) |
A SessionDataStore that is the authoritative source
of session information.
|
static final int NEVER_EVICT
static final int EVICT_ON_SESSION_EXIT
static final int EVICT_ON_INACTIVITY
SessionDataStore getSessionDataStore()
void setSessionDataStore(SessionDataStore sds)
sds - the session data storeint getEvictionPolicy()
void setEvictionPolicy(int policy)
policy - -1 is never evict; 0 is evict-on-exit; and any other positive
value is the time in seconds that a session can be idle before it can
be evicted.boolean isSaveOnCreate()
boolean isRemoveUnloadableSessions()
void setRemoveUnloadableSessions(boolean removeUnloadableSessions)
removeUnloadableSessions - whether or not SessionCache will delete
session data that can not be loaded from the SessionDataStorevoid setSaveOnCreate(boolean saveOnCreate)
saveOnCreate - if true, immediately save the newly created sessionboolean isSaveOnInactiveEviction()
void setSaveOnInactiveEviction(boolean saveOnEvict)
saveOnEvict - if true, save the session before evictionSession get(java.lang.String id) throws java.lang.Exception
id - the session idjava.lang.Exception - if an error occursvoid put(java.lang.String id,
Session session)
throws java.lang.Exception
id - the session idsession - the session objectjava.lang.Exception - if an error occursboolean exists(java.lang.String id)
throws java.lang.Exception
id - the session idjava.lang.Exception - if an error occursboolean contains(java.lang.String id)
throws java.lang.Exception
id - the session idjava.lang.Exception - if an error occursSession delete(java.lang.String id) throws java.lang.Exception
id - the session idjava.lang.Exception - if an error occurs when deleting a sessionjava.util.Set<java.lang.String> checkExpiration(java.util.Set<java.lang.String> candidates)
candidates - the session ids to checkvoid checkInactiveSession(Session session)
session - the session objectSession newSession(java.lang.String id, long time, long maxInactiveIntervalMS)
Session newSession(SessionData data)
data - the session datalong getSessionsCurrent()
long getSessionsMax()
long getSessionsTotal()
void resetStats()
void clear()
Copyright © 2008–2018 The Aspectran Project. All rights reserved.