Interface SessionManager<L,B extends Batch>
-
- Type Parameters:
L- the local context typeB- the batch type
- All Superinterfaces:
ActiveSessionStatistics,Restartable
public interface SessionManager<L,B extends Batch> extends Restartable, ActiveSessionStatistics
SPI for a distributable session manager.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Session<L>createSession(String id)Creates a session using the specified identifier.Session<L>findSession(String id)Returns the session with the specified identifier, or null if none exists.Set<String>getActiveSessions()Returns the identifiers of those sessions that are active on this node.Batcher<B>getBatcher()Exposes the batching mechanism used by this session manager.DurationgetDefaultMaxInactiveInterval()Returns the default maximum inactive interval, as a duration, for all sessions created by this session manager.Supplier<String>getIdentifierFactory()Returns the identifier factory of this session manager.Set<String>getLocalSessions()Returns the identifiers of all sessions on this node, including both active and passive sessions.DurationgetStopTimeout()The maximum duration of time to wait for the completion of requests before the session manager can be stopped.ImmutableSessionreadSession(String id)Returns a read-only view of the session with the specified identifier.voidsetDefaultMaxInactiveInterval(Duration duration)Set the default maximum inactive interval, using the specified time duration, for all sessions created by this session manager.-
Methods inherited from interface org.wildfly.clustering.web.session.ActiveSessionStatistics
getActiveSessionCount
-
Methods inherited from interface org.wildfly.clustering.ee.Restartable
start, stop
-
-
-
-
Method Detail
-
findSession
Session<L> findSession(String id)
Returns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed viaSession.close(). This method is intended to be invoked within the context of a batch.- Parameters:
id- a session identifier- Returns:
- an existing web session, or null if none exists
-
createSession
Session<L> createSession(String id)
Creates a session using the specified identifier. Sessions returned by this method must be closed viaSession.close(). This method is intended to be invoked within the context of a batch.- Parameters:
id- a session identifier- Returns:
- a new web session, or null if a session with the specified identifier already exists.
-
getDefaultMaxInactiveInterval
Duration getDefaultMaxInactiveInterval()
Returns the default maximum inactive interval, as a duration, for all sessions created by this session manager.- Returns:
- a duration
-
setDefaultMaxInactiveInterval
void setDefaultMaxInactiveInterval(Duration duration)
Set the default maximum inactive interval, using the specified time duration, for all sessions created by this session manager.- Parameters:
duration- a time duration
-
getBatcher
Batcher<B> getBatcher()
Exposes the batching mechanism used by this session manager.- Returns:
- a batcher.
-
getActiveSessions
Set<String> getActiveSessions()
Returns the identifiers of those sessions that are active on this node.- Returns:
- a set of session identifiers.
-
getLocalSessions
Set<String> getLocalSessions()
Returns the identifiers of all sessions on this node, including both active and passive sessions.- Returns:
- a set of session identifiers.
-
readSession
ImmutableSession readSession(String id)
Returns a read-only view of the session with the specified identifier. This method is intended to be invoked within the context of a batch- Parameters:
id- a unique session identifier- Returns:
- a read-only session or null if none exists
-
getStopTimeout
Duration getStopTimeout()
The maximum duration of time to wait for the completion of requests before the session manager can be stopped.- Returns:
- a duration
-
-