Class ReactiveCouchbaseTemplate
java.lang.Object
org.springframework.data.couchbase.core.ReactiveCouchbaseTemplate
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,ReactiveCouchbaseOperations
,ReactiveExistsByIdOperation
,ReactiveFindByAnalyticsOperation
,ReactiveFindByIdOperation
,ReactiveFindByQueryOperation
,ReactiveFindFromReplicasByIdOperation
,ReactiveFluentCouchbaseOperations
,ReactiveInsertByIdOperation
,ReactiveRemoveByIdOperation
,ReactiveRemoveByQueryOperation
,ReactiveReplaceByIdOperation
,ReactiveUpsertByIdOperation
public class ReactiveCouchbaseTemplate
extends Object
implements ReactiveCouchbaseOperations, ApplicationContextAware
template class for Reactive Couchbase operations
- Author:
- Michael Nitschinger, Michael Reiche, Jorge Rodriguez Martin, Carlos Espinaco
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveExistsByIdOperation
ReactiveExistsByIdOperation.ExistsByIdInCollection, ReactiveExistsByIdOperation.ExistsByIdInScope, ReactiveExistsByIdOperation.ExistsByIdWithOptions, ReactiveExistsByIdOperation.ReactiveExistsById, ReactiveExistsByIdOperation.TerminatingExistsById
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveFindByAnalyticsOperation
ReactiveFindByAnalyticsOperation.FindByAnalyticsConsistentWith<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsInCollection<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsInScope<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsWithConsistency<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsWithOptions<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsWithProjection<T>, ReactiveFindByAnalyticsOperation.FindByAnalyticsWithQuery<T>, ReactiveFindByAnalyticsOperation.ReactiveFindByAnalytics<T>, ReactiveFindByAnalyticsOperation.TerminatingFindByAnalytics<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveFindByIdOperation
ReactiveFindByIdOperation.FindByIdInCollection<T>, ReactiveFindByIdOperation.FindByIdInScope<T>, ReactiveFindByIdOperation.FindByIdWithExpiry<T>, ReactiveFindByIdOperation.FindByIdWithOptions<T>, ReactiveFindByIdOperation.FindByIdWithProjection<T>, ReactiveFindByIdOperation.ReactiveFindById<T>, ReactiveFindByIdOperation.TerminatingFindById<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveFindByQueryOperation
ReactiveFindByQueryOperation.FindByQueryConsistentWith<T>, ReactiveFindByQueryOperation.FindByQueryInCollection<T>, ReactiveFindByQueryOperation.FindByQueryInScope<T>, ReactiveFindByQueryOperation.FindByQueryWithConsistency<T>, ReactiveFindByQueryOperation.FindByQueryWithDistinct<T>, ReactiveFindByQueryOperation.FindByQueryWithOptions<T>, ReactiveFindByQueryOperation.FindByQueryWithProjecting<T>, ReactiveFindByQueryOperation.FindByQueryWithProjection<T>, ReactiveFindByQueryOperation.FindByQueryWithQuery<T>, ReactiveFindByQueryOperation.ReactiveFindByQuery<T>, ReactiveFindByQueryOperation.TerminatingFindByQuery<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveFindFromReplicasByIdOperation
ReactiveFindFromReplicasByIdOperation.FindFromReplicasByIdInCollection<T>, ReactiveFindFromReplicasByIdOperation.FindFromReplicasByIdInScope<T>, ReactiveFindFromReplicasByIdOperation.FindFromReplicasByIdWithOptions<T>, ReactiveFindFromReplicasByIdOperation.ReactiveFindFromReplicasById<T>, ReactiveFindFromReplicasByIdOperation.TerminatingFindFromReplicasById<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveInsertByIdOperation
ReactiveInsertByIdOperation.InsertByIdInCollection<T>, ReactiveInsertByIdOperation.InsertByIdInScope<T>, ReactiveInsertByIdOperation.InsertByIdWithDurability<T>, ReactiveInsertByIdOperation.InsertByIdWithExpiry<T>, ReactiveInsertByIdOperation.InsertByIdWithOptions<T>, ReactiveInsertByIdOperation.ReactiveInsertById<T>, ReactiveInsertByIdOperation.TerminatingInsertById<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveRemoveByIdOperation
ReactiveRemoveByIdOperation.ReactiveRemoveById, ReactiveRemoveByIdOperation.RemoveByIdInCollection, ReactiveRemoveByIdOperation.RemoveByIdInScope, ReactiveRemoveByIdOperation.RemoveByIdWithCas, ReactiveRemoveByIdOperation.RemoveByIdWithDurability, ReactiveRemoveByIdOperation.RemoveByIdWithOptions, ReactiveRemoveByIdOperation.TerminatingRemoveById
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveRemoveByQueryOperation
ReactiveRemoveByQueryOperation.ReactiveRemoveByQuery<T>, ReactiveRemoveByQueryOperation.RemoveByQueryConsistentWith<T>, ReactiveRemoveByQueryOperation.RemoveByQueryInCollection<T>, ReactiveRemoveByQueryOperation.RemoveByQueryInScope<T>, ReactiveRemoveByQueryOperation.RemoveByQueryWithConsistency<T>, ReactiveRemoveByQueryOperation.RemoveByQueryWithOptions<T>, ReactiveRemoveByQueryOperation.RemoveByQueryWithQuery<T>, ReactiveRemoveByQueryOperation.TerminatingRemoveByQuery<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveReplaceByIdOperation
ReactiveReplaceByIdOperation.ReactiveReplaceById<T>, ReactiveReplaceByIdOperation.ReplaceByIdInCollection<T>, ReactiveReplaceByIdOperation.ReplaceByIdInScope<T>, ReactiveReplaceByIdOperation.ReplaceByIdWithDurability<T>, ReactiveReplaceByIdOperation.ReplaceByIdWithExpiry<T>, ReactiveReplaceByIdOperation.ReplaceByIdWithOptions<T>, ReactiveReplaceByIdOperation.TerminatingReplaceById<T>
Nested classes/interfaces inherited from interface org.springframework.data.couchbase.core.ReactiveUpsertByIdOperation
ReactiveUpsertByIdOperation.ReactiveUpsertById<T>, ReactiveUpsertByIdOperation.TerminatingUpsertById<T>, ReactiveUpsertByIdOperation.UpsertByIdInCollection<T>, ReactiveUpsertByIdOperation.UpsertByIdInScope<T>, ReactiveUpsertByIdOperation.UpsertByIdWithDurability<T>, ReactiveUpsertByIdOperation.UpsertByIdWithExpiry<T>, ReactiveUpsertByIdOperation.UpsertByIdWithOptions<T>
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveCouchbaseTemplate
(CouchbaseClientFactory clientFactory, CouchbaseConverter converter) ReactiveCouchbaseTemplate
(CouchbaseClientFactory clientFactory, CouchbaseConverter converter, TranslationService translationService) ReactiveCouchbaseTemplate
(CouchbaseClientFactory clientFactory, CouchbaseConverter converter, TranslationService translationService, com.couchbase.client.java.query.QueryScanConsistency scanConsistency) -
Method Summary
Modifier and TypeMethodDescriptionChecks if the document exists in the bucket.existsById
(Class<?> domainType) Checks if the document exists in the bucket.findByAnalytics
(Class<T> domainType) Queries the analytics service.Loads a document from a bucket.findByQuery
(Class<T> domainType) Create the operation for the domainTypefindFromReplicasById
(Class<T> domainType) Loads a document from a replica.The name of the bucket used.com.couchbase.client.java.Collection
getCollection
(String collectionName) Provides access to aCollection
on the configuredCouchbaseClientFactory
.com.couchbase.client.java.query.QueryScanConsistency
Returns the converter used for this template/operations.Returns the underlying client factory.PseudoArgs<?>
The name of the scope used, null if the default scope is used.insertById
(Class<T> domainType) Insert using the KV service.Removes a document.removeById
(Class<?> domainType) Removes a document.removeByQuery
(Class<T> domainType) Remove via the query service.replaceById
(Class<T> domainType) Replace using the KV service.void
setApplicationContext
(ApplicationContext applicationContext) void
setPseudoArgs
(PseudoArgs<?> threadLocalArgs) set the ThreadLocal fieldsupport()
upsertById
(Class<T> domainType) Upsert using the KV service.
-
Constructor Details
-
ReactiveCouchbaseTemplate
public ReactiveCouchbaseTemplate(CouchbaseClientFactory clientFactory, CouchbaseConverter converter) -
ReactiveCouchbaseTemplate
public ReactiveCouchbaseTemplate(CouchbaseClientFactory clientFactory, CouchbaseConverter converter, TranslationService translationService) -
ReactiveCouchbaseTemplate
public ReactiveCouchbaseTemplate(CouchbaseClientFactory clientFactory, CouchbaseConverter converter, TranslationService translationService, com.couchbase.client.java.query.QueryScanConsistency scanConsistency)
-
-
Method Details
-
findById
Description copied from interface:ReactiveFindByIdOperation
Loads a document from a bucket.- Specified by:
findById
in interfaceReactiveFindByIdOperation
- Parameters:
domainType
- the entity type to use for the results.
-
existsById
Description copied from interface:ReactiveExistsByIdOperation
Checks if the document exists in the bucket.- Specified by:
existsById
in interfaceReactiveExistsByIdOperation
-
existsById
Description copied from interface:ReactiveExistsByIdOperation
Checks if the document exists in the bucket.- Specified by:
existsById
in interfaceReactiveExistsByIdOperation
-
findByAnalytics
public <T> ReactiveFindByAnalyticsOperation.ReactiveFindByAnalytics<T> findByAnalytics(Class<T> domainType) Description copied from interface:ReactiveFindByAnalyticsOperation
Queries the analytics service.- Specified by:
findByAnalytics
in interfaceReactiveFindByAnalyticsOperation
- Parameters:
domainType
- the entity type to use for the results.
-
findByQuery
Description copied from interface:ReactiveFindByQueryOperation
Create the operation for the domainType- Specified by:
findByQuery
in interfaceReactiveFindByQueryOperation
- Parameters:
domainType
- the entity type to use for the results.
-
findFromReplicasById
public <T> ReactiveFindFromReplicasByIdOperation.ReactiveFindFromReplicasById<T> findFromReplicasById(Class<T> domainType) Description copied from interface:ReactiveFindFromReplicasByIdOperation
Loads a document from a replica.- Specified by:
findFromReplicasById
in interfaceReactiveFindFromReplicasByIdOperation
- Parameters:
domainType
- the entity type to use for the results.
-
insertById
Description copied from interface:ReactiveInsertByIdOperation
Insert using the KV service.- Specified by:
insertById
in interfaceReactiveInsertByIdOperation
- Parameters:
domainType
- the entity type to insert.
-
removeById
Description copied from interface:ReactiveRemoveByIdOperation
Removes a document.- Specified by:
removeById
in interfaceReactiveRemoveByIdOperation
-
removeById
Description copied from interface:ReactiveRemoveByIdOperation
Removes a document.- Specified by:
removeById
in interfaceReactiveRemoveByIdOperation
-
removeByQuery
public <T> ReactiveRemoveByQueryOperation.ReactiveRemoveByQuery<T> removeByQuery(Class<T> domainType) Description copied from interface:ReactiveRemoveByQueryOperation
Remove via the query service.- Specified by:
removeByQuery
in interfaceReactiveRemoveByQueryOperation
-
replaceById
Description copied from interface:ReactiveReplaceByIdOperation
Replace using the KV service.- Specified by:
replaceById
in interfaceReactiveReplaceByIdOperation
- Parameters:
domainType
- the entity type to replace.
-
upsertById
Description copied from interface:ReactiveUpsertByIdOperation
Upsert using the KV service.- Specified by:
upsertById
in interfaceReactiveUpsertByIdOperation
- Parameters:
domainType
- the entity type to upsert.
-
getBucketName
Description copied from interface:ReactiveCouchbaseOperations
The name of the bucket used.- Specified by:
getBucketName
in interfaceReactiveCouchbaseOperations
-
getScopeName
Description copied from interface:ReactiveCouchbaseOperations
The name of the scope used, null if the default scope is used.- Specified by:
getScopeName
in interfaceReactiveCouchbaseOperations
-
getCouchbaseClientFactory
Description copied from interface:ReactiveCouchbaseOperations
Returns the underlying client factory.- Specified by:
getCouchbaseClientFactory
in interfaceReactiveCouchbaseOperations
-
getCollection
Provides access to aCollection
on the configuredCouchbaseClientFactory
.- Parameters:
collectionName
- the name of the collection, if null is passed in the default collection is assumed.- Returns:
- the collection instance.
-
getConverter
Description copied from interface:ReactiveCouchbaseOperations
Returns the converter used for this template/operations.- Specified by:
getConverter
in interfaceReactiveCouchbaseOperations
-
support
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
getPseudoArgs
- Returns:
- the pseudoArgs from the ThreadLocal field
-
setPseudoArgs
set the ThreadLocal field -
getConsistency
public com.couchbase.client.java.query.QueryScanConsistency getConsistency()- Specified by:
getConsistency
in interfaceReactiveCouchbaseOperations
- Returns:
- the default consistency to use for queries
-