public class ReactiveMongoSessionRepository extends Object implements org.springframework.session.ReactiveSessionRepository<MongoSession>, ApplicationEventPublisherAware, InitializingBean
ReactiveSessionRepository
implementation that uses Spring Data MongoDB.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_COLLECTION_NAME
The default collection name for storing session.
|
static int |
DEFAULT_INACTIVE_INTERVAL
The default time period in seconds in which a session will expire.
|
Constructor and Description |
---|
ReactiveMongoSessionRepository(org.springframework.data.mongodb.core.ReactiveMongoOperations mongoOperations) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Do not use
ReactiveIndexOperations to ensure indexes exist. |
reactor.core.publisher.Mono<MongoSession> |
createSession()
Creates a new
MongoSession that is capable of being persisted by this ReactiveSessionRepository . |
reactor.core.publisher.Mono<Void> |
deleteById(String id) |
reactor.core.publisher.Mono<MongoSession> |
findById(String id) |
String |
getCollectionName() |
Integer |
getMaxInactiveIntervalInSeconds() |
reactor.core.publisher.Mono<Void> |
save(MongoSession session) |
void |
setApplicationEventPublisher(ApplicationEventPublisher eventPublisher) |
void |
setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations) |
void |
setCollectionName(String collectionName) |
void |
setMaxInactiveIntervalInSeconds(Integer maxInactiveIntervalInSeconds) |
void |
setMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter) |
public static final int DEFAULT_INACTIVE_INTERVAL
public static final String DEFAULT_COLLECTION_NAME
public ReactiveMongoSessionRepository(org.springframework.data.mongodb.core.ReactiveMongoOperations mongoOperations)
public reactor.core.publisher.Mono<MongoSession> createSession()
MongoSession
that is capable of being persisted by this ReactiveSessionRepository
.
This allows optimizations and customizations in how the MongoSession
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.
createSession
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
MongoSession
that is capable of being persisted by this ReactiveSessionRepository
public reactor.core.publisher.Mono<Void> save(MongoSession session)
save
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
public reactor.core.publisher.Mono<MongoSession> findById(String id)
findById
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
public reactor.core.publisher.Mono<Void> deleteById(String id)
deleteById
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
public void afterPropertiesSet()
ReactiveIndexOperations
to ensure indexes exist.
Instead, get a blocking IndexOperations
and use that instead, if possible.afterPropertiesSet
in interface InitializingBean
public void setApplicationEventPublisher(ApplicationEventPublisher eventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
public Integer getMaxInactiveIntervalInSeconds()
public void setMaxInactiveIntervalInSeconds(Integer maxInactiveIntervalInSeconds)
public String getCollectionName()
public void setCollectionName(String collectionName)
public void setMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter)
public void setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations)
Copyright © 2014-2019–2020 Pivotal, Inc.. All rights reserved.