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)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Request payload that is sent forProductBulkUpdateProcessor.SupportedTypes.AVAILABILITY
.static final class
Request payload that is sent forProductBulkUpdateProcessor.SupportedTypes.PRICE_DECREASE_AMOUNT
.static final class
Thebulk update types
that are supported by this processor. -
Constructor Summary
ConstructorDescriptionProductBulkUpdateProcessor
(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 Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextRequest
buildContextRequestWithTenantApplicationAndCatalog
(com.broadleafcommerce.bulk.domain.BulkUpdate update) protected com.broadleafcommerce.bulk.domain.BulkUpdateError
protected List<com.broadleafcommerce.bulk.domain.BulkUpdateError>
buildErrorsForBulkValidationException
(com.broadleafcommerce.common.error.validation.BulkValidationException e) protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildQueryContextInfo
(com.broadleafcommerce.bulk.domain.BulkUpdate update) protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildUpdateContextInfo
(com.broadleafcommerce.bulk.domain.BulkUpdate update) boolean
canHandle
(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate) protected com.broadleafcommerce.bulk.service.BatchProcessResponse
decreasePrice
(List<Product> batchToProcess, String serializedPayload, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter
protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>
protected com.fasterxml.jackson.databind.ObjectMapper
protected ProductService<Product>
protected com.broadleafcommerce.common.extension.TypeFactory
com.broadleafcommerce.bulk.service.BatchProcessResponse
modifyAndPersist
(List<Product> batchToProcess, com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate) com.broadleafcommerce.bulk.service.ReadRecordsResponse<Product>
readRecordsToProcess
(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate) protected com.broadleafcommerce.bulk.service.BatchProcessResponse
updateAvailability
(List<Product> batchToProcess, String serializedPayload, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
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 interfacecom.broadleafcommerce.bulk.service.BulkUpdateProcessor<Product>
-
readRecordsToProcess
public com.broadleafcommerce.bulk.service.ReadRecordsResponse<Product> readRecordsToProcess(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate) - Specified by:
readRecordsToProcess
in interfacecom.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 interfacecom.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
-
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()
-