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 Summary
-
Constructor Summary
ConstructorDescriptionBulkUpdateProcessorHelper
(BulkOperationItemService<I> bulkOperationItemService, BulkOperationService<BulkOperation> bulkOperationService) -
Method Summary
Modifier and TypeMethodDescriptionprotected cz.jirutka.rsql.parser.ast.Node
buildBulkItemLookupFilter
(String startId) protected org.springframework.data.domain.Pageable
protected com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties
com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties.BulkOperationContextProperties
getBulkOperationContextProperties
(BulkOperation bulkOperation, String operationType) Retrieves theconfiguration
for the given bulk operation type.protected BulkOperationItemService<I>
protected BulkOperationService<BulkOperation>
protected void
handleFailedItemUpdates
(@NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<I> response) <T> void
handleFailureEntityUpdates
(@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> void
handleSuccessfulEntityUpdates
(@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.void
processBulkItemsInBatches
(@NonNull BulkOperation bulkOperation, @NonNull BulkItemPageOperator<I> bulkItemPageOperator) Handles processing a page ofBulkOperationItems
in batches, applying the givenBulkItemPageOperator
to the retrieved items.void
setBulkOpContextConfigurationProperties
(com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties bulkOpContextConfigurationProperties) protected String
updateBatchingStartId
(String startId, @NonNull org.springframework.data.domain.Page<I> bulkOperationItems)
-
Field Details
-
ID
- See Also:
-
ID_START_QUERY_PARAM
- See Also:
-
-
Constructor Details
-
BulkUpdateProcessorHelper
public 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 theconfiguration
for the given bulk operation type.- Parameters:
bulkOperation
- TheBulkOperation
operationType
- The type of the operation, e.g.,ADD_TAG
.- Returns:
- The configuration for the type or null if none.
-
handleSuccessfulEntityUpdates
public <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
- theBulkPersistenceResponse
that contains information about which entities succeeded, and which entities failed and whygetIdFunction
- the function to get the entity's context IDbulkOperationItems
- the page of bulk operation items to update
-
handleFailureEntityUpdates
public <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
- theBulkPersistenceResponse
that contains information about which entities succeeded, and which entities failed and whygetIdFunction
- the function to get the entity's context IDbulkOperationItems
- the page of bulk operation items to update
-
processBulkItemsInBatches
public void processBulkItemsInBatches(@NonNull @NonNull BulkOperation bulkOperation, @NonNull @NonNull BulkItemPageOperator<I> bulkItemPageOperator) Handles processing a page ofBulkOperationItems
in batches, applying the givenBulkItemPageOperator
to the retrieved items.- Parameters:
bulkOperation
- The parentBulkOperation
bulkItemPageOperator
- TheBulkItemPageOperator
representing the operation to perform against the items.
-
handleFailedItemUpdates
protected void handleFailedItemUpdates(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<I> response) -
updateBatchingStartId
-
buildBulkItemLookupPageable
protected org.springframework.data.domain.Pageable buildBulkItemLookupPageable() -
buildBulkItemLookupFilter
-
getBulkOperationItemService
-
getBulkOperationService
-
getBulkOpContextConfigurationProperties
protected com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties getBulkOpContextConfigurationProperties() -
setBulkOpContextConfigurationProperties
@Autowired public void setBulkOpContextConfigurationProperties(@Nullable com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties bulkOpContextConfigurationProperties)
-