Interface ReactiveAerospikeOperations
- All Known Implementing Classes:
ReactiveAerospikeTemplate
- Author:
- Igor Ermolenko
-
Method Summary
Modifier and TypeMethodDescription<T> reactor.core.publisher.Mono<T>Reactively add integer/double bin value to existing document bin value, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<T>Reactively add integer/double bin values to existing document bin values, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<T>Reactively append bin string value to existing document bin value, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<T>Reactively append bin string values to existing document bin values, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<Long>Reactively return the amount of documents in the given entityClass's Aerospike set.reactor.core.publisher.Mono<Long>Reactively return the amount of documents in the given Aerospike set.<T> reactor.core.publisher.Mono<Long>Reactively return the amount of documents in a query results. set name will be determined by the given entityClass.<T> reactor.core.publisher.Mono<Void>createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType) Reactively create index by specified name in Aerospike.<T> reactor.core.publisher.Mono<Void>createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType) Reactively create index by specified name in Aerospike.<T> reactor.core.publisher.Mono<Void>Reactively truncate/delete all the documents in the given entity's set.<T> reactor.core.publisher.Mono<Boolean>Reactively delete document by id, set name will be determined by the given entityClass.<T> reactor.core.publisher.Mono<Boolean>delete(T document) Reactively delete document.<T> reactor.core.publisher.Mono<Void>deleteIndex(Class<T> entityClass, String indexName) Reactively delete index by specified name from Aerospike.<T> reactor.core.publisher.Mono<T>Reactively execute operation against underlying store.<T> reactor.core.publisher.Mono<Boolean>Reactively check if document exists by providing document id and entityClass (set name will be determined by the given entityClass).<T> reactor.core.publisher.Flux<T>Reactively find documents in the given entityClass's set using a query and map them to the given class type.<T> reactor.core.publisher.Flux<T>Reactively find all documents in the given entityClass's set and map them to the given class type.<T> reactor.core.publisher.Mono<T>Reactively find a document by id, set name will be determined by the given entityClass.<T> reactor.core.publisher.Flux<T>Reactively find documents by providing multiple ids using a single batch read operation, set name will be determined by the given entityClass.reactor.core.publisher.Mono<GroupedEntities>findByIds(GroupedKeys groupedKeys) Reactively executes a single batch request to get results for several entities.<T> reactor.core.publisher.Flux<T>findInRange(long offset, long limit, Sort sort, Class<T> entityClass) Reactively find documents in the given entityClass's set using a range (offset, limit) and a sort and map them to the given class type.com.aerospike.client.reactor.IAerospikeReactorClientMappingContext<?,?> <T> reactor.core.publisher.Mono<T>insert(T document) Reactively insert document usingRecordExistsAction.CREATE_ONLYpolicy.<T> reactor.core.publisher.Flux<T>insertAll(Collection<? extends T> documents) Reactively insert each document of the given documents using single insert operations.<T> reactor.core.publisher.Mono<T>Reactively prepend bin string value to existing document bin value, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<T>Reactively prepend bin string values to existing document bin values, read the new modified document and map it back the the given document class type.<T> reactor.core.publisher.Mono<T>save(T document) Reactively save document.<T> reactor.core.publisher.Mono<T>update(T document) Reactively update document usingRecordExistsAction.REPLACE_ONLYpolicy taking into consideration the version property of the document if it is present.
-
Method Details
-
getMappingContext
MappingContext<?,?> getMappingContext()- Returns:
- mapping context in use.
-
getAerospikeReactorClient
com.aerospike.client.reactor.IAerospikeReactorClient getAerospikeReactorClient()- Returns:
- aerospike reactive client in use.
-
save
<T> reactor.core.publisher.Mono<T> save(T document) Reactively save document.If document has version property - CAS algorithm is used for updating record. Version property is used for deciding whether to create new record or update existing. If version is set to zero - new record will be created, creation will fail is such record already exists. If version is greater than zero - existing record will be updated with
RecordExistsAction.REPLACE_ONLYpolicy taking into consideration the version property of the document. Version property will be updated with the server's version after successful operation.If document does not have version property - record is updated with
RecordExistsAction.REPLACEpolicy. This means that when such record does not exist it will be created, otherwise updated.- Parameters:
document- The document to save. Must not be null.- Returns:
- A Mono of the new saved document.
-
insertAll
Reactively insert each document of the given documents using single insert operations.- Parameters:
documents- The documents to insert. Must not be null.- Returns:
- A Flux of the new inserted documents.
-
insert
<T> reactor.core.publisher.Mono<T> insert(T document) Reactively insert document usingRecordExistsAction.CREATE_ONLYpolicy.If document has version property it will be updated with the server's version after successful operation.
- Parameters:
document- The document to insert. Must not be null.- Returns:
- A Mono of the new inserted document.
-
update
<T> reactor.core.publisher.Mono<T> update(T document) Reactively update document usingRecordExistsAction.REPLACE_ONLYpolicy taking into consideration the version property of the document if it is present.If document has version property it will be updated with the server's version after successful operation.
- Parameters:
document- The document to update. Must not be null.- Returns:
- A Mono of the new updated document.
-
add
Reactively add integer/double bin values to existing document bin values, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.values- a Map of bin names and values to add. Must not be null.- Returns:
- A Mono of the modified document after add operations.
-
add
Reactively add integer/double bin value to existing document bin value, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.binName- Bin name to use add operation on. Must not be null.value- The value to add.- Returns:
- A Mono of the modified document after add operation.
-
append
Reactively append bin string values to existing document bin values, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.values- a Map of bin names and values to append. Must not be null.- Returns:
- A Mono of the modified document after append operations.
-
append
Reactively append bin string value to existing document bin value, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.binName- Bin name to use append operation on.value- The value to append.- Returns:
- A Mono of the modified document after append operation.
-
prepend
Reactively prepend bin string values to existing document bin values, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.values- a Map of bin names and values to prepend. Must not be null.- Returns:
- A Mono of the modified document after prepend operations.
-
prepend
Reactively prepend bin string value to existing document bin value, read the new modified document and map it back the the given document class type.- Parameters:
document- The document to extract the Aerospike set from and to map the documents to. Must not be null.binName- Bin name to use prepend operation on.value- The value to prepend.- Returns:
- A Mono of the modified document after prepend operation.
-
findAll
Reactively find all documents in the given entityClass's set and map them to the given class type.- Parameters:
entityClass- The class to extract the Aerospike set from and to map the documents to. Must not be null.- Returns:
- A Flux of matching documents, returned documents will be mapped to entityClass's type.
-
findById
Reactively find a document by id, set name will be determined by the given entityClass.Document will be mapped to the given entityClass.
- Parameters:
id- The id of the document to find. Must not be null.entityClass- The class to extract the Aerospike set from and to map the document to. Must not be null.- Returns:
- A Mono of the matching document, returned document will be mapped to entityClass's type.
-
findByIds
Reactively find documents by providing multiple ids using a single batch read operation, set name will be determined by the given entityClass.Documents will be mapped to the given entityClass.
- Parameters:
ids- The ids of the documents to find. Must not be null.entityClass- The class to extract the Aerospike set from and to map the documents to. Must not be null.- Returns:
- A Flux of matching documents, returned documents will be mapped to entityClass's type.
-
findByIds
Reactively executes a single batch request to get results for several entities.Aerospike provides functionality to get documents from different sets in 1 batch request. The methods allows to put grouped keys by entity type as parameter and get result as spring data aerospike entities grouped by entity type.
- Parameters:
groupedKeys- Must not be null.- Returns:
- Mono of grouped entities.
-
find
Reactively find documents in the given entityClass's set using a query and map them to the given class type.- Parameters:
query- The query to filter results. Must not be null.entityClass- The class to extract the Aerospike set from and to map the documents to. Must not be null.- Returns:
- A Flux of matching documents, returned documents will be mapped to entityClass's type.
-
findInRange
<T> reactor.core.publisher.Flux<T> findInRange(long offset, long limit, Sort sort, Class<T> entityClass) Reactively find documents in the given entityClass's set using a range (offset, limit) and a sort and map them to the given class type.- Parameters:
offset- The offset to start the range from.limit- The limit of the range.sort- The sort to affect the returned Stream of documents order.entityClass- The class to extract the Aerospike set from and to map the documents to. Must not be null.- Returns:
- A Flux of matching documents, returned documents will be mapped to entityClass's type.
-
count
Reactively return the amount of documents in a query results. set name will be determined by the given entityClass.- Parameters:
query- The query that provides the result set for count.entityClass- entityClass The class to extract the Aerospike set from. Must not be null.- Returns:
- A Mono of the amount of documents that the given query and entity class supplied.
-
count
Reactively return the amount of documents in the given Aerospike set.- Parameters:
setName- The name of the set to count. Must not be null.- Returns:
- A Mono of the amount of documents in the given set.
-
count
Reactively return the amount of documents in the given entityClass's Aerospike set.- Parameters:
entityClass- The class to extract the Aerospike set from. Must not be null.- Returns:
- A Mono of the amount of documents in the set (of the given entityClass).
-
execute
Reactively execute operation against underlying store.- Parameters:
supplier- must not be null.- Returns:
- A Mono of the execution result.
-
exists
Reactively check if document exists by providing document id and entityClass (set name will be determined by the given entityClass).- Parameters:
id- The id to check if exists. Must not be null.entityClass- The class to extract the Aerospike set from. Must not be null.- Returns:
- A Mono of whether the document exists.
-
delete
Reactively truncate/delete all the documents in the given entity's set.- Parameters:
entityClass- The class to extract the Aerospike set from. Must not be null.
-
delete
Reactively delete document by id, set name will be determined by the given entityClass.- Parameters:
id- The id of the document to delete. Must not be null.entityClass- The class to extract the Aerospike set from. Must not be null.- Returns:
- A Mono of whether the document existed on server before deletion.
-
delete
Reactively delete document.- Parameters:
document- The document to delete. Must not be null.- Returns:
- A Mono of whether the document existed on server before deletion.
-
createIndex
<T> reactor.core.publisher.Mono<Void> createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType) Reactively create index by specified name in Aerospike.- Parameters:
entityClass- The class to extract the Aerospike set from. Must not be null.indexName- The index name. Must not be null.binName- The bin name to create the index on. Must not be null.indexType- The type of the index. Must not be null.
-
createIndex
<T> reactor.core.publisher.Mono<Void> createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType) Reactively create index by specified name in Aerospike.- Parameters:
entityClass- The class to extract the Aerospike set from. Must not be null.indexName- The index name. Must not be null.binName- The bin name to create the index on. Must not be null.indexType- The type of the index. Must not be null.indexCollectionType- The collection type of the index. Must not be null.
-
deleteIndex
Reactively delete index by specified name from Aerospike.- Parameters:
entityClass- The class to extract the Aerospike set from. Must not be null.indexName- The index name. Must not be null.
-