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 TypeMethodDescriptionvoidcreateAndProcess(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 aBatchCompletionand 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 aBatchCompletionand assuming that the persisted batch isBatchStatus.PROCESSING.This will set
Batch.completedto the current time, and update allBatchItemsbased on the information in the correspondingBatchCompletionRecords.- Parameters:
batchCompletion- the batch completion received from a resource tier service- Returns:
- the updated
Batchor 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
-