|
||||||||||
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.
Nested Class Summary | |
---|---|
static class |
Manager.SessionPolicy
The session policy. |
Method Summary | |
---|---|
void |
addHttpSessionAttributeListener(HttpSessionAttributeListener listener)
Adds a HTTP session attribute listener. |
void |
addHttpSessionListener(HttpSessionListener listener)
Adds a HTTP session listener. |
void |
addServletContextAttributeListener(ServletContextAttributeListener listener)
Adds a servlet context attribute listener. |
void |
addServletContextListener(ServletContextListener listener)
Adds a servlet context listener. |
void |
addServletRequestAttributeListener(ServletRequestAttributeListener listener)
Adds a servlet request attribute listener. |
void |
addServletRequestListener(ServletRequestListener listener)
Adds a servlet request listener. |
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. |
String |
getHttpSessionClassName()
Gets the http session class name. |
int |
getIdLength()
Gets the length of session ids. |
int |
getInitialExpirationTime()
Gets the initial expiration time for new sessions. |
String |
getRequestDispatcherClassName()
Gets the request dispatcher class name. |
ServletContext |
getServletContext()
Gets the servlet context. |
AuthenticatedSession |
getSession(String id)
Gets the active session with the specified session id. |
Manager.SessionPolicy |
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 |
removeHttpSessionAttributeListener(HttpSessionAttributeListener listener)
Removes a HTTP session attribute listener. |
void |
removeHttpSessionListener(HttpSessionListener listener)
Removes a HTTP session listener. |
void |
removeServletContextAttributeListener(ServletContextAttributeListener listener)
Removes a servlet context attribute listener. |
void |
removeServletContextListener(ServletContextListener listener)
Removes a servlet context listener. |
void |
removeServletRequestAttributeListener(ServletRequestAttributeListener listener)
Removes a servlet request attribute listener. |
void |
removeServletRequestListener(ServletRequestListener listener)
Removes a servlet request listener. |
void |
setDefaultExpirationTime(int t)
Sets the default expiration time for existing sessions. |
void |
setDistributable(boolean flag)
Sets the distributable flag for the sessions. |
void |
setHttpSessionClassName(String className)
Sets the http session class name. |
void |
setIdLength(int l)
Sets the length of session ids. |
void |
setInitialExpirationTime(int t)
Sets the initial expiration time for new sessions. |
void |
setRequestDispatcherClassName(String className)
Sets the request dispatcher class name. |
void |
setSessionExpirationTime(String id,
int t)
Sets the expiration time for a specific session. |
void |
setUserSessionPolicy(Manager.SessionPolicy policy)
Sets the policy for multiple sessions of 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<Principal> |
userPrincipalSet()
Returns a read-only set of registered user principals. |
Methods inherited from interface org.norther.tammi.core.config.Configurable |
---|
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties |
Methods inherited from interface org.norther.tammi.core.base.Startable |
---|
isStarted, start, stop |
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.Manager.SessionPolicy getUserSessionPolicy()
void setUserSessionPolicy(Manager.SessionPolicy 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.
NullPointerException
- for a missing principal.
IllegalArgumentException
- if principals differ.void unregisterUserPrincipal(Principal principal, String id)
principal
- the user principal.id
- the session id.Set<Principal> userPrincipalSet()
void expireSession(String id)
id
- the id of the session to expire.void expireAll()
ServletContext getServletContext()
String getHttpSessionClassName()
void setHttpSessionClassName(String className)
className
- the class name.String getRequestDispatcherClassName()
void setRequestDispatcherClassName(String className)
className
- the class name.void load() throws LogException
LogException
- for processing errors.void unload() throws LogException
LogException
- for processing errors.void addServletContextListener(ServletContextListener listener)
listener
- the listener.void removeServletContextListener(ServletContextListener listener)
listener
- the listener.void addServletContextAttributeListener(ServletContextAttributeListener listener)
listener
- the listener.void removeServletContextAttributeListener(ServletContextAttributeListener listener)
listener
- the listener.void addHttpSessionListener(HttpSessionListener listener)
listener
- the listener.void removeHttpSessionListener(HttpSessionListener listener)
listener
- the listener.void addHttpSessionAttributeListener(HttpSessionAttributeListener listener)
listener
- the listener.void removeHttpSessionAttributeListener(HttpSessionAttributeListener listener)
listener
- the listener.void addServletRequestListener(ServletRequestListener listener)
listener
- the listener.void removeServletRequestListener(ServletRequestListener listener)
listener
- the listener.void addServletRequestAttributeListener(ServletRequestAttributeListener listener)
listener
- the listener.void removeServletRequestAttributeListener(ServletRequestAttributeListener listener)
listener
- the listener.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |