public class ReactiveMongoOperationsSessionRepository extends Object implements org.springframework.session.ReactiveSessionRepository<MongoSession>, ApplicationEventPublisherAware, InitializingBean
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 |
---|
ReactiveMongoOperationsSessionRepository(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)
Deletes the
MongoSession with the given MongoSession.getId() or does nothing
if the MongoSession is not found. |
reactor.core.publisher.Mono<MongoSession> |
findById(String id)
|
org.springframework.data.mongodb.core.MongoOperations |
getBlockingMongoOperations() |
String |
getCollectionName() |
Integer |
getMaxInactiveIntervalInSeconds() |
reactor.core.publisher.Mono<Void> |
save(MongoSession session)
Ensures the
MongoSession created by
ReactiveSessionRepository.createSession() is saved. |
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 ReactiveMongoOperationsSessionRepository(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)
MongoSession
created by
ReactiveSessionRepository.createSession()
is saved.
Some implementations may choose to save as the MongoSession
is updated by
returning a MongoSession
that immediately persists any changes. In this case,
this method may not actually do anything.
save
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
session
- the MongoSession
to savepublic reactor.core.publisher.Mono<MongoSession> findById(String id)
findById
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
id
- the MongoSession.getId()
to lookupMongoSession
by the MongoSession.getId()
or null if no
MongoSession
is found.public reactor.core.publisher.Mono<Void> deleteById(String id)
MongoSession
with the given MongoSession.getId()
or does nothing
if the MongoSession
is not found.deleteById
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
id
- the MongoSession.getId()
to deletepublic void afterPropertiesSet()
ReactiveIndexOperations
to ensure indexes exist.
Instead, get a blocking IndexOperations
and use that instead, if possible.afterPropertiesSet
in interface InitializingBean
public void setMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter)
public void setMaxInactiveIntervalInSeconds(Integer maxInactiveIntervalInSeconds)
public Integer getMaxInactiveIntervalInSeconds()
public void setCollectionName(String collectionName)
public String getCollectionName()
public org.springframework.data.mongodb.core.MongoOperations getBlockingMongoOperations()
public void setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations)
public void setApplicationEventPublisher(ApplicationEventPublisher eventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
Copyright © 2014-2018–2019 Pivotal, Inc.. All rights reserved.