public class InMemorySessionManager extends Object implements SessionManager
ATTACHMENT_KEY| Constructor and Description |
|---|
InMemorySessionManager() |
| Modifier and Type | Method and Description |
|---|---|
Session |
createSession(HttpServerExchange serverExchange,
SessionConfig config)
Creates a new session.
|
Set<String> |
getActiveSessions()
Returns the identifiers of those sessions that are active on this
node, excluding passivated sessions
|
Set<String> |
getAllSessions()
Returns the identifiers of all sessions, including both active and
passive
|
Session |
getSession(HttpServerExchange serverExchange,
SessionConfig config) |
Session |
getSession(String sessionId)
Retrieves a session with the given session id
|
Set<String> |
getTransientSessions()
Returns the identifiers of those sessions that would be lost upon
shutdown of this node
|
void |
registerSessionListener(SessionListener listener)
Registers a session listener for the session manager
|
void |
removeSessionListener(SessionListener listener)
Removes a session listener from the session manager
|
void |
setDefaultSessionTimeout(int timeout)
Sets the default session timeout
|
void |
start()
Starts the session manager
|
void |
stop()
stops the session manager
|
public void start()
SessionManagerstart in interface SessionManagerpublic void stop()
SessionManagerstop in interface SessionManagerpublic Session createSession(HttpServerExchange serverExchange, SessionConfig config)
SessionManagerSessionListeners registered with this manager will be notified
of the session creation.
This method *MUST* call SessionConfig.findSessionId(io.undertow.server.HttpServerExchange) (io.undertow.server.HttpServerExchange)} first to
determine if an existing session ID is present in the exchange. If this id is present then it must be used
as the new session ID. If a session with this ID already exists then an IllegalStateException must be
thrown.
This requirement exists to allow forwards across servlet contexts to work correctly.createSession in interface SessionManagerpublic Session getSession(HttpServerExchange serverExchange, SessionConfig config)
getSession in interface SessionManagerpublic Session getSession(String sessionId)
SessionManagergetSession in interface SessionManagersessionId - The session IDpublic void registerSessionListener(SessionListener listener)
SessionManagerregisterSessionListener in interface SessionManagerlistener - The listenerpublic void removeSessionListener(SessionListener listener)
SessionManagerremoveSessionListener in interface SessionManagerlistener - the listenerpublic void setDefaultSessionTimeout(int timeout)
SessionManagersetDefaultSessionTimeout in interface SessionManagertimeout - the timeoutpublic Set<String> getTransientSessions()
SessionManagergetTransientSessions in interface SessionManagerpublic Set<String> getActiveSessions()
SessionManagergetActiveSessions in interface SessionManagerpublic Set<String> getAllSessions()
SessionManagergetAllSessions in interface SessionManagerCopyright © 2013 JBoss by Red Hat. All Rights Reserved.