|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.pricing.PricingEngineService
public abstract class PricingEngineService
A GenericService version of a PricingEngine. PricingEngine implementations can extend this class in order to leverage scheduling, global promotions, locale, and other configuration functionality from the PricingEngineService.
Properties:
globalPromotionsQuery
. Re-running
that query generates a new list of global promotions.
globalPromotionsQuery
is periodically run.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected java.util.List |
mGlobalPromotions
|
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 | |
---|---|
PricingEngineService()
|
Method Summary | |
---|---|
protected boolean |
addPromotion(RepositoryItem pPromotion,
java.util.Date pNow)
This method determines if the given promotion should qualify for use in determing pricing. |
void |
addPromotionToList(RepositoryItem pPromotion,
java.util.List pPricingModels,
RepositoryItem pProfile)
Adds a new promotion to the list of pricing models. |
protected void |
checkAndAddPromotions(java.util.Collection pSource,
java.util.Collection pDestination,
java.util.Date pNow,
RepositoryItem pProfile)
Receives a collection of promotionStatus objects which are cycled through to determine which of these promotions has expired, and which should be added to the pricingModels used. |
protected boolean |
checkPromotionExpiration(RepositoryItem pPromotion,
java.util.Date pNow)
Return true if the promotion has expired and should be removed from the user's collection of active promotions |
protected AmountInfo |
createPriceInfo()
Returns a new instance of the of the class defined through the priceInfoClass
property. |
void |
doStartService()
Loads the global promotions. |
void |
doStopService()
Stops the schedule for updating the global promotions |
protected void |
expirePromotion(RepositoryItem pPromotion,
RepositoryItem pProfile)
Called if checkPromotionExpiration determines that a promotion has expired and
should no longer be active. |
protected java.util.List |
findGlobalPromotions()
Return the set of global promotions for this pricing engine |
protected java.util.List |
getAdjustmentPricingModels(AmountInfo pPriceInfo)
Gets the pricingModels from the priceInfo's "adjustments" property These are the promotions the order has qualified for, and should not be evaluated for closeness |
protected java.lang.Object |
getCalculator(RepositoryItem pPricingModel)
Return the pricing calculator that should be used for the given promotion. |
ClosenessQualifierEvaluator |
getClosenessQualifierEvaluator()
|
protected java.lang.String |
getCurrencyCode(java.util.Locale pLocale)
Return the currency code which should be used for the given locale. |
java.util.Locale |
getDefaultLocale()
Returns property DefaultLocale |
java.util.List |
getGlobalPromotions()
Returns property GlobalPromotions |
RqlStatement |
getGlobalPromotionsQuery()
Returns property GlobalPromotionsQuery |
CurrentDate |
getGlobalPromotionsSchedulableDate()
Returns property GlobalPromotionsSchedulableDate |
protected java.util.List |
getInitialPromotions(RepositoryItem pProfile)
Helper method that returns a List of promotions for given a Profile. |
java.lang.Class |
getPriceInfoClass()
Returns property PriceInfoClass |
java.util.Comparator |
getPricingModelComparator()
Returns property PricingModelComparator |
PricingModelProperties |
getPricingModelProperties()
Returns a bean that contains properties for a PricingModel |
java.lang.String[] |
getProfileProperties()
The profile properties to inspect for pricing models |
RepositoryItemDescriptor[] |
getPromotionItemDescriptors()
Returns the promotion item descriptors |
java.lang.String[] |
getPromotionItemTypes()
Returns property PromotionItemTypes |
java.util.List |
getPromotions(RepositoryItem pProfile)
|
Repository |
getPromotionsRepository()
The repository which contains the promotions |
PromotionTools |
getPromotionTools()
Returns property PromotionTools |
Scheduler |
getScheduler()
Returns property Scheduler |
Schedule |
getUpdateSchedule()
Returns property UpdateSchedule |
java.util.List |
getUserOnlyPromotions(RepositoryItem pProfile)
|
void |
loadGlobalPromotions()
Find and load the global promotions. |
void |
performScheduledTask(Scheduler pScheduler,
ScheduledJob pJob)
Reload the global promotions |
void |
setClosenessQualifierEvaluator(ClosenessQualifierEvaluator pClosenessQualifierEvaluator)
Component that evaluates if an order or item meets the closenessQualifiers for relevant promotions |
void |
setDefaultLocale(java.util.Locale pDefaultLocale)
Sets property DefaultLocale |
void |
setGlobalPromotionsQuery(RqlStatement pGlobalPromotionsQuery)
Sets property GlobalPromotionsQuery |
void |
setGlobalPromotionsSchedulableDate(CurrentDate pGlobalPromotionsSchedulableDate)
Sets property GlobalPromotionsSchedulableDate |
void |
setPriceInfoClass(java.lang.Class pPriceInfoClass)
Sets property PriceInfoClass |
void |
setPricingModelComparator(java.util.Comparator pPricingModelComparator)
Sets property PricingModelComparator |
void |
setPricingModelProperties(PricingModelProperties pPricingModelProperties)
|
void |
setProfileProperties(java.lang.String[] pProfileProperties)
|
void |
setPromotionItemTypes(java.lang.String[] pPromotionItemTypes)
Sets property PromotionItemTypes |
void |
setPromotionsRepository(Repository pPromotionsRepository)
|
void |
setPromotionTools(PromotionTools pPromotionTools)
Sets property PromotionTools |
void |
setScheduler(Scheduler pScheduler)
Sets property Scheduler |
void |
setUpdateSchedule(Schedule pUpdateSchedule)
Sets property UpdateSchedule |
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 |
---|
public static java.lang.String CLASS_VERSION
protected java.util.List mGlobalPromotions
Constructor Detail |
---|
public PricingEngineService()
Method Detail |
---|
public RepositoryItemDescriptor[] getPromotionItemDescriptors()
public void setPromotionTools(PromotionTools pPromotionTools)
public PromotionTools getPromotionTools()
public void setScheduler(Scheduler pScheduler)
public Scheduler getScheduler()
public void setUpdateSchedule(Schedule pUpdateSchedule)
public Schedule getUpdateSchedule()
public void setDefaultLocale(java.util.Locale pDefaultLocale)
public java.util.Locale getDefaultLocale()
public java.util.List getGlobalPromotions()
public void setPriceInfoClass(java.lang.Class pPriceInfoClass)
public java.lang.Class getPriceInfoClass()
public void setPricingModelComparator(java.util.Comparator pPricingModelComparator)
public java.util.Comparator getPricingModelComparator()
public void setClosenessQualifierEvaluator(ClosenessQualifierEvaluator pClosenessQualifierEvaluator)
pClosenessQualifierEvaluator
- the component that evaluates if an order
or item meets the closenessQualifiers for relevant promotionspublic ClosenessQualifierEvaluator getClosenessQualifierEvaluator()
public void setPricingModelProperties(PricingModelProperties pPricingModelProperties)
public PricingModelProperties getPricingModelProperties()
public void setProfileProperties(java.lang.String[] pProfileProperties)
public java.lang.String[] getProfileProperties()
public void setPromotionsRepository(Repository pPromotionsRepository)
public Repository getPromotionsRepository()
public void setPromotionItemTypes(java.lang.String[] pPromotionItemTypes)
public java.lang.String[] getPromotionItemTypes()
public void setGlobalPromotionsQuery(RqlStatement pGlobalPromotionsQuery)
public RqlStatement getGlobalPromotionsQuery()
public void setGlobalPromotionsSchedulableDate(CurrentDate pGlobalPromotionsSchedulableDate)
public CurrentDate getGlobalPromotionsSchedulableDate()
protected java.util.List findGlobalPromotions()
public void loadGlobalPromotions() throws PricingException
findGlobalPromotions
. The list returned by this operation
is made available through the globalPromotions
property.
PricingException
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- if an error occurred during the operationpublic void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
performScheduledTask
in interface Schedulable
pScheduler
- calling the jobpJob
- the ScheduledJobprotected java.lang.String getCurrencyCode(java.util.Locale pLocale)
protected AmountInfo createPriceInfo() throws PricingException
priceInfoClass
property.
PricingException
- if there was a problem instantiating the objectprotected java.util.List getInitialPromotions(RepositoryItem pProfile) throws PricingException
pProfile
- The user's profile from which the engine will extract promotions
PricingException
public void addPromotionToList(RepositoryItem pPromotion, java.util.List pPricingModels, RepositoryItem pProfile)
pPromotion
- pPricingModels
- pProfile
-
PricingException
checkAndAddPromotions(Collection, Collection, Date, RepositoryItem)
public java.util.List getUserOnlyPromotions(RepositoryItem pProfile) throws PricingException
PricingException
public java.util.List getPromotions(RepositoryItem pProfile) throws PricingException
PricingException
protected void checkAndAddPromotions(java.util.Collection pSource, java.util.Collection pDestination, java.util.Date pNow, RepositoryItem pProfile)
protected boolean addPromotion(RepositoryItem pPromotion, java.util.Date pNow)
pPromotion
- the promotion that should be verifiedpNow
- the current datepProfile
- the user's profile
protected boolean checkPromotionExpiration(RepositoryItem pPromotion, java.util.Date pNow)
pPromotion
- the promotion that should be verifiedpNow
- the current datepProfile
- the user's profileprotected void expirePromotion(RepositoryItem pPromotion, RepositoryItem pProfile)
checkPromotionExpiration
determines that a promotion has expired and
should no longer be active. Currently this method calls PromotionTools.expirePromotion.
pProfile
- the profile for which a promotion has expiredpPromotion
- the promotion which has expiredprotected java.lang.Object getCalculator(RepositoryItem pPricingModel) throws PricingException
pPromotion
- The promotion to examine for its PricingCalculator
PricingException
protected java.util.List getAdjustmentPricingModels(AmountInfo pPriceInfo)
pPriceInfo
- the priceInfo object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |