|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Manager
An interface to manager MBeans managing sessions that are associated with a particular container. Different manager implementations may support value-added features such as the persistent storage of session data, as well as migrating sessions for distributable web applications.
| Field Summary | |
|---|---|
static int |
ALLOW_MULTIPLE_USER_SESSIONS
Allows multiple sessions for the same principal. |
static int |
EXPIRE_EXISTING_USER_SESSION
Expires an existing session for the same principal. |
static int |
JOIN_EXISTING_USER_SESSION
Joins an existing session for the same principal. |
| 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 sessions. |
void |
expireSession(String id)
Expires the specified session. |
int |
getDefaultExpirationTime()
Gets the default expiration time for existing sessions. |
int |
getIdLength()
Gets the length of session ids. |
int |
getInitialExpirationTime()
Gets the initial expiration time for new 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 |
setDefaultExpirationTime(int t)
Sets the default expiration time for existing sessions. |
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 |
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. |
| Field Detail |
|---|
static final int ALLOW_MULTIPLE_USER_SESSIONS
static final int EXPIRE_EXISTING_USER_SESSION
static final int JOIN_EXISTING_USER_SESSION
| Method Detail |
|---|
int getIdLength()
void setIdLength(int l)
l - the id length.boolean isDistributable()
void setDistributable(boolean flag)
flag - the distributable flag.int getInitialExpirationTime()
void setInitialExpirationTime(int t)
t - the initial expiration time in seconds (0 = default).int getDefaultExpirationTime()
void setDefaultExpirationTime(int t)
t - the default expiration time in seconds.
void setSessionExpirationTime(String id,
int t)
id - the id of the session to set.t - the expiration time in seconds.int getUserSessionPolicy()
void setUserSessionPolicy(int policy)
policy - the policy to apply.
AuthenticatedSession createSession()
throws LogException
LogException - if a new session cannot be instantiated.
AuthenticatedSession createSession(String id)
throws LogException
id - the session id.
LogException - if a new session cannot be instantiated.AuthenticatedSession getSession(String id)
id - the session id.
String[] getUserSessions(Principal principal)
principal - the principal instance.
String[] getUserSessions(String username)
username - the named user.
AuthenticatedSession registerUserPrincipal(Principal principal,
String id)
principal - the user principal.id - the session id.
IllegalStateException - if no such session.
void unregisterUserPrincipal(Principal principal,
String id)
principal - the user principal.id - the session id.Set userPrincipalSet()
void expireSession(String id)
id - the id of the session to expire.void expireAll()
ServletContext getServletContext()
void load()
throws LogException
LogException - for processing errors.
void unload()
throws LogException
LogException - for processing errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||