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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBulkUpdateProcessorHelper(BulkOperationItemService<I> bulkOperationItemService, BulkOperationService<BulkOperation> bulkOperationService) -
Method Summary
Modifier 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
-
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 theconfigurationfor the given bulk operation type.- Parameters:
bulkOperation- TheBulkOperationoperationType- 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- theBulkPersistenceResponsethat 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- theBulkPersistenceResponsethat 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 ofBulkOperationItemsin batches, applying the givenBulkItemPageOperatorto the retrieved items.- Parameters:
bulkOperation- The parentBulkOperationbulkItemPageOperator- TheBulkItemPageOperatorrepresenting 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)
-