Interface PojoIndexingQueueEventSendingPlan
-
public interface PojoIndexingQueueEventSendingPlan
A set of indexing events to be sent to an external queue.The external queue will be consumed by a background process which will then perform the indexing operations asynchronously.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
append(String entityName, Object identifier, String serializedId, PojoIndexingQueueEventPayload payload)
Appends an event to the plan, to be sentlater
and ultimately added to aPojoIndexingQueueEventProcessingPlan
.void
discard()
Discards all events that were added to this plan, without sending them.<R> CompletableFuture<MultiEntityOperationExecutionReport<R>>
sendAndReport(EntityReferenceFactory<R> entityReferenceFactory)
Sends the events to the queue.
-
-
-
Method Detail
-
append
void append(String entityName, Object identifier, String serializedId, PojoIndexingQueueEventPayload payload)
Appends an event to the plan, to be sentlater
and ultimately added to aPojoIndexingQueueEventProcessingPlan
.- Parameters:
entityName
- The name of the entity type.identifier
- The non-serialized entity identifier, to report sending errors.serializedId
- The serialized entity identifier.payload
- A payload to be forwarded as-is to the processing plan.- See Also:
PojoIndexingQueueEventProcessingPlan.append(String, String, PojoIndexingQueueEventPayload)
-
discard
void discard()
Discards all events that were added to this plan, without sending them.
-
sendAndReport
<R> CompletableFuture<MultiEntityOperationExecutionReport<R>> sendAndReport(EntityReferenceFactory<R> entityReferenceFactory)
Sends the events to the queue.When the returned future completes, events are guaranteed to be stored in secure storage in such a way that they will eventually be processed.
- Type Parameters:
R
- The type of entity references in the returned execution report.- Parameters:
entityReferenceFactory
- A factory for entity references in the returned execution report.- Returns:
- A
CompletableFuture
that will hold an execution report when all the events are sent. If sending an event failed, the future will be completed normally, but the report will contain an exception.
-
-