Class ReactiveRedisSessionRepository
java.lang.Object
org.springframework.session.data.redis.ReactiveRedisSessionRepository
- All Implemented Interfaces:
org.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
- Direct Known Subclasses:
ReactiveRedisOperationsSessionRepository
public class ReactiveRedisSessionRepository
extends Object
implements org.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
A
ReactiveSessionRepository that is implemented using Spring Data's
ReactiveRedisOperations.- Since:
- 2.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default namespace for each key and channel in Redis used by Spring Session. -
Constructor Summary
ConstructorsConstructorDescriptionReactiveRedisSessionRepository(org.springframework.data.redis.core.ReactiveRedisOperations<String, Object> sessionRedisOperations) Create a newReactiveRedisSessionRepositoryinstance. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>reactor.core.publisher.Mono<Void>deleteById(String id) reactor.core.publisher.Mono<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>Returns theReactiveRedisOperationsused for sessions.reactor.core.publisher.Mono<Void>save(org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession session) voidsetDefaultMaxInactiveInterval(int defaultMaxInactiveInterval) Sets the maximum inactive interval in seconds between requests before newly created sessions will be invalidated.voidsetRedisKeyNamespace(String namespace) voidsetSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode.
-
Field Details
-
DEFAULT_NAMESPACE
The default namespace for each key and channel in Redis used by Spring Session.- See Also:
-
-
Constructor Details
-
ReactiveRedisSessionRepository
public ReactiveRedisSessionRepository(org.springframework.data.redis.core.ReactiveRedisOperations<String, Object> sessionRedisOperations) Create a newReactiveRedisSessionRepositoryinstance.- Parameters:
sessionRedisOperations- theReactiveRedisOperationsto use for managing sessions
-
-
Method Details
-
setRedisKeyNamespace
-
setDefaultMaxInactiveInterval
public void setDefaultMaxInactiveInterval(int defaultMaxInactiveInterval) Sets the maximum inactive interval in seconds between requests before newly created sessions will be invalidated. A negative time indicates that the session will never timeout. The default is 1800 (30 minutes).- Parameters:
defaultMaxInactiveInterval- the number of seconds that theSessionshould be kept alive between client requests.
-
setSaveMode
public void setSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode.- Parameters:
saveMode- the save mode
-
getSessionRedisOperations
public org.springframework.data.redis.core.ReactiveRedisOperations<String,Object> getSessionRedisOperations()Returns theReactiveRedisOperationsused for sessions.- Returns:
- the
ReactiveRedisOperationsused for sessions
-
createSession
public reactor.core.publisher.Mono<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession> createSession()- Specified by:
createSessionin interfaceorg.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
-
save
public reactor.core.publisher.Mono<Void> save(org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession session) - Specified by:
savein interfaceorg.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
-
findById
public reactor.core.publisher.Mono<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession> findById(String id) - Specified by:
findByIdin interfaceorg.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
-
deleteById
- Specified by:
deleteByIdin interfaceorg.springframework.session.ReactiveSessionRepository<org.springframework.session.data.redis.ReactiveRedisSessionRepository.RedisSession>
-