Class PurgeImportJobHandler
java.lang.Object
com.broadleafcommerce.dataimport.service.purge.PurgeImportJobHandler
Purges
Import, and related Batch and BatchItemCompletion records since
these have the opportunity to grow large- Author:
- Chad Harchar (charchar)
-
Constructor Summary
ConstructorsConstructorDescriptionPurgeImportJobHandler(ImportService<Import> importService, BatchItemCompletionService<BatchItemCompletion> batchItemCompletionService, BatchService<Batch> batchService, PurgeImportProperties purgeImportProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected intReturns the value for the "broadleaf.dataimport.purge.item-completion-batch-size" configuration property.protected voidprocessBatchDeletion(List<String> importIds) protected voidprocessImportDeletion(List<String> importIds) protected IntegerprocessIndividualBatchItemCompletionDeletion(List<String> itemCompletionIds) protected voidprocessIndividualBatchItemCompletionDeletion(List<String> itemCompletionIds, String importId) Deprecated, for removal: This API element is subject to removal in a future version.protected voidprocessItemCompletionDeletion(List<String> importIds) Delete anyBatchItemCompletionrelated to the imports in batchintPurges import data 1.
-
Constructor Details
-
PurgeImportJobHandler
public PurgeImportJobHandler(ImportService<Import> importService, BatchItemCompletionService<BatchItemCompletion> batchItemCompletionService, BatchService<Batch> batchService, PurgeImportProperties purgeImportProperties)
-
-
Method Details
-
purgeImportData
public int purgeImportData()Purges import data- 1. Find the ids of the imports to purge
- 2. Batch the import ids and delete the following
- 3. Delete any related
BatchItemCompletionin another batch - 4. Delete any related
Batch - 5. Delete the owning
Import
- Returns:
- number of imports purged
-
processItemCompletionDeletion
Delete anyBatchItemCompletionrelated to the imports in batch- Parameters:
importIds- ids of imports to delete relatedBatchItemCompletion
-
getBatchSize
protected int getBatchSize()Returns the value for the "broadleaf.dataimport.purge.item-completion-batch-size" configuration property. If the value is less than 1 or more than 100 return 100 by default. -
processIndividualBatchItemCompletionDeletion
@Deprecated(forRemoval=true) protected void processIndividualBatchItemCompletionDeletion(List<String> itemCompletionIds, String importId) Deprecated, for removal: This API element is subject to removal in a future version. -
processIndividualBatchItemCompletionDeletion
-
processBatchDeletion
-
processImportDeletion
-
processIndividualBatchItemCompletionDeletion(List)