public class ReactiveMongoDatabaseUtils extends Object
MongoDatabase instances via ReactiveMongoDatabaseFactory. Used for
 obtaining session bound resources, such as MongoDatabase and MongoCollection
 suitable for transactional usage.
 | Constructor and Description | 
|---|
| ReactiveMongoDatabaseUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> | getDatabase(ReactiveMongoDatabaseFactory factory) | 
| static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> | getDatabase(ReactiveMongoDatabaseFactory factory,
           SessionSynchronization sessionSynchronization)Obtain the default  databaseform the givenfactory. | 
| static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> | getDatabase(String dbName,
           ReactiveMongoDatabaseFactory factory) | 
| static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> | getDatabase(String dbName,
           ReactiveMongoDatabaseFactory factory,
           SessionSynchronization sessionSynchronization)Obtain the  databasewith given name form the givenfactory. | 
| static reactor.core.publisher.Mono<Boolean> | isTransactionActive(ReactiveMongoDatabaseFactory databaseFactory)Check if the  ReactiveMongoDatabaseFactoryis actually bound to aClientSessionthat has an active transaction, or if aTransactionSynchronizationhas been registered for theresourceand if the associatedClientSessionhas anactive transaction. | 
public static reactor.core.publisher.Mono<Boolean> isTransactionActive(ReactiveMongoDatabaseFactory databaseFactory)
ReactiveMongoDatabaseFactory is actually bound to a
 ClientSession that has an active transaction, or if a
 TransactionSynchronization has been registered for the
 resource and if the associated
 ClientSession has an
 active transaction.databaseFactory - the resource to check transactions for. Must not be null.Mono emitting true if the factory has an ongoing transaction.public static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> getDatabase(ReactiveMongoDatabaseFactory factory)
database form the given factory using
 native session synchronization.
 MongoDB specific transaction synchronization within the subscriber
 Context if synchronization is active.factory - the ReactiveMongoDatabaseFactory to get the MongoDatabase from.MongoDatabase that is potentially associated with a transactional ClientSession.public static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> getDatabase(ReactiveMongoDatabaseFactory factory, SessionSynchronization sessionSynchronization)
database form the given factory.
 MongoDB specific transaction synchronization within the subscriber
 Context if synchronization is active.factory - the ReactiveMongoDatabaseFactory to get the MongoDatabase from.sessionSynchronization - the synchronization to use. Must not be null.MongoDatabase that is potentially associated with a transactional ClientSession.public static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> getDatabase(String dbName, ReactiveMongoDatabaseFactory factory)
database with given name form the given factory using native session synchronization.
 MongoDB specific transaction synchronization within the subscriber
 Context if synchronization is active.dbName - the name of the MongoDatabase to get.factory - the ReactiveMongoDatabaseFactory to get the MongoDatabase from.MongoDatabase that is potentially associated with a transactional ClientSession.public static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoDatabase> getDatabase(String dbName, ReactiveMongoDatabaseFactory factory, SessionSynchronization sessionSynchronization)
database with given name form the given factory.
 MongoDB specific transaction synchronization within the subscriber
 Context if synchronization is active.dbName - the name of the MongoDatabase to get.factory - the ReactiveMongoDatabaseFactory to get the MongoDatabase from.sessionSynchronization - the synchronization to use. Must not be null.MongoDatabase that is potentially associated with a transactional ClientSession.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.