public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider
MongoDatabase
instances.Modifier and Type | Method and Description |
---|---|
default org.bson.codecs.configuration.CodecRegistry |
getCodecRegistry()
Get the underlying
CodecRegistry used by the reactive MongoDB Java driver. |
PersistenceExceptionTranslator |
getExceptionTranslator()
Exposes a shared
MongoExceptionTranslator . |
com.mongodb.reactivestreams.client.MongoDatabase |
getMongoDatabase()
Creates a default
MongoDatabase instance. |
com.mongodb.reactivestreams.client.MongoDatabase |
getMongoDatabase(String dbName)
Creates a
MongoDatabase instance to access the database with the given name. |
reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.ClientSession> |
getSession(com.mongodb.ClientSessionOptions options)
Obtain a
Mono emitting a ClientSession for given options . |
default boolean |
isTransactionActive()
Returns if the given
ReactiveMongoDatabaseFactory is bound to a
ClientSession that has an
active transaction . |
ReactiveMongoDatabaseFactory |
withSession(com.mongodb.reactivestreams.client.ClientSession session)
Obtain a
ClientSession bound instance of ReactiveMongoDatabaseFactory returning
MongoDatabase instances that are aware and bound to the given session. |
getCodecFor, hasCodecFor
com.mongodb.reactivestreams.client.MongoDatabase getMongoDatabase() throws DataAccessException
MongoDatabase
instance.DataAccessException
com.mongodb.reactivestreams.client.MongoDatabase getMongoDatabase(String dbName) throws DataAccessException
MongoDatabase
instance to access the database with the given name.dbName
- must not be null or empty.DataAccessException
PersistenceExceptionTranslator getExceptionTranslator()
MongoExceptionTranslator
.default org.bson.codecs.configuration.CodecRegistry getCodecRegistry()
CodecRegistry
used by the reactive MongoDB Java driver.getCodecRegistry
in interface CodecRegistryProvider
reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.ClientSession> getSession(com.mongodb.ClientSessionOptions options)
Mono
emitting a ClientSession
for given options
.options
- must not be null.ReactiveMongoDatabaseFactory withSession(com.mongodb.reactivestreams.client.ClientSession session)
ClientSession
bound instance of ReactiveMongoDatabaseFactory
returning
MongoDatabase
instances that are aware and bound to the given session.session
- must not be null.default boolean isTransactionActive()
ReactiveMongoDatabaseFactory
is bound to a
ClientSession
that has an
active transaction
.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.