|
|||||||||
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.PricingModelHolder
public class PricingModelHolder
A session-scoped component which is intended to hold all the active promotions (aka pricing models) of a user while they are using the web application. The pricing engine APIs define a method by which pricing models for a user can be collected. However it may be expense to perform this operation, therefore these collections are essentially a session cache of promotions. This service on startup will query each pricing engine to load the pricing models that the user should have. If during the life cycle of the session, new promotions are given to the user the initialization methods should be called on this component. When the initialization methods are invoked the pricing engines are asked to give the promotions again.
The PricingTools class understands how to utilize this class to perform order pricing. Each pricing engine only takes as a parameter the collection of pricing models that apply to it's style (e.g. order vs. item pricing). The PricingTools method which accept a PricingModelHolder will pull out each individual collection and pass them into the appropriate pricing engines.
It is not intended for developers to create an instance of this class, and to call into the PricingTools class. A class instance should only be instantiated as a session-scoped component, which can be resolved through the request. This is the pattern that the item pricing droplets use, if no pricing models are supplied as explicit parameters, then the PricingModelHolder is resolved from the request and the collection is fetched.
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 | |
---|---|
PricingModelHolder()
Constructs an instanceof PricingModelHolder |
Method Summary | |
---|---|
void |
doStartService()
For each pricing engine load the default pricing models |
java.util.Collection |
getAllPromotions()
Returns property AllPromotions |
ItemPricingEngine |
getItemPricingEngine()
Returns property ItemPricingEngine |
java.util.Collection |
getItemPricingModels()
Returns property ItemPricingModels |
OrderPricingEngine |
getOrderPricingEngine()
Returns property OrderPricingEngine |
java.util.Collection |
getOrderPricingModels()
Returns property OrderPricingModels |
RepositoryItem |
getProfile()
Returns property Profile |
PromotionTools |
getPromotionTools()
Returns property PromotionTools |
long |
getReinitializeTime()
The number of milliseconds that are allowed to pass before the pricing models are reinitialized |
ShippingPricingEngine |
getShippingPricingEngine()
Returns property ShippingPricingEngine |
java.util.Collection |
getShippingPricingModels()
Returns property ShippingPricingModels |
TaxPricingEngine |
getTaxPricingEngine()
Returns property TaxPricingEngine |
java.util.Collection |
getTaxPricingModels()
Returns property TaxPricingModels |
void |
initializeAllPromotions()
Reload the all promotions property from the individual collections in the holder. |
void |
initializeItemPricingModels()
Reload the pricing models for pricing items |
void |
initializeOrderPricingModels()
Reload the pricing models for pricing the order (e.g. |
void |
initializePricingModels()
Reload the all pricing models |
void |
initializeShippingPricingModels()
Reload the pricing models for determining shipping costs |
void |
initializeTaxPricingModels()
Reload the pricing models for calculating tax |
boolean |
isEnableInit()
Check status of enabled initialization flag |
boolean |
isPromotionInHolder(java.lang.String pPromotionId)
Returns true if the given promotion is in the holder |
void |
setAllPromotions(java.util.Collection pAllPromotions)
Deprecated. this is a no-op implementation as this property is read only and provides a consolidate collection of all promotions in the holder. |
void |
setEnableInit(boolean pEnableInit)
Enable or disable initialization to prevent the holder from being initialized through its timer or initializePricingModel. |
void |
setItemPricingEngine(ItemPricingEngine pItemPricingEngine)
Sets property ItemPricingEngine |
void |
setItemPricingModels(java.util.Collection pItemPricingModels)
Sets property ItemPricingModels |
void |
setOrderPricingEngine(OrderPricingEngine pOrderPricingEngine)
Sets property OrderPricingEngine |
void |
setOrderPricingModels(java.util.Collection pOrderPricingModels)
Sets property OrderPricingModels |
void |
setProfile(RepositoryItem pProfile)
Sets property Profile |
void |
setPromotionTools(PromotionTools pPromotionTools)
Sets property PromotionTools |
void |
setReinitializeTime(long pReinitializeTime)
|
void |
setShippingPricingEngine(ShippingPricingEngine pShippingPricingEngine)
Sets property ShippingPricingEngine |
void |
setShippingPricingModels(java.util.Collection pShippingPricingModels)
Sets property ShippingPricingModels |
void |
setTaxPricingEngine(TaxPricingEngine pTaxPricingEngine)
Sets property TaxPricingEngine |
void |
setTaxPricingModels(java.util.Collection pTaxPricingModels)
Sets property TaxPricingModels |
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
Constructor Detail |
---|
public PricingModelHolder()
Method Detail |
---|
public void setProfile(RepositoryItem pProfile)
public RepositoryItem getProfile()
public void setItemPricingEngine(ItemPricingEngine pItemPricingEngine)
public ItemPricingEngine getItemPricingEngine()
public void setOrderPricingEngine(OrderPricingEngine pOrderPricingEngine)
public OrderPricingEngine getOrderPricingEngine()
public void setTaxPricingEngine(TaxPricingEngine pTaxPricingEngine)
public TaxPricingEngine getTaxPricingEngine()
public void setShippingPricingEngine(ShippingPricingEngine pShippingPricingEngine)
public ShippingPricingEngine getShippingPricingEngine()
public void setItemPricingModels(java.util.Collection pItemPricingModels)
public java.util.Collection getItemPricingModels()
public void setOrderPricingModels(java.util.Collection pOrderPricingModels)
public java.util.Collection getOrderPricingModels()
public void setTaxPricingModels(java.util.Collection pTaxPricingModels)
public java.util.Collection getTaxPricingModels()
public void setShippingPricingModels(java.util.Collection pShippingPricingModels)
public java.util.Collection getShippingPricingModels()
public void setAllPromotions(java.util.Collection pAllPromotions)
public java.util.Collection getAllPromotions()
public void setPromotionTools(PromotionTools pPromotionTools)
public PromotionTools getPromotionTools()
public void setReinitializeTime(long pReinitializeTime)
public long getReinitializeTime()
public void setEnableInit(boolean pEnableInit)
public boolean isEnableInit()
public void initializeItemPricingModels()
public void initializeOrderPricingModels()
public void initializeTaxPricingModels()
public void initializeShippingPricingModels()
public void initializeAllPromotions()
public void initializePricingModels()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic boolean isPromotionInHolder(java.lang.String pPromotionId)
pPromotionId
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |