public class ReactiveMongoSessionRepository extends java.lang.Object implements org.springframework.session.ReactiveSessionRepository<MongoSession>, org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean
ReactiveSessionRepository implementation that uses Spring Data MongoDB.| Modifier and Type | Field and Description |
|---|---|
static java.lang.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<java.lang.Void> |
deleteById(java.lang.String id) |
reactor.core.publisher.Mono<MongoSession> |
findById(java.lang.String id) |
java.lang.String |
getCollectionName() |
java.lang.Integer |
getMaxInactiveIntervalInSeconds() |
reactor.core.publisher.Mono<java.lang.Void> |
save(MongoSession session) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher) |
void |
setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations) |
void |
setCollectionName(java.lang.String collectionName) |
void |
setMaxInactiveIntervalInSeconds(java.lang.Integer maxInactiveIntervalInSeconds) |
void |
setMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter) |
public static final int DEFAULT_INACTIVE_INTERVAL
public static final java.lang.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
ReactiveSessionRepositorypublic reactor.core.publisher.Mono<java.lang.Void> save(MongoSession session)
save in interface org.springframework.session.ReactiveSessionRepository<MongoSession>public reactor.core.publisher.Mono<MongoSession> findById(java.lang.String id)
findById in interface org.springframework.session.ReactiveSessionRepository<MongoSession>public reactor.core.publisher.Mono<java.lang.Void> deleteById(java.lang.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 org.springframework.beans.factory.InitializingBeanpublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic java.lang.Integer getMaxInactiveIntervalInSeconds()
public void setMaxInactiveIntervalInSeconds(java.lang.Integer maxInactiveIntervalInSeconds)
public java.lang.String getCollectionName()
public void setCollectionName(java.lang.String collectionName)
public void setMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter)
public void setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations)