Interface BatchService<P extends Batch>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>
All Known Implementing Classes:
DefaultBatchService

public interface BatchService<P extends Batch> extends com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>
Author:
Phillip Verheyden (phillipuniverse)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Delete the batches that match the corresponding import ids
    updateProcessingBatchFromCompletion(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion)
    Updates a Batch (specified in BatchCompletion.batchId) based upon the information received in a BatchCompletion and assuming that the persisted batch is BatchStatus.PROCESSING.

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService

    create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess
  • Method Details

    • createAndProcess

      void createAndProcess(Batch batch)
    • updateProcessingBatchFromCompletion

      @Nullable P updateProcessingBatchFromCompletion(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion)
      Updates a Batch (specified in BatchCompletion.batchId) based upon the information received in a BatchCompletion and assuming that the persisted batch is BatchStatus.PROCESSING.

      This will set Batch.completed to the current time, and update all BatchItems based on the information in the corresponding BatchCompletionRecords.

      Parameters:
      batchCompletion - the batch completion received from a resource tier service
      Returns:
      the updated Batch or null if the batch could not be updated or was not in a processing state
      Throws:
      IllegalArgumentException - if the batch completion did not contain a record for an item in the batch
      See Also:
    • deleteBatchesByImportId

      @Transactional("importTransactionManager") Long deleteBatchesByImportId(List<String> importIds)
      Delete the batches that match the corresponding import ids
      Parameters:
      importIds - the list of import ids to delete against
      Returns:
      the number of batches deleted