Package org.springframework.session
Interface ReactiveSessionRepository<S extends Session>
- Type Parameters:
S- theSessiontype
- All Known Implementing Classes:
ReactiveMapSessionRepository,ReactiveMongoSessionRepository,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 newSessionthat 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 theSessioncreated bycreateSession()is saved.
-
Method Details
-
createSession
reactor.core.publisher.Mono<S> createSession()Creates a newSessionthat is capable of being persisted by thisReactiveSessionRepository.This allows optimizations and customizations in how the
Sessionis 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
Sessionthat is capable of being persisted by thisReactiveSessionRepository
-
save
Ensures theSessioncreated bycreateSession()is saved.Some implementations may choose to save as the
Sessionis updated by returning aSessionthat immediately persists any changes. In this case, this method may not actually do anything.- Parameters:
session- theSessionto save- Returns:
- indicator of operation completion
-
findById
- Parameters:
id- theSession.getId()to lookup- Returns:
- the
Sessionby theSession.getId()or null if noSessionis found.
-
deleteById
- Parameters:
id- theSession.getId()to delete- Returns:
- indicator of operation completion
-