Class PurgeBulkOperationHandler
java.lang.Object
com.broadleafcommerce.catalog.messaging.bulkoperation.PurgeBulkOperationHandler
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPurgeBulkOperationHandler(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService, BulkOperationService<BulkOperation> bulkOperationService, BulkOperationItemService<BulkOperationItem> bulkOperationItemService) -
Method Summary
Modifier and TypeMethodDescriptionbuildJobDetailsMap(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef job) Build a map from the scheduled job details.protected voiddeleteBatch(Collection<String> bulkIds, Map<String, String> jobDetails) protected voiddoHandleEvent(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) protected BulkOperationItemService<BulkOperationItem>protected BulkOperationService<BulkOperation>protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionServiceprotected intgetPurgeBatchSize(Map<String, String> jobDetails) protected intgetPurgeItemBatchSize(Map<String, String> jobDetails) getPurgeOperationStatuses(Map<String, String> jobDetails) protected InstantgetPurgeThreshold(Map<String, String> jobDetails) protected voidhandle(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Handles deleting all theBulkOperationsand theirBulkOperationItemsthat are older than the configured age threshold.voidlisten(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) protected voidprocessBulkOperationDeletion(Collection<String> bulkIds) protected IntegerprocessIndividualBulkItemDeletion(List<String> itemIds) protected voidprocessItemCompletionDeletion(Collection<String> bulkOpsIds, int batchSize) readBulkItemIdsForBatch(Collection<String> bulkOpsIds, int batchSize) protected List<BulkOperation>readBulkOperationsToDelete(Map<String, String> jobDetails)
-
Field Details
-
JOB_NAME
- See Also:
-
DETAIL_KEY_PURGE_THRESHOLD
- See Also:
-
DETAIL_KEY_PURGE_BATCH_SIZE
- See Also:
-
DETAIL_KEY_PURGE_ITEM_BATCH_SIZE
- See Also:
-
DETAIL_KEY_PURGE_OPERATION_STATUSES
- See Also:
-
DEFAULT_PURGE_THRESHOLD
- See Also:
-
DEFAULT_PURGE_BATCH_SIZE
- See Also:
-
DEFAULT_PURGE_ITEM_BATCH_SIZE
- See Also:
-
DEFAULT_PURGE_STATUSES
-
FORMATTER
-
-
Constructor Details
-
PurgeBulkOperationHandler
public PurgeBulkOperationHandler(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService, BulkOperationService<BulkOperation> bulkOperationService, BulkOperationItemService<BulkOperationItem> bulkOperationItemService)
-
-
Method Details
-
listen
@StreamListener("triggeredJobEventInputPurgeBulkOperation") public void listen(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) -
doHandleEvent
protected void doHandleEvent(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) -
handle
protected void handle(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Handles deleting all theBulkOperationsand theirBulkOperationItemsthat are older than the configured age threshold.- Parameters:
message- The received message with theScheduledJobRef.
-
readBulkOperationsToDelete
-
deleteBatch
-
processItemCompletionDeletion
-
processBulkOperationDeletion
-
readBulkItemIdsForBatch
-
processIndividualBulkItemDeletion
-
buildJobDetailsMap
protected Map<String,String> buildJobDetailsMap(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef job) Build a map from the scheduled job details.- Parameters:
job- The job being executed.- Returns:
- Map of
ScheduledJobDetailRefname to String value
-
getPurgeThreshold
-
getPurgeBatchSize
-
getPurgeItemBatchSize
-
getPurgeOperationStatuses
-
getIdempotentMessageService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService() -
getBulkOperationService
-
getBulkOperationItemService
-