atg.commerce.pricing
Interface ItemPriceSourceHandler

All Known Implementing Classes:
ConfigurableItemPriceCalculator, ConfigurableItemPriceListCalculator, ItemListPriceCalculator, ItemListPriceCalculator, ItemPriceCalculator, ItemPriceCalculator, ItemSalePriceCalculator, ItemSalePriceCalculator, ItemSalesPriceCalculator, ItemSalesTieredPriceCalculator, ItemTieredPriceCalculator

public interface ItemPriceSourceHandler

This class defines a calculator specific interface used to generate ItemPriceSource objects from previously priced Orders and to consume ItemPriceSource objects during a pricing operation.

See Also:
PricingTools.generateItemPriceSources(Order, Map)

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 ItemPriceSource getItemPriceSource(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          This interface is called by the calculator at pricing time to return an ItemPriceSource that's matches the item being priced.
 boolean populateItemPriceSource(ItemPriceSource pItemPriceSource, Order pOrder, CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.util.Map pExtraParameters)
          This interface is called when generating source objects from a previously priced Order.
 boolean shouldConsumeSource(ItemPriceSource pItemPriceSource)
          This method is called to determine the given code>ItemPriceSource should be used by the calculator to price the item.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

populateItemPriceSource

boolean populateItemPriceSource(ItemPriceSource pItemPriceSource,
                                Order pOrder,
                                CommerceItem pCommerceItem,
                                CommerceItem pParentCommerceItem,
                                java.util.Map pExtraParameters)
This interface is called when generating source objects from a previously priced Order. The implementation should poplulate the values of the given ItemPriceSource based on the pricing information in the Order. The source should contain enough information so the calculator can generate the price using the source during a pricing operation.

Parameters:
pItemPriceSource - the source being generated and populated with pricing data.
pOrder - the Order
pCommerceItem - the item for which the source is being created
pParentCommerceItem - the item that contained pCommerceItem
pExtraParameters - a Map of extra parameters objects that was passed to the initial call to generate the source objects.
Returns:
return true if any of the ItemPriceSource properties were updated

getItemPriceSource

ItemPriceSource getItemPriceSource(ItemPriceInfo pPriceQuote,
                                   CommerceItem pItem,
                                   RepositoryItem pPricingModel,
                                   java.util.Locale pLocale,
                                   RepositoryItem pProfile,
                                   java.util.Map pExtraParameters)
This interface is called by the calculator at pricing time to return an ItemPriceSource that's matches the item being priced.

Parameters:
pPriceQuote - the new ItemPriceInfo for that's being generated in the pricing operation
pItem - the commerce item that's being priced
pPricingModel - the current pricing model
pLocale - the locale
pProfile - the customer profile reference
pExtraParameters - the extra parameter map passed to the pricing operation.
Returns:
If not null, the ItemPriceSource that should be used to price the item.

shouldConsumeSource

boolean shouldConsumeSource(ItemPriceSource pItemPriceSource)
This method is called to determine the given code>ItemPriceSource should be used by the calculator to price the item. A false return means the calculator will bypass its processing completely and return normally.