atg.commerce.pricing.priceLists
Class ItemSalesTieredPriceCalculator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.pricing.priceLists.ItemSalesTieredPriceCalculator
All Implemented Interfaces:
ItemSchemePriceCalculator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ItemSalesTieredPriceCalculator
extends GenericService
implements ItemSchemePriceCalculator

A calculator which determines the sales tiered price of an item and sets the itemPriceInfo to be that amount.

The definition of tiered pricing can be referenced in ItemTieredPriceCalculator

See Also:
ItemTieredPriceCalculator

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ItemSalesTieredPriceCalculator()
           
 
Method Summary
protected  void addToSalesLevel(long pQuantity, double pTotal, java.util.List pSalesLevel)
           
protected  java.util.List adjustmentDetailedItemPriceInfo(DetailedItemPriceInfo pOldItemPriceInfo, java.util.List pSalesLevel, java.util.List pAdjustments)
          Sets the DetailedItemPriceInfo for its ItemPriceInfo.
 java.lang.String getPriceLevelPropertyName()
          the name of the property for the PriceLevel
 java.lang.String getPricePropertyName()
          the name of the property for the price of each price level
 PricingTools getPricingTools()
          pricing tools to help with price calculation
 java.lang.String getQuantityPropertyName()
          the name of the property for the quantity of each price level
 java.lang.String getSalesComplexPricePropertyName()
          the name of the property for the SalesComplexPrice
 void priceItem(RepositoryItem pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          Sets the tiered price with the given determined price
 void setPriceLevelPropertyName(java.lang.String pPriceLevelPropertyName)
          the name of the property for the PriceLevel
 void setPricePropertyName(java.lang.String pPricePropertyName)
          the name of the property for the price of each price level
 void setPricingTools(PricingTools pPricingTools)
          pricing tools to help with price calculation
 void setQuantityPropertyName(java.lang.String pQuantityPropertyName)
          the name of the property for the quantity of each price level
 void setSalesComplexPricePropertyName(java.lang.String pSalesComplexPricePropertyName)
          the name of the property for the SalesComplexPrice
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ItemSalesTieredPriceCalculator

public ItemSalesTieredPriceCalculator()
Method Detail

setPricingTools

public void setPricingTools(PricingTools pPricingTools)
pricing tools to help with price calculation

Parameters:
pPricingTools - new value to set

getPricingTools

public PricingTools getPricingTools()
pricing tools to help with price calculation

Returns:
property PricingTools

setSalesComplexPricePropertyName

public void setSalesComplexPricePropertyName(java.lang.String pSalesComplexPricePropertyName)
the name of the property for the SalesComplexPrice

Parameters:
pSalesComplexPricePropertyName - new value to set

getSalesComplexPricePropertyName

public java.lang.String getSalesComplexPricePropertyName()
the name of the property for the SalesComplexPrice

Returns:
property SalesComplexPricePropertyName

setPriceLevelPropertyName

public void setPriceLevelPropertyName(java.lang.String pPriceLevelPropertyName)
the name of the property for the PriceLevel

Parameters:
pPriceLevelPropertyName - new value to set

getPriceLevelPropertyName

public java.lang.String getPriceLevelPropertyName()
the name of the property for the PriceLevel

Returns:
property PriceLevelPropertyName

setQuantityPropertyName

public void setQuantityPropertyName(java.lang.String pQuantityPropertyName)
the name of the property for the quantity of each price level

Parameters:
pQuantityPropertyName - new value to set

getQuantityPropertyName

public java.lang.String getQuantityPropertyName()
the name of the property for the quantity of each price level

Returns:
property QuantityPropertyName

setPricePropertyName

public void setPricePropertyName(java.lang.String pPricePropertyName)
the name of the property for the price of each price level

Parameters:
pPricePropertyName - new value to set

getPricePropertyName

public java.lang.String getPricePropertyName()
the name of the property for the price of each price level

Returns:
property PricePropertyName

addToSalesLevel

protected void addToSalesLevel(long pQuantity,
                               double pTotal,
                               java.util.List pSalesLevel)

adjustmentDetailedItemPriceInfo

protected java.util.List adjustmentDetailedItemPriceInfo(DetailedItemPriceInfo pOldItemPriceInfo,
                                                         java.util.List pSalesLevel,
                                                         java.util.List pAdjustments)
Sets the DetailedItemPriceInfo for its ItemPriceInfo. This will split the price info if necessary. (Possibly more than once.) Depending on how the new tiers compare to the range of the incoming detail.

Parameters:
pQuantity - The quantity to set in the DetailedItemPriceInfo
pTotal - The total amount to set in the DetailedItemPriceInfo
pPriceQuote - ItemPriceInfo representing the current price quote for the item
pDetailList - The list of DetailedItemPriceInfo for the current ItemPriceInfo
pAdjustments - The list of PriceAdjustment for the current ItemPriceInfo
Returns:
Any newly created DetailedItemPriceInfos

priceItem

public void priceItem(RepositoryItem pPrice,
                      ItemPriceInfo pPriceQuote,
                      CommerceItem pItem,
                      RepositoryItem pPricingModel,
                      java.util.Locale pLocale,
                      RepositoryItem pProfile,
                      java.util.Map pExtraParameters)
               throws PricingException
Sets the tiered price with the given determined price

Specified by:
priceItem in interface ItemSchemePriceCalculator
Parameters:
pPrice - the price as extracted from the PriceList
pPriceQuote - ItemPriceInfo representing the current price quote for the item
pItem - The item to price
pPricingModel - A RepositoryItem representing a PricingModel
pLocale - the locale in which this item should be priced
pProfile - The user's profile
pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
Throws:
PricingException - if there was a problem pricing the input pItem