Class DefaultPriceDataPreloadProcessor
java.lang.Object
com.broadleafcommerce.dataexchange.service.catalog.product.AbstractPriceDataPreloadProcessor
com.broadleafcommerce.dataexchange.service.catalog.product.DefaultPriceDataPreloadProcessor
- All Implemented Interfaces:
BatchExtensionProcessor
,NodeBuilder
,org.springframework.core.Ordered
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPriceDataPreloadProcessor
(PriceProvider<PriceData, PriceList> pricingProvider, DataExchangePriceListProperties properties, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPriceDataTargetIds
(ExchangeObject obj, Set<String> pricingKeys, Map<String, PriceList> priceListMap, BatchContext<ComprehensiveProduct> batch) protected cz.jirutka.rsql.parser.ast.Node
buildCurrencyFilters
(cz.jirutka.rsql.parser.ast.Node node, DefaultPriceDataPreloadProcessor.PriceListFilters filters) protected cz.jirutka.rsql.parser.ast.Node
buildCurrencyInNode
(Set<String> currencies) protected cz.jirutka.rsql.parser.ast.Node
buildPriceDataReadFilter
(Map<String, PriceList> priceListMap, List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batch) Builds the criteria for bulk reading price data.protected cz.jirutka.rsql.parser.ast.Node
buildPriceListReadFilter
(List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batch) Builds the criteria for reading price lists.protected String
getPriceDataPriceListKey
(Prices prices, PriceData priceData) Return a function that maps a price list to a key for a map.protected void
handleCurrencyIdentifier
(ComprehensiveProduct product, Prices prices, DefaultPriceDataPreloadProcessor.PriceListFilters priceListFilters, BatchContext<ComprehensiveProduct> batch) protected boolean
isCurrencyIdentifier
(Prices prices) protected boolean
isIdIdentifier
(Prices prices) protected boolean
isSaleType
(Prices prices) protected boolean
isStandardType
(Prices prices) protected void
populatePriceListIdForPriceData
(ComprehensiveProduct product, Prices prices, PriceData priceData, Map<String, PriceList> priceListMap, BatchContext<ComprehensiveProduct> batch) Populates the price list id for the given price data.Methods inherited from class com.broadleafcommerce.dataexchange.service.catalog.product.AbstractPriceDataPreloadProcessor
buildPriceListMap, canHandle, getPricingProvider, getProperties, getTypeFactory, populatePriceListIds, preProcess, readExistingPriceData, readPriceLists
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.dataexchange.service.BatchExtensionProcessor
getOrder, postProcess
Methods inherited from interface com.broadleafcommerce.dataexchange.service.NodeBuilder
buildAndNode, buildAndNode, buildEqualsNode, buildInNode, buildInNode, buildOrNode, buildOrNode, emptyNode, escapeSpecialCharacters, filterEmptyNodes, filterEmptyNodes, isEmptyNodeOrNull
-
Constructor Details
-
DefaultPriceDataPreloadProcessor
public DefaultPriceDataPreloadProcessor(PriceProvider<PriceData, PriceList> pricingProvider, DataExchangePriceListProperties properties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
populatePriceListIdForPriceData
protected void populatePriceListIdForPriceData(ComprehensiveProduct product, Prices prices, PriceData priceData, Map<String, PriceList> priceListMap, BatchContext<ComprehensiveProduct> batch) Description copied from class:AbstractPriceDataPreloadProcessor
Populates the price list id for the given price data. The implementation should populatePriceData.setPriceListId(String)
with the appropriate ID from the supplied price list map. If the price list is not found, the implementation should register an error with the batch context for the supplied product.- Specified by:
populatePriceListIdForPriceData
in classAbstractPriceDataPreloadProcessor
- Parameters:
product
- The productpriceData
- The price datapriceListMap
- The price list map. Key depends on the implementation.batch
- The batch context
-
getPriceListMapKeyFunction
Description copied from class:AbstractPriceDataPreloadProcessor
Return a function that maps a price list to a key for a map. This will be used whenpopulating the price list ID
for a given price data.- Specified by:
getPriceListMapKeyFunction
in classAbstractPriceDataPreloadProcessor
- Returns:
- a function that maps a price list to a key for a map
-
getPriceDataPriceListKey
-
buildPriceDataReadFilter
protected cz.jirutka.rsql.parser.ast.Node buildPriceDataReadFilter(Map<String, PriceList> priceListMap, List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batch) Description copied from class:AbstractPriceDataPreloadProcessor
Builds the criteria for bulk reading price data. SeePriceProvider.bulkReadPriceData(Node, BatchContext)
- Specified by:
buildPriceDataReadFilter
in classAbstractPriceDataPreloadProcessor
batch
- the batch context- Returns:
- the criteria for bulk reading price data
-
addPriceDataTargetIds
protected void addPriceDataTargetIds(ExchangeObject obj, Set<String> pricingKeys, Map<String, PriceList> priceListMap, BatchContext<ComprehensiveProduct> batch) -
buildPriceListReadFilter
protected cz.jirutka.rsql.parser.ast.Node buildPriceListReadFilter(List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batch) Description copied from class:AbstractPriceDataPreloadProcessor
Builds the criteria for reading price lists. SeePriceProvider.readPriceLists(Node, BatchContext)
- Specified by:
buildPriceListReadFilter
in classAbstractPriceDataPreloadProcessor
- Parameters:
products
- the products to build the filter forbatch
- the batch context- Returns:
- the criteria for reading price lists
-
buildCurrencyFilters
protected cz.jirutka.rsql.parser.ast.Node buildCurrencyFilters(cz.jirutka.rsql.parser.ast.Node node, DefaultPriceDataPreloadProcessor.PriceListFilters filters) -
buildCurrencyInNode
-
handleCurrencyIdentifier
protected void handleCurrencyIdentifier(ComprehensiveProduct product, Prices prices, DefaultPriceDataPreloadProcessor.PriceListFilters priceListFilters, BatchContext<ComprehensiveProduct> batch) -
isIdIdentifier
-
isCurrencyIdentifier
-
isStandardType
-
isSaleType
-