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 TypeMethodDescriptionvoid
createAndProcess
(Batch batch) deleteBatchesByImportId
(List<String> importIds) Delete the batches that match the corresponding import idsupdateProcessingBatchFromCompletion
(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) Updates aBatch
(specified inBatchCompletion.batchId
) based upon the information received in aBatchCompletion
and assuming that the persisted batch isBatchStatus.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
-
updateProcessingBatchFromCompletion
@Nullable P updateProcessingBatchFromCompletion(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) Updates aBatch
(specified inBatchCompletion.batchId
) based upon the information received in aBatchCompletion
and assuming that the persisted batch isBatchStatus.PROCESSING
.This will set
Batch.completed
to the current time, and update allBatchItems
based on the information in the correspondingBatchCompletionRecords
.- 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
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
-