public class InMemorySessionManager extends Object implements SessionManager, SessionManagerStatistics
ATTACHMENT_KEY| Constructor and Description |
|---|
InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax) |
InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax, boolean statisticsEnabled) |
InMemorySessionManager(String id) |
InMemorySessionManager(String deploymentName, int maxSessions) |
InMemorySessionManager(String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax) |
| Modifier and Type | Method and Description |
|---|---|
Session | createSession(HttpServerExchange serverExchange, SessionConfig config) Creates a new session. |
boolean | equals(Object object) |
long | getActiveSessionCount() |
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 |
long | getAverageSessionAliveTime() |
long | getCreatedSessionCount() |
String | getDeploymentName() Uniquely identifies this session manager |
long | getExpiredSessionCount() |
long | getHighestSessionCount() |
long | getMaxActiveSessions() |
long | getMaxSessionAliveTime() |
long | getRejectedSessions() |
Session | getSession(HttpServerExchange serverExchange, SessionConfig config) |
Session | getSession(String sessionId) Retrieves a session with the given session id |
long | getStartTime() |
SessionManagerStatistics | getStatistics() Returns the statistics for this session manager, or null, if statistics are not supported. |
Set<String> | getTransientSessions() Returns the identifiers of those sessions that would be lost upon shutdown of this node |
int | hashCode() |
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 |
String | toString() |
public InMemorySessionManager(String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax)
public InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax)
public InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax, boolean statisticsEnabled)
public InMemorySessionManager(String deploymentName, int maxSessions)
public InMemorySessionManager(String id)
public String getDeploymentName()
SessionManagergetDeploymentName in interface SessionManagerpublic 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. The session manager is responsible for making sure that a newly created session is accessible to later calls to SessionManager.getSession(io.undertow.server.HttpServerExchange, SessionConfig) from the same request. It is recommended that a non static attachment key be used to store the newly created session as an attachment. The attachment key must be static to prevent different session managers from interfering with each other.
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 SessionManagerpublic SessionManagerStatistics getStatistics()
SessionManagergetStatistics in interface SessionManagerpublic long getCreatedSessionCount()
getCreatedSessionCount in interface SessionManagerStatisticspublic long getMaxActiveSessions()
getMaxActiveSessions in interface SessionManagerStatisticspublic long getHighestSessionCount()
getHighestSessionCount in interface SessionManagerStatisticspublic long getActiveSessionCount()
getActiveSessionCount in interface SessionManagerStatisticspublic long getExpiredSessionCount()
getExpiredSessionCount in interface SessionManagerStatisticspublic long getRejectedSessions()
getRejectedSessions in interface SessionManagerStatisticspublic long getMaxSessionAliveTime()
getMaxSessionAliveTime in interface SessionManagerStatisticspublic long getAverageSessionAliveTime()
getAverageSessionAliveTime in interface SessionManagerStatisticspublic long getStartTime()
getStartTime in interface SessionManagerStatisticsCopyright © 2020 JBoss by Red Hat. All rights reserved.