Class PurgeBulkOperationHandler

java.lang.Object
com.broadleafcommerce.catalog.messaging.bulkoperation.PurgeBulkOperationHandler

@DataRouteByKey("catalog") public class PurgeBulkOperationHandler extends Object
Author:
Nathan Moore (nathandmoore)
  • Field Details

  • Constructor Details

  • 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 the BulkOperations and their BulkOperationItems that are older than the configured age threshold.
      Parameters:
      message - The received message with the ScheduledJobRef.
    • readBulkOperationsToDelete

      protected List<BulkOperation> readBulkOperationsToDelete(Map<String,String> jobDetails)
    • deleteBatch

      protected void deleteBatch(Collection<String> bulkIds, Map<String,String> jobDetails)
    • processItemCompletionDeletion

      protected void processItemCompletionDeletion(Collection<String> bulkOpsIds, int batchSize)
    • processBulkOperationDeletion

      protected void processBulkOperationDeletion(Collection<String> bulkIds)
    • readBulkItemIdsForBatch

      protected List<String> readBulkItemIdsForBatch(Collection<String> bulkOpsIds, int batchSize)
    • processIndividualBulkItemDeletion

      protected Integer processIndividualBulkItemDeletion(List<String> itemIds)
    • 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

      protected Instant getPurgeThreshold(Map<String,String> jobDetails)
    • getPurgeBatchSize

      protected int getPurgeBatchSize(Map<String,String> jobDetails)
    • getPurgeItemBatchSize

      protected int getPurgeItemBatchSize(Map<String,String> jobDetails)
    • getPurgeOperationStatuses

      protected Set<String> getPurgeOperationStatuses(Map<String,String> jobDetails)
    • getIdempotentMessageService

      protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService()
    • getBulkOperationService

      protected BulkOperationService<BulkOperation> getBulkOperationService()
    • getBulkOperationItemService

      protected BulkOperationItemService<BulkOperationItem> getBulkOperationItemService()