Class ProductBulkUpdateProcessor

java.lang.Object
com.broadleafcommerce.catalog.service.bulk.ProductBulkUpdateProcessor
All Implemented Interfaces:
com.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>

public class ProductBulkUpdateProcessor extends Object implements com.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>
A BulkUpdateProcessor for bulk update operations on BulkUpdateTarget.PRODUCT.
Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • ProductBulkUpdateProcessor

      public ProductBulkUpdateProcessor(ProductService<Product> productService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> filterParser, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter contextRequestConverter)
  • Method Details

    • canHandle

      public boolean canHandle(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate)
      Specified by:
      canHandle in interface com.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>
    • readRecordsToProcess

      public com.broadleafcommerce.bulk.service.ReadRecordsResponse<Product> readRecordsToProcess(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate)
      Specified by:
      readRecordsToProcess in interface com.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>
    • buildQueryContextInfo

      protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildQueryContextInfo(com.broadleafcommerce.bulk.domain.BulkUpdate update) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • buildContextRequestWithTenantApplicationAndCatalog

      protected com.broadleafcommerce.data.tracking.core.context.ContextRequest buildContextRequestWithTenantApplicationAndCatalog(com.broadleafcommerce.bulk.domain.BulkUpdate update)
    • modifyAndPersist

      public com.broadleafcommerce.bulk.service.BatchProcessResponse modifyAndPersist(List<Product> batchToProcess, com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate)
      Specified by:
      modifyAndPersist in interface com.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>
    • buildUpdateContextInfo

      protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildUpdateContextInfo(com.broadleafcommerce.bulk.domain.BulkUpdate update) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • updateAvailability

      protected com.broadleafcommerce.bulk.service.BatchProcessResponse updateAvailability(List<Product> batchToProcess, String serializedPayload, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • buildErrorsForBulkValidationException

      protected List<com.broadleafcommerce.bulk.domain.BulkUpdateError> buildErrorsForBulkValidationException(com.broadleafcommerce.common.error.validation.BulkValidationException e)
    • decreasePrice

      protected com.broadleafcommerce.bulk.service.BatchProcessResponse decreasePrice(List<Product> batchToProcess, String serializedPayload, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • buildErrorForInvalidPriceDecreasePayload

      protected com.broadleafcommerce.bulk.domain.BulkUpdateError buildErrorForInvalidPriceDecreasePayload()
    • getProductService

      @NonNull protected ProductService<Product> getProductService()
    • getTypeFactory

      @NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getFilterParser

      @NonNull protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getFilterParser()
    • getObjectMapper

      @NonNull protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • getContextRequestConverter

      @NonNull protected com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter getContextRequestConverter()