Class PurgeBulkOperationHandler
java.lang.Object
com.broadleafcommerce.catalog.messaging.bulkoperation.PurgeBulkOperationHandler
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPurgeBulkOperationHandler
(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 void
deleteBatch
(Collection<String> bulkIds, Map<String, String> jobDetails) protected void
doHandleEvent
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) protected BulkOperationItemService<BulkOperationItem>
protected BulkOperationService<BulkOperation>
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected int
getPurgeBatchSize
(Map<String, String> jobDetails) protected int
getPurgeItemBatchSize
(Map<String, String> jobDetails) getPurgeOperationStatuses
(Map<String, String> jobDetails) protected Instant
getPurgeThreshold
(Map<String, String> jobDetails) protected void
handle
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Handles deleting all theBulkOperations
and theirBulkOperationItems
that are older than the configured age threshold.void
listen
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) protected void
processBulkOperationDeletion
(Collection<String> bulkIds) protected Integer
processIndividualBulkItemDeletion
(List<String> itemIds) protected void
processItemCompletionDeletion
(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 theBulkOperations
and theirBulkOperationItems
that 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
ScheduledJobDetailRef
name to String value
-
getPurgeThreshold
-
getPurgeBatchSize
-
getPurgeItemBatchSize
-
getPurgeOperationStatuses
-
getIdempotentMessageService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService() -
getBulkOperationService
-
getBulkOperationItemService
-