|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.cache.CachedMapAdapter
org.norther.tammi.core.cache.DefaultCache
org.norther.tammi.spray.session.DefaultSessionManager
public class DefaultSessionManager
A session manager implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
static String |
DEFAULT_SESSION_STORE
The default session store path. |
| Fields inherited from class org.norther.tammi.core.cache.DefaultCache |
|---|
DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR |
| Fields inherited from class org.norther.tammi.acorn.cache.CachedMapAdapter |
|---|
DEFAULT_EXPIRATION_SLEEP_INTERVAL, DEFAULT_EXPIRATION_TIME |
| Fields inherited from interface org.norther.tammi.spray.session.Manager |
|---|
ALLOW_MULTIPLE_USER_SESSIONS, EXPIRE_EXISTING_USER_SESSION, JOIN_EXISTING_USER_SESSION |
| Constructor Summary | |
|---|---|
DefaultSessionManager()
Constructs a new session manager. |
|
DefaultSessionManager(int max)
Constructs a new session cache with max expiration time. |
|
DefaultSessionManager(int max,
int def)
Constructs a new session cache with max and default expiration times. |
|
DefaultSessionManager(int max,
int def,
int sleep)
Constructs a new session cache with max and default expiration times and expiration sleep interval. |
|
DefaultSessionManager(int max,
int def,
int sleep,
int capacity)
Constructs a new session cache with max and default expiration times, an expiration sleep interval and initial capacity. |
|
DefaultSessionManager(int max,
int def,
int sleep,
int capacity,
float loadFactor)
Constructs a new session cache with max and default expiration times, an expiration sleep interval, initial capacity and load factor. |
|
| Method Summary | |
|---|---|
AuthenticatedSession |
createSession()
Constructs a new session based on the default settings specified by manager properties. |
AuthenticatedSession |
createSession(String id)
Constructs a new session based on the default settings specified by manager properties. |
void |
expireAll()
Expires all entries. |
void |
expireSession(String id)
Expires the specified session. |
int |
getIdLength()
Gets the length of session ids. |
int |
getInitialExpirationTime()
Gets the initial expiration time for new sessions. |
String |
getSerializedSessionsPath()
Gets the path to store serialized sessions. |
ServletContext |
getServletContext()
Gets a servlet context. |
AuthenticatedSession |
getSession(String id)
Gets the active session with the specified session id. |
int |
getUserSessionPolicy()
Gets the policy for multiple sessions for the same principal. |
String[] |
getUserSessions(Principal principal)
Gets ids of active sessions of the specified principal. |
String[] |
getUserSessions(String username)
Gets ids of active sessions of the named user. |
boolean |
isDistributable()
Checks the distributable flag for the sessions. |
void |
load()
Loads currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. |
AuthenticatedSession |
registerUserPrincipal(Principal principal,
String id)
Registers a user principal to a session. |
void |
sessionCreated(HttpSessionEvent event)
|
void |
sessionDestroyed(HttpSessionEvent event)
|
void |
setDistributable(boolean flag)
Sets the distributable flag for the sessions. |
void |
setIdLength(int l)
Sets the length of session ids. |
void |
setInitialExpirationTime(int t)
Sets the initial expiration time for new sessions. |
void |
setSerializedSessionsPath(String path)
Sets the path to store serialized sessions. |
void |
setSessionExpirationTime(String id,
int t)
Sets the expiration time for a specific session. |
void |
setUserSessionPolicy(int policy)
Sets the policy for multiple sessions for the same principal. |
void |
unload()
Saves currently active sessions in the appropriate persistence mechanism, if any. |
void |
unregisterUserPrincipal(Principal principal,
String id)
Unregisters a user principal from a session. |
Set |
userPrincipalSet()
Returns a read-only set of registered user principals. |
| Methods inherited from class org.norther.tammi.core.cache.DefaultCache |
|---|
addNotificationListener, getMBeanDelegate, getNotificationInfo, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, setAllowExpired, setDefaultExpirationTime, setDiscardOverloaded, setExpirationLimit, setExpirationSleepInterval, setExpirationThreshold, setMaxExpirationTime, toString, unmanaged |
| Methods inherited from class org.norther.tammi.acorn.cache.CachedMapAdapter |
|---|
add, add, clear, containsKey, containsValue, entrySet, equals, expire, expireFraction, get, get, getDefaultExpirationTime, getExpirationLimit, getExpirationSleepInterval, getExpirationThreshold, getExpirationTimer, getMaxExpirationTime, getSwapOutHandler, hashCode, isAllowExpired, isAutoRefreshDeclined, isDiscardOverloaded, isEmpty, keySet, put, put, putAll, putIfAbsent, putIfAbsent, refresh, refresh, remove, remove, replace, replace, setAutoRefreshDeclined, setExpirationTimer, setSwapOutHandler, size, values |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.acorn.cache.CachedMap |
|---|
add, add, expire, expireFraction, get, getDefaultExpirationTime, getExpirationLimit, getExpirationSleepInterval, getExpirationThreshold, getMaxExpirationTime, isAllowExpired, isAutoRefreshDeclined, isDiscardOverloaded, put, putIfAbsent, refresh, refresh, setAllowExpired, setAutoRefreshDeclined, setDefaultExpirationTime, setDiscardOverloaded, setExpirationLimit, setExpirationSleepInterval, setExpirationThreshold, setMaxExpirationTime |
| Methods inherited from interface java.util.concurrent.ConcurrentMap |
|---|
putIfAbsent, remove, replace, replace |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from interface org.norther.tammi.spray.session.Manager |
|---|
getDefaultExpirationTime, setDefaultExpirationTime |
| Field Detail |
|---|
public static final String DEFAULT_SESSION_STORE
| Constructor Detail |
|---|
public DefaultSessionManager()
public DefaultSessionManager(int max)
max - a max expiration time (0 = default, -1 = infinite).
public DefaultSessionManager(int max,
int def)
max - a max expiration time in secs (0 = default, -1 = infinite).def - a default expiration time in secs (0 = default, -1 =
infinite).
public DefaultSessionManager(int max,
int def,
int sleep)
max - a max expiration time in secs (0 = default, -1 = infinite).def - a default expiration time in secs (0 = default, -1 =
infinite).sleep - an expiration sleep interval in secs (0 = default, -1 =
infinite).
public DefaultSessionManager(int max,
int def,
int sleep,
int capacity)
max - a max expiration time in secs (0 = default, -1 = infinite).def - a default expiration time in secs (0 = default, -1 =
infinite).sleep - an expiration sleep interval in secs (0 = default, -1 =
infinite).capacity - an initial capacity.
public DefaultSessionManager(int max,
int def,
int sleep,
int capacity,
float loadFactor)
max - a max expiration time in secs (0 = default, -1 = infinite).def - a default expiration time in secs (0 = default, -1 =
infinite).sleep - an expiration sleep interval in secs (0 = default, -1 =
infinite).capacity - an initial capacity.loadFactor - a load factor.| Method Detail |
|---|
public int getIdLength()
Manager
getIdLength in interface Managerpublic void setIdLength(int l)
Manager
setIdLength in interface Managerl - the id length.public boolean isDistributable()
Manager
isDistributable in interface Managerpublic void setDistributable(boolean flag)
Manager
setDistributable in interface Managerflag - the distributable flag.public int getInitialExpirationTime()
Manager
getInitialExpirationTime in interface Managerpublic void setInitialExpirationTime(int t)
Manager
setInitialExpirationTime in interface Managert - the initial expiration time in seconds (0 = default).
public void setSessionExpirationTime(String id,
int t)
Manager
setSessionExpirationTime in interface Managerid - the id of the session to set.t - the expiration time in seconds.public int getUserSessionPolicy()
Manager
getUserSessionPolicy in interface Managerpublic void setUserSessionPolicy(int policy)
Manager
setUserSessionPolicy in interface Managerpolicy - the policy to apply.
public AuthenticatedSession createSession()
throws LogException
Manager
createSession in interface ManagerLogException - if a new session cannot be instantiated.
public AuthenticatedSession createSession(String id)
throws LogException
Manager
createSession in interface Managerid - the session id.
LogException - if a new session cannot be instantiated.public AuthenticatedSession getSession(String id)
Manager
getSession in interface Managerid - the session id.
public String[] getUserSessions(Principal principal)
Manager
getUserSessions in interface Managerprincipal - the principal instance.
public String[] getUserSessions(String username)
Manager
getUserSessions in interface Managerusername - the named user.
public AuthenticatedSession registerUserPrincipal(Principal principal,
String id)
Manager
registerUserPrincipal in interface Managerprincipal - the user principal.id - the session id.
public void unregisterUserPrincipal(Principal principal,
String id)
Manager
unregisterUserPrincipal in interface Managerprincipal - the user principal.id - the session id.public Set userPrincipalSet()
Manager
userPrincipalSet in interface Managerpublic void expireSession(String id)
Manager
expireSession in interface Managerid - the id of the session to expire.public ServletContext getServletContext()
Manager
getServletContext in interface Manager
public void load()
throws LogException
Manager
load in interface ManagerLogException - for processing errors.
public void unload()
throws LogException
Manager
unload in interface ManagerLogException - for processing errors.public void expireAll()
CachedMap
expireAll in interface CachedMapexpireAll in interface ManagerexpireAll in class CachedMapAdapterpublic String getSerializedSessionsPath()
SessionManager
getSerializedSessionsPath in interface SessionManagerpublic void setSerializedSessionsPath(String path)
SessionManager
setSerializedSessionsPath in interface SessionManagerpath - the session store path.public void sessionCreated(HttpSessionEvent event)
sessionCreated in interface HttpSessionListenerpublic void sessionDestroyed(HttpSessionEvent event)
sessionDestroyed in interface HttpSessionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||