Package org.springframework.session
Interface ReactiveSessionRepository<S extends Session>
- Type Parameters:
S
- theSession
type
- All Known Implementing Classes:
ReactiveMapSessionRepository
,ReactiveMongoSessionRepository
,ReactiveRedisIndexedSessionRepository
,ReactiveRedisSessionRepository
public interface ReactiveSessionRepository<S extends Session>
A repository interface for managing
Session
instances.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<S>
Creates a newSession
that is capable of being persisted by thisReactiveSessionRepository
.reactor.core.publisher.Mono<Void>
deleteById
(String id) reactor.core.publisher.Mono<S>
reactor.core.publisher.Mono<Void>
Ensures theSession
created bycreateSession()
is saved.
-
Method Details
-
createSession
reactor.core.publisher.Mono<S> createSession()Creates a newSession
that is capable of being persisted by thisReactiveSessionRepository
.This allows optimizations and customizations in how the
Session
is persisted. For example, the implementation returned might keep track of the changes ensuring that only the delta needs to be persisted on a save.- Returns:
- a new
Session
that is capable of being persisted by thisReactiveSessionRepository
-
save
Ensures theSession
created bycreateSession()
is saved.Some implementations may choose to save as the
Session
is updated by returning aSession
that immediately persists any changes. In this case, this method may not actually do anything.- Parameters:
session
- theSession
to save- Returns:
- indicator of operation completion
-
findById
- Parameters:
id
- theSession.getId()
to lookup- Returns:
- the
Session
by theSession.getId()
or null if noSession
is found.
-
deleteById
- Parameters:
id
- theSession.getId()
to delete- Returns:
- indicator of operation completion
-