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 Session.getId() or does nothing if the
MongoSession is not found. |
reactor.core.publisher.Mono<MongoSession> |
findById(String id)
|
reactor.core.publisher.Mono<Void> |
save(MongoSession session)
Ensures the
MongoSession created by ReactiveSessionRepository.createSession() is saved. |
void |
setApplicationEventPublisher(ApplicationEventPublisher eventPublisher) |
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 Session.getId()
to lookupMongoSession
by the Session.getId()
or Mono.empty()
if no
MongoSession
is found.public reactor.core.publisher.Mono<Void> deleteById(String id)
MongoSession
with the given Session.getId()
or does nothing if the
MongoSession
is not found.deleteById
in interface org.springframework.session.ReactiveSessionRepository<MongoSession>
id
- the Session.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 setApplicationEventPublisher(ApplicationEventPublisher eventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
Copyright © 2014-2018–2019 Pivotal, Inc.. All rights reserved.