Class PojoIndexingQueueEventProcessingPlanImpl
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.work.impl.PojoIndexingQueueEventProcessingPlanImpl
-
- All Implemented Interfaces:
PojoIndexingQueueEventProcessingPlan
public final class PojoIndexingQueueEventProcessingPlanImpl extends Object implements PojoIndexingQueueEventProcessingPlan
-
-
Constructor Summary
Constructors Constructor Description PojoIndexingQueueEventProcessingPlanImpl(PojoWorkTypeContextProvider typeContextProvider, PojoWorkSessionContext sessionContext, PojoIndexingPlan delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String entityName, String serializedId, PojoIndexingQueueEventPayload payload)Appends an event to the plan, received from aPojoIndexingQueueEventSendingPlan.CompletableFuture<MultiEntityOperationExecutionReport>executeAndReport(OperationSubmitter operationSubmitter)Writes all pending changes to the index now, and clears the plan so that it can be re-used.ObjecttoIdentifier(String entityName, String serializedId)Convert the serialized id to the original identifier.<I> StringtoSerializedId(String entityName, I identifier)Convert the identifier to its serialized form.
-
-
-
Constructor Detail
-
PojoIndexingQueueEventProcessingPlanImpl
public PojoIndexingQueueEventProcessingPlanImpl(PojoWorkTypeContextProvider typeContextProvider, PojoWorkSessionContext sessionContext, PojoIndexingPlan delegate)
-
-
Method Detail
-
append
public void append(String entityName, String serializedId, PojoIndexingQueueEventPayload payload)
Description copied from interface:PojoIndexingQueueEventProcessingPlanAppends an event to the plan, received from aPojoIndexingQueueEventSendingPlan.- Specified by:
appendin interfacePojoIndexingQueueEventProcessingPlan- Parameters:
entityName- The name of the entity type.serializedId- The serialized entity identifier.payload- The payload as passed to the sending plan.- See Also:
PojoIndexingQueueEventSendingPlan.append(String, Object, String, PojoIndexingQueueEventPayload)
-
executeAndReport
public CompletableFuture<MultiEntityOperationExecutionReport> executeAndReport(OperationSubmitter operationSubmitter)
Description copied from interface:PojoIndexingQueueEventProcessingPlanWrites all pending changes to the index now, and clears the plan so that it can be re-used.- Specified by:
executeAndReportin interfacePojoIndexingQueueEventProcessingPlan- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full- Returns:
- A
CompletableFuturethat will be completed with an execution report when all the works are complete.
-
toSerializedId
public <I> String toSerializedId(String entityName, I identifier)
Description copied from interface:PojoIndexingQueueEventProcessingPlanConvert the identifier to its serialized form. The identifier type must be the one used by the entity having nameentityName.- Specified by:
toSerializedIdin interfacePojoIndexingQueueEventProcessingPlan- Type Parameters:
I- The type of the identifier of the entity.- Parameters:
entityName- The name of the entity.identifier- The provided identifier.- Returns:
- The serialized form of the provided identifier.
-
toIdentifier
public Object toIdentifier(String entityName, String serializedId)
Description copied from interface:PojoIndexingQueueEventProcessingPlanConvert the serialized id to the original identifier.- Specified by:
toIdentifierin interfacePojoIndexingQueueEventProcessingPlan- Parameters:
entityName- The name of the entity.serializedId- The serialized id.- Returns:
- The original entity identifier.
-
-