public interface IndexWorkPlan<D>
Works are accumulated when methods such as add(DocumentReferenceProvider, DocumentContributor)
or update(DocumentReferenceProvider, DocumentContributor)
are called,
and executed only when execute()
is called.
Relative ordering of works within a work plan will be preserved.
Implementations may not be thread-safe.
Modifier and Type | Method and Description |
---|---|
void |
add(DocumentReferenceProvider documentReferenceProvider,
DocumentContributor<D> documentContributor)
Add a document to the index, assuming that the document is absent from the index.
|
void |
delete(DocumentReferenceProvider documentReferenceProvider)
Delete a document from the index.
|
CompletableFuture<?> |
execute()
Start executing all the works in this plan, and clear the plan so that it can be re-used.
|
void |
prepare()
Prepare the work plan execution, i.e.
|
void |
update(DocumentReferenceProvider documentReferenceProvider,
DocumentContributor<D> documentContributor)
Update a document in the index, or add it if it's absent from the index.
|
void add(DocumentReferenceProvider documentReferenceProvider, DocumentContributor<D> documentContributor)
documentReferenceProvider
- A source of information about the identity of the document to add.documentContributor
- A contributor to the document, adding fields to the indexed document.void update(DocumentReferenceProvider documentReferenceProvider, DocumentContributor<D> documentContributor)
documentReferenceProvider
- A source of information about the identity of the document to update.documentContributor
- A contributor to the document, adding fields to the indexed document.void delete(DocumentReferenceProvider documentReferenceProvider)
documentReferenceProvider
- A source of information about the identity of the document to delete.void prepare()
Calling this method is optional: the execute()
method
will perform the preparation if necessary.
CompletableFuture<?> execute()
CompletableFuture
that will be completed when all the works are complete.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.