Module io.inverno.mod.session
Package io.inverno.mod.session
Class AbstractSessionStore<A,B extends Session<A>>
java.lang.Object
io.inverno.mod.session.AbstractSessionStore<A,B>
- Type Parameters:
A
- the session data typeB
- the session type
- All Implemented Interfaces:
SessionStore<A,
B>
- Direct Known Subclasses:
InMemoryBasicSessionStore
,InMemoryJWTSessionStore
,RedisBasicSessionStore
,RedisJWTSessionStore
public abstract class AbstractSessionStore<A,B extends Session<A>>
extends Object
implements SessionStore<A,B>
Base SessionStore
implementation class.
- Since:
- 1.13
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
AbstractSessionStore.Builder<A,
B extends Session<A>, C extends AbstractSessionStore<A, B>, D extends AbstractSessionStore.Builder<A, B, C, D>> A base session store builder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Long
The period in milliseconds after a which a new session must expire.protected final Long
The initial maximum inactive interval in milliseconds to set when creating a new session.protected final SessionIdGenerator
<A, B> The session id generator. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractSessionStore
(SessionIdGenerator<A, B> sessionIdGenerator, Long maxInactiveInterval, Long expireAfterPeriod) Creates a base session store. -
Method Summary
Modifier and TypeMethodDescriptionReturns the period in milliseconds after a which a new session must expire.Returns the initial maximum inactive interval in milliseconds to set when creating a new session.SessionIdGenerator
<A, ? extends Session<A>> Returns the session id generator.
-
Field Details
-
sessionIdGenerator
The session id generator. -
maxInactiveInterval
The initial maximum inactive interval in milliseconds to set when creating a new session. -
expireAfterPeriod
The period in milliseconds after a which a new session must expire.
-
-
Constructor Details
-
AbstractSessionStore
protected AbstractSessionStore(SessionIdGenerator<A, B> sessionIdGenerator, Long maxInactiveInterval, Long expireAfterPeriod) throws IllegalArgumentExceptionCreates a base session store.
- Parameters:
sessionIdGenerator
- a session id generatormaxInactiveInterval
- the initial maximum inactive interval in millisecondsexpireAfterPeriod
- the period in milliseconds after which a new session must expire- Throws:
IllegalArgumentException
- if both maximum inactive interval and expire after period are null
-
-
Method Details
-
getSessionIdGenerator
Returns the session id generator.
- Returns:
- the session id generator
-
getMaxInactiveInterval
Returns the initial maximum inactive interval in milliseconds to set when creating a new session.
- Returns:
- the maximum inactive interval in milliseconds
-
getExpireAfterPeriod
Returns the period in milliseconds after a which a new session must expire.
- Returns:
- the period in milliseconds after which a new session must expire
-