Class DefaultDocumentStore
java.lang.Object
io.fluxzero.sdk.common.AbstractNamespaced<DocumentStore>
io.fluxzero.sdk.persisting.search.DefaultDocumentStore
- All Implemented Interfaces:
Namespaced<DocumentStore>, DocumentStore, HasLocalHandlers
public class DefaultDocumentStore
extends AbstractNamespaced<DocumentStore>
implements DocumentStore, HasLocalHandlers
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbulkUpdate(Collection<? extends BulkUpdate> updates, Guarantee guarantee) Applies a batch of document updates, using givenGuarantee.createAuditTrail(Object collection, Duration retentionTime) Configures Fluxzero to use a search collection as a searchable audit trail with the given retention time.protected DocumentStorecreateForNamespace(String namespace) deleteCollection(Object collection) Deletes an entire collection of documents.deleteDocument(Object id, Object collection, Guarantee guarantee) Deletes a document from the collection, using givenGuarantee.<T> Optional<T> fetchDocument(Object id, Object collection) Fetches a document by ID and deserializes it into the stored type.<T> Optional<T> fetchDocument(Object id, Object collection, Class<T> type) Fetches a document by ID and deserializes it into the provided type.<T> Collection<T> fetchDocuments(Collection<?> ids, Object collection) Fetches a collection of documents by their IDs and deserializes them into the stored type.<T> Collection<T> fetchDocuments(Collection<?> ids, Object collection, Class<T> type) Fetches a collection of documents by their IDs and deserializes them into the provided type.booleanhasDocument(Object id, Object collection) Checks if a document exists in the specified collection.index(@NonNull Object object, @NonNull Object id, @NonNull Object collection, Instant begin, Instant end, Metadata metadata, Guarantee guarantee, boolean ifNotExists) Indexes a document with the specified guarantees, metadata, and if-not-exists condition, usingGuarantee.STORED.index(Collection<?> objects, Object collection, String idPath, String beginPath, String endPath, Guarantee guarantee, boolean ifNotExists) Indexes a collection of objects using functional accessors for ID and time intervals, usingGuarantee.STORED.<T> CompletableFuture<Void> index(Collection<? extends T> objects, Object collection, Function<? super T, ?> idFunction, Function<? super T, Instant> beginFunction, Function<? super T, Instant> endFunction, Guarantee guarantee, boolean ifNotExists) Indexes a collection of objects using functional accessors for ID and time intervals, usingGuarantee.STORED.moveDocument(Object id, Object collection, Object targetCollection, Guarantee guarantee) Deletes a document from the collection, using givenGuarantee.search(SearchQuery.Builder searchBuilder) Prepares a search query based on the specifiedSearchQuery.Builder.serializeAction(BulkUpdate update) Methods inherited from class AbstractNamespaced
close, forNamespaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DocumentStore
bulkUpdate, deleteDocument, determineCollection, fetchDocument, getSerializer, hasDocument, index, index, index, index, index, index, index, index, index, index, index, index, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, indexIfNotExists, moveDocument, prepareIndex, searchMethods inherited from interface HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilterMethods inherited from interface Namespaced
forDefaultNamespace, forNamespace
-
Constructor Details
-
DefaultDocumentStore
public DefaultDocumentStore()
-
-
Method Details
-
index
public CompletableFuture<Void> index(@NonNull @NonNull Object object, @NonNull @NonNull Object id, @NonNull @NonNull Object collection, Instant begin, Instant end, Metadata metadata, Guarantee guarantee, boolean ifNotExists) Description copied from interface:DocumentStoreIndexes a document with the specified guarantees, metadata, and if-not-exists condition, usingGuarantee.STORED.- Specified by:
indexin interfaceDocumentStore
-
index
public CompletableFuture<Void> index(Collection<?> objects, Object collection, String idPath, String beginPath, String endPath, Guarantee guarantee, boolean ifNotExists) Description copied from interface:DocumentStoreIndexes a collection of objects using functional accessors for ID and time intervals, usingGuarantee.STORED.- Specified by:
indexin interfaceDocumentStore
-
index
public <T> CompletableFuture<Void> index(Collection<? extends T> objects, Object collection, Function<? super T, ?> idFunction, Function<? super T, Instant> beginFunction, Function<? super T, Instant> endFunction, Guarantee guarantee, boolean ifNotExists) Description copied from interface:DocumentStoreIndexes a collection of objects using functional accessors for ID and time intervals, usingGuarantee.STORED.- Specified by:
indexin interfaceDocumentStore
-
bulkUpdate
public CompletableFuture<Void> bulkUpdate(Collection<? extends BulkUpdate> updates, Guarantee guarantee) Description copied from interface:DocumentStoreApplies a batch of document updates, using givenGuarantee.- Specified by:
bulkUpdatein interfaceDocumentStore
-
serializeAction
-
search
Description copied from interface:DocumentStorePrepares a search query based on the specifiedSearchQuery.Builder.- Specified by:
searchin interfaceDocumentStore
-
hasDocument
Description copied from interface:DocumentStoreChecks if a document exists in the specified collection.- Specified by:
hasDocumentin interfaceDocumentStore
-
fetchDocument
Description copied from interface:DocumentStoreFetches a document by ID and deserializes it into the stored type.- Specified by:
fetchDocumentin interfaceDocumentStore
-
fetchDocument
Description copied from interface:DocumentStoreFetches a document by ID and deserializes it into the provided type.- Specified by:
fetchDocumentin interfaceDocumentStore
-
fetchDocuments
Description copied from interface:DocumentStoreFetches a collection of documents by their IDs and deserializes them into the stored type.- Specified by:
fetchDocumentsin interfaceDocumentStore
-
fetchDocuments
Description copied from interface:DocumentStoreFetches a collection of documents by their IDs and deserializes them into the provided type.- Specified by:
fetchDocumentsin interfaceDocumentStore
-
deleteDocument
Description copied from interface:DocumentStoreDeletes a document from the collection, using givenGuarantee.- Specified by:
deleteDocumentin interfaceDocumentStore
-
moveDocument
public CompletableFuture<Void> moveDocument(Object id, Object collection, Object targetCollection, Guarantee guarantee) Description copied from interface:DocumentStoreDeletes a document from the collection, using givenGuarantee.- Specified by:
moveDocumentin interfaceDocumentStore
-
deleteCollection
Description copied from interface:DocumentStoreDeletes an entire collection of documents.- Specified by:
deleteCollectionin interfaceDocumentStore
-
createAuditTrail
Description copied from interface:DocumentStoreConfigures Fluxzero to use a search collection as a searchable audit trail with the given retention time.- Specified by:
createAuditTrailin interfaceDocumentStore
-
createForNamespace
- Specified by:
createForNamespacein classAbstractNamespaced<DocumentStore>
-