Class BulkUpdateProcessorHelper<I extends BulkOperationItem>
java.lang.Object
com.broadleafcommerce.catalog.service.bulkoperation.processor.util.BulkUpdateProcessorHelper<I>
Helper component for processing 
BulkOperations against the designated
 Items.- Since:
- 2.1.0-GA
- Author:
- Nathan Moore (nathandmoore)
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionBulkUpdateProcessorHelper(BulkOperationItemService<I> bulkOperationItemService, BulkOperationService<BulkOperation> bulkOperationService) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected cz.jirutka.rsql.parser.ast.NodebuildBulkItemLookupFilter(String startId) protected org.springframework.data.domain.Pageableprotected com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationPropertiescom.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties.BulkOperationContextPropertiesgetBulkOperationContextProperties(BulkOperation bulkOperation, String operationType) Retrieves theconfigurationfor the given bulk operation type.protected BulkOperationItemService<I>protected BulkOperationService<BulkOperation>protected voidhandleFailedItemUpdates(@NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<I> response) <T> voidhandleFailureEntityUpdates(@NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<T> bulkPersistenceResponse, @NonNull Function<T, String> getIdFunction, @NonNull org.springframework.data.domain.Page<I> bulkOperationItems, String operationType) Updates the bulk operation items based on the failed records in the persistence response.<T> voidhandleSuccessfulEntityUpdates(@NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<T> bulkPersistenceResponse, @NonNull Function<T, String> getIdFunction, @NonNull org.springframework.data.domain.Page<I> bulkOperationItems, String operationType) Updates the bulk operation items based on the successful records in the persistence response.voidprocessBulkItemsInBatches(@NonNull BulkOperation bulkOperation, @NonNull BulkItemPageOperator<I> bulkItemPageOperator) Handles processing a page ofBulkOperationItemsin batches, applying the givenBulkItemPageOperatorto the retrieved items.voidsetBulkOpContextConfigurationProperties(com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties bulkOpContextConfigurationProperties) protected StringupdateBatchingStartId(String startId, @NonNull org.springframework.data.domain.Page<I> bulkOperationItems) 
- 
Field Details- 
ID- See Also:
 
- 
ID_START_QUERY_PARAM- See Also:
 
 
- 
- 
Constructor Details- 
BulkUpdateProcessorHelperpublic BulkUpdateProcessorHelper(BulkOperationItemService<I> bulkOperationItemService, BulkOperationService<BulkOperation> bulkOperationService) 
 
- 
- 
Method Details- 
getBulkOperationContextProperties@Nullable public com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties.BulkOperationContextProperties getBulkOperationContextProperties(BulkOperation bulkOperation, String operationType) Retrieves theconfigurationfor the given bulk operation type.- Parameters:
- bulkOperation- The- BulkOperation
- operationType- The type of the operation, e.g.,- ADD_TAG.
- Returns:
- The configuration for the type or null if none.
 
- 
handleSuccessfulEntityUpdatespublic <T> void handleSuccessfulEntityUpdates(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<T> bulkPersistenceResponse, @NonNull @NonNull Function<T, String> getIdFunction, @NonNull @NonNull org.springframework.data.domain.Page<I> bulkOperationItems, String operationType) Updates the bulk operation items based on the successful records in the persistence response.- Type Parameters:
- T- the type of entity that was persisted
- Parameters:
- bulkPersistenceResponse- the- BulkPersistenceResponsethat contains information about which entities succeeded, and which entities failed and why
- getIdFunction- the function to get the entity's context ID
- bulkOperationItems- the page of bulk operation items to update
 
- 
handleFailureEntityUpdatespublic <T> void handleFailureEntityUpdates(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<T> bulkPersistenceResponse, @NonNull @NonNull Function<T, String> getIdFunction, @NonNull @NonNull org.springframework.data.domain.Page<I> bulkOperationItems, String operationType) Updates the bulk operation items based on the failed records in the persistence response.- Type Parameters:
- T- the type of entity that was persisted
- Parameters:
- bulkPersistenceResponse- the- BulkPersistenceResponsethat contains information about which entities succeeded, and which entities failed and why
- getIdFunction- the function to get the entity's context ID
- bulkOperationItems- the page of bulk operation items to update
 
- 
processBulkItemsInBatchespublic void processBulkItemsInBatches(@NonNull @NonNull BulkOperation bulkOperation, @NonNull @NonNull BulkItemPageOperator<I> bulkItemPageOperator) Handles processing a page ofBulkOperationItemsin batches, applying the givenBulkItemPageOperatorto the retrieved items.- Parameters:
- bulkOperation- The parent- BulkOperation
- bulkItemPageOperator- The- BulkItemPageOperatorrepresenting the operation to perform against the items.
 
- 
handleFailedItemUpdatesprotected void handleFailedItemUpdates(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<I> response) 
- 
updateBatchingStartId
- 
buildBulkItemLookupPageableprotected org.springframework.data.domain.Pageable buildBulkItemLookupPageable()
- 
buildBulkItemLookupFilter
- 
getBulkOperationItemService
- 
getBulkOperationService
- 
getBulkOpContextConfigurationPropertiesprotected com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties getBulkOpContextConfigurationProperties()
- 
setBulkOpContextConfigurationProperties@Autowired public void setBulkOpContextConfigurationProperties(@Nullable com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties bulkOpContextConfigurationProperties) 
 
-