public class ItemPricingEngineImpl extends PricingEngineService implements ItemPricingEngine
Properties:
pPriceQuote before any pricing models are
evaluated.
pPriceQuote after any pricing models are
evaluated.
ItemPriceInfo,
ItemPricingCalculatorPricingEngineService.EmptyItemPriceInfo| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
EXTRA_PARAM_QUALIFIERSERVICE, mGlobalPromotions, mPricingCalculatorServicesSERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
ItemPricingEngineImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyCalculator(java.lang.Object pCalc,
int pPricingMethod,
java.util.List pItemPriceQuotes,
java.util.List pItems,
PricingContext pPricingContext,
java.util.Map pExtraParameters)
Calls the supplied calculator service to price one or more items.
|
protected java.util.Collection<RepositoryItem> |
applyPromotions(java.util.Collection pPricingModels,
int pPricingMethod,
java.util.List pItemPriceQuotes,
java.util.List pItems,
PricingContext pPricingContext,
java.util.Map pExtraParameters)
Apply the pricing models (promotions) to the object being priced.
|
void |
checkPromotionsForCloseness(java.util.List pPriceInfos,
java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
Check to see if the items qualify under any of the pricingModels'
"closenessQualifiers".
|
protected boolean |
didPromotionQualify(RepositoryItem pPricingModel,
PricingContext pPricingContext,
java.util.Map pExtraParameters)
Determines if a promotion qualified or not.
|
protected java.util.Set<RepositoryItem> |
getAppliedPromotions(java.util.List pItems)
Returns a list of applied promotions.
|
protected java.lang.String |
getCurrencyCode(CommerceItem pItem,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Return the currency code that should be used in the context of this pricing request
|
protected java.lang.String |
getCurrencyCode(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Return the currency code that should be used in the context of this pricing request
|
ItemPricingCalculator[] |
getPostCalculators()
Returns property PostCalculators
|
ItemPricingCalculator[] |
getPreCalculators()
Returns property PreCalculators
|
atg.commerce.pricing.PromotionProcessingComponent[] |
getPrePromotionProcessing()
Returns property PrePromotionProcessing
|
protected java.util.List<AmountInfo> |
getPriceInfoDetails(PricingContext pPricingContext,
java.util.Map pExtraParameters)
Returns price info details for each item.
|
java.util.Collection |
getPricingModels(RepositoryItem pProfile)
Returns a List of pricing models (e.g.
|
PricingTools |
getPricingTools()
pricing tools to help with calculating prices
|
protected java.lang.String |
getStackingRuleOrderLimitReachedMessageIdentifier()
Value for stacking rule order limit reached message identifier.
|
protected java.lang.String |
getStackingRulePromotionExcludedMessageIdentifier()
Value for stacking rule promotion excluded message identifier.
|
protected void |
mapItemToItemPriceSource(java.lang.String pCurrencyCode,
java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
This method is called by the engine prior to the pre-calcualtors being called.
|
java.util.List |
priceEachItem(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price each of a List of items in a context
|
ItemPriceInfo |
priceItem(CommerceItem pItem,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price a single item in a context
|
java.util.List |
priceItems(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
Price a List of items together in a context
|
void |
setPostCalculators(ItemPricingCalculator[] pPostCalculators)
Sets property PostCalculators
|
void |
setPreCalculators(ItemPricingCalculator[] pPreCalculators)
Sets property PreCalculators
|
void |
setPrePromotionProcessing(atg.commerce.pricing.PromotionProcessingComponent[] pPrePromotionProcessing)
Sets property PrePromotionProcessing
|
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with calculating prices
|
addPromotion, addPromotionToList, applyPromotionProcessing, checkAndAddPromotions, checkAndMergePromotions, checkPromotionExpiration, createEmptyItemPriceInfo, createMaxCouponsPerOrderLimitExclusionMessage, createPriceInfo, createStackingRuleExclusionMessage, didPromotionApply, doStartService, doStopService, expirePromotion, findGlobalPromotions, generateMaxCouponsPerOrderInfo, generateStackingRuleInfo, getAdjustmentPricingModels, getAlwaysLoadGlobalPromotions, getAppliedPromotions, getCalculator, getCalculatorForCalculatorType, getCalculatorTypeCalculators, getCalculatorTypes, getClosenessQualifierEvaluator, getCurrencyCode, getDefaultLocale, getGlobalPromotions, getGlobalPromotionsQuery, getGlobalPromotionsSchedulableDate, getInitialPromotions, getLocale, getMaxNoOfCouponsPerOrderLimitReachedMessageIdentifier, getPriceInfoClass, getPricingCurrencyCode, getPricingModelComparator, getPricingModelEvaluationVetoers, getPricingModelHolderVetoers, getPricingModelProperties, getProfileProperties, getPromotionItemDescriptors, getPromotionItemTypes, getPromotions, getPromotionsRepository, getPromotionTools, getQualifierService, getQualifierService, getQualifierService, getScheduler, getUpdateSchedule, getUserOnlyPromotions, isPromotionLinkedToCoupon, isUseMerge, isValidItemDescriptor, loadGlobalPromotions, performScheduledTask, prepareEvaluationVetoers, prepareHolderVetoers, pricingComplete, pricingStart, processCQPromotionAnalysisInformation, processDidPromotionApply, processDidPromotionApply, removeExpiredPromotions, resetEmptyItemPriceInfos, resolveCalculator, setAlwaysLoadGlobalPromotions, setCalculatorTypeCalculators, setClosenessQualifierEvaluator, setDefaultLocale, setGlobalPromotionsQuery, setGlobalPromotionsSchedulableDate, setPriceInfoClass, setPricingModelComparator, setPricingModelEvaluationVetoers, setPricingModelHolderVetoers, setPricingModelProperties, setProfileProperties, setPromotionItemTypes, setPromotionsRepository, setPromotionTools, setQualifierService, setScheduler, setUpdateSchedule, setupMaxCouponsPerOrderCollection, setupStackingRuleCollections, setUseMerge, skipPromotion, skipPromotion, updateMaxCouponsPerOrderTracking, updateStackingRuleTracking, vetoPromotionsForEvaluation, wasPromotionSkipped, wasPromotionSkippedaddLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic void setPreCalculators(ItemPricingCalculator[] pPreCalculators)
public ItemPricingCalculator[] getPreCalculators()
public void setPrePromotionProcessing(atg.commerce.pricing.PromotionProcessingComponent[] pPrePromotionProcessing)
public atg.commerce.pricing.PromotionProcessingComponent[] getPrePromotionProcessing()
public void setPostCalculators(ItemPricingCalculator[] pPostCalculators)
public ItemPricingCalculator[] getPostCalculators()
public void setPricingTools(PricingTools pPricingTools)
setPricingTools in class PricingEngineServicepPricingTools - new value to setpublic PricingTools getPricingTools()
getPricingTools in class PricingEngineServicepublic java.util.Collection getPricingModels(RepositoryItem pProfile)
getPricingModels in interface PricingEnginepProfile - The user's profile from which the engine will extract promotionsprotected java.lang.String getCurrencyCode(CommerceItem pItem, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
PricingException - if an error occurs while attempting to determine the currency codeprotected java.lang.String getCurrencyCode(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
throws PricingException
PricingException - if an error occurs while attempting to determine the currency codepublic ItemPriceInfo priceItem(CommerceItem pItem, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceItem in interface ItemPricingEnginepItem - The item to pricepPricingModels - A Collection of RepositoryItems representing PricingModelspLocale - The Locale to use for pricingpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingException - if an error occurs while attempting to pricepublic java.util.List priceEachItem(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
throws PricingException
priceEachItem in interface ItemPricingEnginepItems - The items to price (individually)pPricingModels - A Collection of RepositoryItems representing PricingModelspLocale - The Locale to use for pricingpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingException - if an error occurs while attempting to pricepublic java.util.List priceItems(java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
throws PricingException
priceItems in interface ItemPricingEnginepItems - The items to pricepPricingModels - A Collection of RepositoryItems representing PricingModelspLocale - The Locale to use for pricingpProfile - The user's profilepOrder - The Order object of which the List of items are a part, may be nullpExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingException - if an error occurs while attempting to priceprotected java.util.Collection<RepositoryItem> applyPromotions(java.util.Collection pPricingModels, int pPricingMethod, java.util.List pItemPriceQuotes, java.util.List pItems, PricingContext pPricingContext, java.util.Map pExtraParameters) throws PricingException
pPricingMethod - PricingMethod enumpItemPriceQuotes - List of ItemPriceInfo for the items being pricedpItems - List of CommerceItem being pricedpPricingContext - PricingContextpPricingModels - Collection of PricingModel to processpExtraParameters - Map of extra parameters, may be nullPricingExceptionprotected void applyCalculator(java.lang.Object pCalc,
int pPricingMethod,
java.util.List pItemPriceQuotes,
java.util.List pItems,
PricingContext pPricingContext,
java.util.Map pExtraParameters)
throws PricingException
pCalc - Calculator to callpPricingMethod - Calculator method to usepItemPriceQuotes - List of ItemPriceInfo for the commerce itemspItems - List of CommerceItem to pricepPricingContext - PricingContextpExtraParameters - Map of extra parametersPricingExceptionprotected void mapItemToItemPriceSource(java.lang.String pCurrencyCode,
java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
throws PricingException
ItemPriceSource objects to the items being priced.
The incoming source objects are extracted from the extra parameter map using
the key defined by PricingConstants.ITEM_PRICE_SOURCE_LIST_PARAM
The resulting map is added to the extra parameter map using the key
defined by PricingConstants.ITEM_PRICE_SOURCE_MAP_PARAM
pCurrencyCode - the currency code being used for the current pricing operationpItems - the items being pricedpPricingModels - pLocale - pProfile - pOrder - pExtraParameters - PricingExceptionPricingTools#generateItemPricingSourceMap(Collection, List, CommerceItem, String)public void checkPromotionsForCloseness(java.util.List pPriceInfos,
java.util.List pItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
Order pOrder,
java.util.Map pExtraParameters)
throws PricingException
pPriceInfos - The PriceInfos associated with the itemspItems - The items to checkpPricingModels - A Collection of RepositoryItems representing PricingModelspLocale - The Locale to use for pricingpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingException - if a problem occurred when checking for closenessprotected java.util.Set<RepositoryItem> getAppliedPromotions(java.util.List pItems)
pItems - list of all items in the orderprotected boolean didPromotionQualify(RepositoryItem pPricingModel, PricingContext pPricingContext, java.util.Map pExtraParameters) throws PricingException
true if the promotion qualified,
false otherwise.didPromotionQualify in class PricingEngineServicepPricingModel - promotion to checkpPricingContext - PricingContextpExtraParameters - Map of extra parameters, may be nulltrue if the promotion qualified, false otherwisePricingException - if something went wrongprotected java.util.List<AmountInfo> getPriceInfoDetails(PricingContext pPricingContext, java.util.Map pExtraParameters)
getPriceInfoDetails in class PricingEngineServicepPricingContext - PricingContextpExtraParameters - Map of extra parameters, may be nulltrue if the promotion qualified, false otherwiseprotected java.lang.String getStackingRuleOrderLimitReachedMessageIdentifier()
getStackingRuleOrderLimitReachedMessageIdentifier in class PricingEngineServiceprotected java.lang.String getStackingRulePromotionExcludedMessageIdentifier()
getStackingRulePromotionExcludedMessageIdentifier in class PricingEngineService