java.lang.Object
com.broadleafcommerce.catalog.service.bulkoperation.processor.util.BulkUpdateProcessorHelper<I>

public class BulkUpdateProcessorHelper<I extends BulkOperationItem> extends Object
Helper component for processing BulkOperations against the designated Items.
Since:
2.1.0-GA
Author:
Nathan Moore (nathandmoore)
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getBulkOperationContextProperties

      @Nullable public com.broadleafcommerce.data.tracking.core.service.context.BulkOperationContextConfigurationProperties.BulkOperationContextProperties getBulkOperationContextProperties(BulkOperation bulkOperation, String operationType)
      Retrieves the configuration for 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.
    • 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 - the BulkPersistenceResponse that 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
    • 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 - the BulkPersistenceResponse that 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
    • processBulkItemsInBatches

      public void processBulkItemsInBatches(@NonNull @NonNull BulkOperation bulkOperation, @NonNull @NonNull BulkItemPageOperator<I> bulkItemPageOperator)
      Handles processing a page of BulkOperationItems in batches, applying the given BulkItemPageOperator to the retrieved items.
      Parameters:
      bulkOperation - The parent BulkOperation
      bulkItemPageOperator - The BulkItemPageOperator representing the operation to perform against the items.
    • handleFailedItemUpdates

      protected void handleFailedItemUpdates(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<I> response)
    • updateBatchingStartId

      protected String updateBatchingStartId(@Nullable String startId, @NonNull @NonNull org.springframework.data.domain.Page<I> bulkOperationItems)
    • buildBulkItemLookupPageable

      protected org.springframework.data.domain.Pageable buildBulkItemLookupPageable()
    • buildBulkItemLookupFilter

      protected cz.jirutka.rsql.parser.ast.Node buildBulkItemLookupFilter(@Nullable String startId)
    • getBulkOperationItemService

      protected BulkOperationItemService<I> getBulkOperationItemService()
    • getBulkOperationService

      protected BulkOperationService<BulkOperation> 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)