Package com.jsgalactic.axiom.security
Class InMemorySessionStore.Builder
java.lang.Object
com.jsgalactic.axiom.security.InMemorySessionStore.Builder
- Enclosing class:
InMemorySessionStore
Builds
InMemorySessionStores; used during configuration, not thread-safe.-
Method Summary
Modifier and TypeMethodDescriptionabsoluteTimeout(Duration absoluteTimeout) Sets the absolute timeout, which must not be shorter than the idle timeout.build()Builds the store.Sets the time source, for deterministic tests.idleTimeout(Duration idleTimeout) Sets the idle timeout.maxSessions(int maxSessions) Sets the most sessions held at once.Records the store's metrics.
-
Method Details
-
idleTimeout
Sets the idle timeout.- Parameters:
idleTimeout- 1 second to 30 days- Returns:
- this builder
-
absoluteTimeout
Sets the absolute timeout, which must not be shorter than the idle timeout.- Parameters:
absoluteTimeout- 1 second to 30 days- Returns:
- this builder
-
maxSessions
Sets the most sessions held at once.- Parameters:
maxSessions- 1 to 10,000,000- Returns:
- this builder
-
clock
Sets the time source, for deterministic tests.- Parameters:
clock- the clock- Returns:
- this builder
-
metrics
Records the store's metrics.- Parameters:
metrics- the sink- Returns:
- this builder
-
build
Builds the store.- Returns:
- a thread-safe store
- Throws:
IllegalArgumentException- if the absolute timeout is shorter than the idle timeout
-