@Singleton @Primary public class InMemorySessionStore extends java.lang.Object implements SessionStore<InMemorySession>
Constructor and Description |
---|
InMemorySessionStore(SessionIdGenerator sessionIdGenerator,
SessionConfiguration sessionConfiguration,
ApplicationEventPublisher eventPublisher)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
deleteSession(java.lang.String id)
Delete a session for the given ID.
|
java.util.concurrent.CompletableFuture<java.util.Optional<InMemorySession>> |
findSession(java.lang.String id)
Find a session for the given ID.
|
InMemorySession |
newSession()
Create a new unsaved session.
|
protected com.github.benmanes.caffeine.cache.Cache<java.lang.String,InMemorySession> |
newSessionCache(SessionConfiguration configuration)
Creates a new session cache.
|
java.util.concurrent.CompletableFuture<InMemorySession> |
save(InMemorySession session)
Save the given session.
|
public InMemorySessionStore(SessionIdGenerator sessionIdGenerator, SessionConfiguration sessionConfiguration, ApplicationEventPublisher eventPublisher)
sessionIdGenerator
- The session id generatorsessionConfiguration
- The sessions configurationeventPublisher
- The application event publisherpublic InMemorySession newSession()
SessionStore
newSession
in interface SessionStore<InMemorySession>
public java.util.concurrent.CompletableFuture<java.util.Optional<InMemorySession>> findSession(java.lang.String id)
SessionStore
findSession
in interface SessionStore<InMemorySession>
id
- The ID of the sessionOptional
sessionpublic java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteSession(java.lang.String id)
SessionStore
deleteSession
in interface SessionStore<InMemorySession>
id
- The ID of the sessionpublic java.util.concurrent.CompletableFuture<InMemorySession> save(InMemorySession session)
SessionStore
save
in interface SessionStore<InMemorySession>
session
- The session to saveprotected com.github.benmanes.caffeine.cache.Cache<java.lang.String,InMemorySession> newSessionCache(SessionConfiguration configuration)
configuration
- The session configuration