Class CollectionShardedReactiveMongoTemplate
- java.lang.Object
-
- org.springframework.data.mongodb.core.ReactiveMongoTemplate
-
- com.alpha.mongodb.sharding.core.template.ShardedReactiveMongoTemplate
-
- com.alpha.mongodb.sharding.core.template.CollectionShardedReactiveMongoTemplate
-
- All Implemented Interfaces:
CollectionShardingAssistant
,ShardingAssistant
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.data.mongodb.core.ReactiveAggregationOperation
,org.springframework.data.mongodb.core.ReactiveChangeStreamOperation
,org.springframework.data.mongodb.core.ReactiveFindOperation
,org.springframework.data.mongodb.core.ReactiveFluentMongoOperations
,org.springframework.data.mongodb.core.ReactiveInsertOperation
,org.springframework.data.mongodb.core.ReactiveMapReduceOperation
,org.springframework.data.mongodb.core.ReactiveMongoOperations
,org.springframework.data.mongodb.core.ReactiveRemoveOperation
,org.springframework.data.mongodb.core.ReactiveUpdateOperation
public class CollectionShardedReactiveMongoTemplate extends ShardedReactiveMongoTemplate implements CollectionShardingAssistant
Collection Sharded Reactive Mongo Template for users who use reactive mongo template.- Author:
- Shashank Sharma
- See Also:
CollectionShardedMongoTemplate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveAggregationOperation
org.springframework.data.mongodb.core.ReactiveAggregationOperation.AggregationOperationWithAggregation<T extends Object>, org.springframework.data.mongodb.core.ReactiveAggregationOperation.AggregationOperationWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveAggregationOperation.ReactiveAggregation<T extends Object>, org.springframework.data.mongodb.core.ReactiveAggregationOperation.TerminatingAggregationOperation<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveChangeStreamOperation
org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.ChangeStreamWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.ChangeStreamWithFilterAndProjection<T extends Object>, org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.ChangeStreamWithOptions<T extends Object>, org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.ReactiveChangeStream<T extends Object>, org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.ResumingChangeStream<T extends Object>, org.springframework.data.mongodb.core.ReactiveChangeStreamOperation.TerminatingChangeStream<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveFindOperation
org.springframework.data.mongodb.core.ReactiveFindOperation.DistinctWithProjection, org.springframework.data.mongodb.core.ReactiveFindOperation.DistinctWithQuery<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.FindDistinct, org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithProjection<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithQuery<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.ReactiveFind<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.TerminatingDistinct<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.TerminatingFind<T extends Object>, org.springframework.data.mongodb.core.ReactiveFindOperation.TerminatingFindNear<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveInsertOperation
org.springframework.data.mongodb.core.ReactiveInsertOperation.InsertWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveInsertOperation.ReactiveInsert<T extends Object>, org.springframework.data.mongodb.core.ReactiveInsertOperation.TerminatingInsert<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveMapReduceOperation
org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithMapFunction<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithOptions<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithProjection<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithQuery<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.MapReduceWithReduceFunction<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.ReactiveMapReduce<T extends Object>, org.springframework.data.mongodb.core.ReactiveMapReduceOperation.TerminatingMapReduce<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveRemoveOperation
org.springframework.data.mongodb.core.ReactiveRemoveOperation.ReactiveRemove<T extends Object>, org.springframework.data.mongodb.core.ReactiveRemoveOperation.RemoveWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveRemoveOperation.RemoveWithQuery<T extends Object>, org.springframework.data.mongodb.core.ReactiveRemoveOperation.TerminatingRemove<T extends Object>
-
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.ReactiveUpdateOperation
org.springframework.data.mongodb.core.ReactiveUpdateOperation.FindAndModifyWithOptions<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.FindAndReplaceWithOptions<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.FindAndReplaceWithProjection<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.ReactiveUpdate<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.TerminatingFindAndModify<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.TerminatingFindAndReplace<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.TerminatingUpdate<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.UpdateWithCollection<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.UpdateWithQuery<T extends Object>, org.springframework.data.mongodb.core.ReactiveUpdateOperation.UpdateWithUpdate<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description CollectionShardedReactiveMongoTemplate(com.mongodb.reactivestreams.client.MongoClient mongoClient, String databaseName, CollectionShardingOptions collectionShardingOptions)
CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, CollectionShardingOptions collectionShardingOptions)
CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter, CollectionShardingOptions collectionShardingOptions)
CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter, Consumer<Throwable> subscriptionExceptionHandler, CollectionShardingOptions collectionShardingOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Boolean>
collectionExists(String collectionName)
reactor.core.publisher.Mono<Boolean>
collectionExists(String collectionName, String collectionHint)
protected reactor.core.publisher.Mono<Long>
doCount(String collectionName, org.bson.Document filter, com.mongodb.client.model.CountOptions options)
protected reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document>>
doCreateCollection(String collectionName, com.mongodb.client.model.CreateCollectionOptions collectionOptions)
protected reactor.core.publisher.Mono<Long>
doEstimatedCount(String collectionName, com.mongodb.client.model.EstimatedDocumentCountOptions options)
protected <T> reactor.core.publisher.Flux<T>
doFind(String collectionName, org.bson.Document query, org.bson.Document fields, Class<T> entityClass, org.springframework.data.mongodb.core.FindPublisherPreparer preparer)
protected <T> reactor.core.publisher.Flux<T>
doFindAndDelete(String collectionName, org.springframework.data.mongodb.core.query.Query query, Class<T> entityClass)
protected <T> reactor.core.publisher.Mono<T>
doFindAndRemove(String collectionName, org.bson.Document query, org.bson.Document fields, org.bson.Document sort, org.springframework.data.mongodb.core.query.Collation collation, Class<T> entityClass)
protected <T> reactor.core.publisher.Mono<T>
doFindOne(String collectionName, org.bson.Document query, org.bson.Document fields, Class<T> entityClass, org.springframework.data.mongodb.core.FindPublisherPreparer preparer)
protected <T> reactor.core.publisher.Mono<T>
doInsert(String collectionName, T objectToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
protected <T> reactor.core.publisher.Flux<T>
doInsertBatch(String collectionName, Collection<? extends T> batchToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
protected <T> reactor.core.publisher.Mono<com.mongodb.client.result.DeleteResult>
doRemove(String collectionName, org.springframework.data.mongodb.core.query.Query query, Class<T> entityClass)
protected <T> reactor.core.publisher.Mono<T>
doSave(String collectionName, T objectToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
protected reactor.core.publisher.Mono<com.mongodb.client.result.UpdateResult>
doUpdate(String collectionName, org.springframework.data.mongodb.core.query.Query query, org.springframework.data.mongodb.core.query.UpdateDefinition update, Class<?> entityClass, boolean upsert, boolean multi)
reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document>>
getCollection(String collectionName)
-
Methods inherited from class com.alpha.mongodb.sharding.core.template.ShardedReactiveMongoTemplate
setApplicationContext
-
Methods inherited from class org.springframework.data.mongodb.core.ReactiveMongoTemplate
aggregate, aggregate, aggregate, aggregate, aggregateAndReturn, changeStream, changeStream, collectionExists, convertToCreateCollectionOptions, convertToCreateCollectionOptions, count, count, count, countCanBeEstimated, createCollection, createCollection, createCollection, createCollection, createFlux, createFlux, createMono, createMono, doAggregate, doExactCount, doFind, doFind, doFindAndModify, doFindAndReplace, doFindOne, doGetDatabase, doInsertAll, dropCollection, dropCollection, ensureNotCollectionLike, ensureNotIterable, estimatedCount, exactCount, execute, execute, execute, executeCommand, executeCommand, executeCommand, exists, exists, exists, find, find, findAll, findAll, findAllAndRemove, findAllAndRemove, findAllAndRemove, findAndModify, findAndModify, findAndModify, findAndModify, findAndRemove, findAndRemove, findAndReplace, findById, findById, findDistinct, findDistinct, findOne, findOne, geoNear, geoNear, geoNear, getCollectionName, getCollectionNames, getConverter, getMongoDatabase, getMongoDatabaseFactory, indexOps, indexOps, insert, insert, insert, insert, insert, insert, insertAll, insertAll, insertAll, insertAll, insertDocument, insertDocumentList, inTransaction, inTransaction, mapReduce, mapReduce, mapReduce, maybeCallAfterConvert, maybeCallAfterSave, maybeCallBeforeConvert, maybeCallBeforeSave, maybeEmitEvent, prepareCollection, prepareDatabase, prepareWriteConcern, query, remove, remove, remove, remove, remove, remove, remove, remove, save, save, save, save, saveDocument, setEntityCallbacks, setReadPreference, setSessionSynchronization, setWriteConcern, setWriteConcernResolver, setWriteResultChecking, tail, tail, update, updateFirst, updateFirst, updateFirst, updateMulti, updateMulti, updateMulti, upsert, upsert, upsert, useEstimatedCount, withSession, withSession, withSession
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.alpha.mongodb.sharding.core.assitant.CollectionShardingAssistant
resolveCollectionNameForDeleteContext, resolveCollectionNameForDeleteContext, resolveCollectionNameForFindContext, resolveCollectionNameForFindContext, resolveCollectionNameForSaveContext, resolveCollectionNameForUpdateContext, resolveCollectionNameWithEntityContext, validateCollectionHint
-
Methods inherited from interface org.springframework.data.mongodb.core.ReactiveMongoOperations
changeStream, changeStream, estimatedCount, exactCount, exactCount, findAndReplace, findAndReplace, findAndReplace, findAndReplace, findAndReplace, findAndReplace, findDistinct, findDistinct, withSession
-
Methods inherited from interface com.alpha.mongodb.sharding.core.assitant.ShardingAssistant
getHintResolutionCallbacks, getShardingOptions, resolveCollectionHintWithoutEntityContext, resolveCollectionNameWithoutEntityContext, resolveDatabaseHintWithoutEntityContext, resolveDatabaseNameWithoutEntityContext
-
-
-
-
Constructor Detail
-
CollectionShardedReactiveMongoTemplate
public CollectionShardedReactiveMongoTemplate(com.mongodb.reactivestreams.client.MongoClient mongoClient, String databaseName, CollectionShardingOptions collectionShardingOptions)
-
CollectionShardedReactiveMongoTemplate
public CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, CollectionShardingOptions collectionShardingOptions)
-
CollectionShardedReactiveMongoTemplate
public CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter, CollectionShardingOptions collectionShardingOptions)
-
CollectionShardedReactiveMongoTemplate
public CollectionShardedReactiveMongoTemplate(org.springframework.data.mongodb.ReactiveMongoDatabaseFactory mongoDatabaseFactory, org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter, Consumer<Throwable> subscriptionExceptionHandler, CollectionShardingOptions collectionShardingOptions)
-
-
Method Detail
-
doRemove
protected <T> reactor.core.publisher.Mono<com.mongodb.client.result.DeleteResult> doRemove(String collectionName, org.springframework.data.mongodb.core.query.Query query, Class<T> entityClass)
- Overrides:
doRemove
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doInsert
protected <T> reactor.core.publisher.Mono<T> doInsert(String collectionName, T objectToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
- Overrides:
doInsert
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doInsertBatch
protected <T> reactor.core.publisher.Flux<T> doInsertBatch(String collectionName, Collection<? extends T> batchToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
- Overrides:
doInsertBatch
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doSave
protected <T> reactor.core.publisher.Mono<T> doSave(String collectionName, T objectToSave, org.springframework.data.mongodb.core.convert.MongoWriter<Object> writer)
- Overrides:
doSave
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doFindOne
protected <T> reactor.core.publisher.Mono<T> doFindOne(String collectionName, org.bson.Document query, org.bson.Document fields, Class<T> entityClass, org.springframework.data.mongodb.core.FindPublisherPreparer preparer)
- Overrides:
doFindOne
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doFind
protected <T> reactor.core.publisher.Flux<T> doFind(String collectionName, org.bson.Document query, org.bson.Document fields, Class<T> entityClass, org.springframework.data.mongodb.core.FindPublisherPreparer preparer)
- Overrides:
doFind
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doFindAndDelete
protected <T> reactor.core.publisher.Flux<T> doFindAndDelete(String collectionName, org.springframework.data.mongodb.core.query.Query query, Class<T> entityClass)
- Overrides:
doFindAndDelete
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doFindAndRemove
protected <T> reactor.core.publisher.Mono<T> doFindAndRemove(String collectionName, org.bson.Document query, org.bson.Document fields, org.bson.Document sort, org.springframework.data.mongodb.core.query.Collation collation, Class<T> entityClass)
- Overrides:
doFindAndRemove
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doUpdate
protected reactor.core.publisher.Mono<com.mongodb.client.result.UpdateResult> doUpdate(String collectionName, org.springframework.data.mongodb.core.query.Query query, org.springframework.data.mongodb.core.query.UpdateDefinition update, Class<?> entityClass, boolean upsert, boolean multi)
- Overrides:
doUpdate
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doCount
protected reactor.core.publisher.Mono<Long> doCount(String collectionName, org.bson.Document filter, com.mongodb.client.model.CountOptions options)
- Overrides:
doCount
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
doEstimatedCount
protected reactor.core.publisher.Mono<Long> doEstimatedCount(String collectionName, com.mongodb.client.model.EstimatedDocumentCountOptions options)
- Overrides:
doEstimatedCount
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
getCollection
public reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document>> getCollection(String collectionName)
- Specified by:
getCollection
in interfaceorg.springframework.data.mongodb.core.ReactiveMongoOperations
- Overrides:
getCollection
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
collectionExists
public reactor.core.publisher.Mono<Boolean> collectionExists(String collectionName)
- Specified by:
collectionExists
in interfaceorg.springframework.data.mongodb.core.ReactiveMongoOperations
- Overrides:
collectionExists
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
collectionExists
public reactor.core.publisher.Mono<Boolean> collectionExists(String collectionName, String collectionHint)
-
doCreateCollection
protected reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document>> doCreateCollection(String collectionName, com.mongodb.client.model.CreateCollectionOptions collectionOptions)
- Overrides:
doCreateCollection
in classorg.springframework.data.mongodb.core.ReactiveMongoTemplate
-
-