atg.commerce.pricing
Class ClosenessQualifierEvaluator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.pricing.ClosenessQualifierEvaluator
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
ItemClosenessQualifierEvaluator, OrderClosenessQualifierEvaluator, ShippingClosenessQualifierEvaluator, TaxClosenessQualifierEvaluator

public class ClosenessQualifierEvaluator
extends GenericService

This class serves as the base class for several specific types of ClosenessQualiferEvaluators: ItemClosenessQualifierEvaluator, OrderClosenessQualifierEvaluator, ShippingClosenessQualifierEvaluator, and TaxClosenessQualifierEvaluator.

The ClosenessQualifierEvaluators check to see if an order or item is close to qualifying for a given promotion under the "closenessQualifiers" of the promotion. If the order or item qualifies as close, information is added to the given PriceInfo object to indicate that the promotion is close, and a PromotionClosenessQualification event is fired.

If the PriceInfo of the item or order contains a closenessQualifier that it no longer satisfies, a PromotionClosenessDisqualification event is fired.

Properties:

See Also:
ItemClosenessQualifierEvaluator, OrderClosenessQualifierEvaluator, ShippingClosenessQualifierEvaluator, TaxClosenessQualifierEvaluator, Qualifier

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
static int TYPE_ITEM
           
static int TYPE_ORDER
           
static int TYPE_SHIPPING
           
 
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
ClosenessQualifierEvaluator()
           
 
Method Summary
protected  void addClosenessQualifierToPriceInfo(AmountInfo pPriceInfo, RepositoryItem pClosenessQualifier)
          Adds the given closenessQualifier to the given priceInfo
protected  void checkForNullParameters(AmountInfo pPriceInfo, RepositoryItem pPricingModel, java.lang.Object pCommerceObject, java.lang.String pResource)
          Throws a PricingException if the pPriceInfo, pPricingModel, or pCommerceObject parameters are null.
protected  void checkForNullParameters(java.lang.Object pPriceInfo, RepositoryItem pPricingModel, java.lang.Object pCommerceObject, java.lang.String pResource)
          Throws a PricingException if the pPriceInfo, pPricingModel, or pCommerceObject parameters are null.
protected  java.util.List getPriceQuotes(java.util.List pCommerceItems)
          Returns a list of PriceInfo objects associated with the given commerce items.
 java.util.Comparator getPricingModelComparator()
           
 PricingModelProperties getPricingModelProperties()
           
 Qualifier getQualifierService()
           
protected  boolean isUpsellable(RepositoryItem pPricingModel)
          Returns the value of the "upsell" property of the pricingModel
 void setPricingModelComparator(java.util.Comparator pPricingModelComparator)
          Sets the component that sorts the closenessQualifiers based on their priority
 void setPricingModelProperties(PricingModelProperties pPricingModelProperties)
          Sets the component that holds the names of the properties in the pricingModel item descriptor
 void setQualifierService(Qualifier pQualifierService)
          Sets a component that does the pricing model qualification
 
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, reResolveThis, 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


sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle


TYPE_ITEM

public static final int TYPE_ITEM
See Also:
Constant Field Values

TYPE_SHIPPING

public static final int TYPE_SHIPPING
See Also:
Constant Field Values

TYPE_ORDER

public static final int TYPE_ORDER
See Also:
Constant Field Values
Constructor Detail

ClosenessQualifierEvaluator

public ClosenessQualifierEvaluator()
Method Detail

setPricingModelComparator

public void setPricingModelComparator(java.util.Comparator pPricingModelComparator)
Sets the component that sorts the closenessQualifiers based on their priority

Parameters:
pPricingModelComparator - the component that sorts the closenessQualifiers based on their priority

getPricingModelComparator

public java.util.Comparator getPricingModelComparator()
Returns:
the component that sorts the closenessQualifiers based on their priority

setPricingModelProperties

public void setPricingModelProperties(PricingModelProperties pPricingModelProperties)
Sets the component that holds the names of the properties in the pricingModel item descriptor

Parameters:
pPricingModelProperties - the component that holds the names of the properties in the pricingModel item descriptor

getPricingModelProperties

public PricingModelProperties getPricingModelProperties()
Returns:
the component that holds the names of the properties in the pricingModel item descriptor

setQualifierService

public void setQualifierService(Qualifier pQualifierService)
Sets a component that does the pricing model qualification

Parameters:
pPricingModelProperties - a component that does the pricing model qualification

getQualifierService

public Qualifier getQualifierService()
Returns:
a component that does the pricing model qualification

addClosenessQualifierToPriceInfo

protected void addClosenessQualifierToPriceInfo(AmountInfo pPriceInfo,
                                                RepositoryItem pClosenessQualifier)
Adds the given closenessQualifier to the given priceInfo

Parameters:
pPriceInfo -
pClosenessQualifier -

checkForNullParameters

protected void checkForNullParameters(AmountInfo pPriceInfo,
                                      RepositoryItem pPricingModel,
                                      java.lang.Object pCommerceObject,
                                      java.lang.String pResource)
                               throws PricingException
Throws a PricingException if the pPriceInfo, pPricingModel, or pCommerceObject parameters are null.

Parameters:
pPriceInfo -
pPricingModel -
pCommerceObject -
pCommerceObjectResource -
Throws:
PricingException

checkForNullParameters

protected void checkForNullParameters(java.lang.Object pPriceInfo,
                                      RepositoryItem pPricingModel,
                                      java.lang.Object pCommerceObject,
                                      java.lang.String pResource)
                               throws PricingException
Throws a PricingException if the pPriceInfo, pPricingModel, or pCommerceObject parameters are null.

Parameters:
pPriceInfo -
pPricingModel -
pCommerceObject -
pCommerceObjectResource -
Throws:
PricingException

getPriceQuotes

protected java.util.List getPriceQuotes(java.util.List pCommerceItems)
Returns a list of PriceInfo objects associated with the given commerce items.

Parameters:
pCommerceItems -
Returns:
a List of PriceInfo objects associated with the given commerce items.

isUpsellable

protected boolean isUpsellable(RepositoryItem pPricingModel)
Returns the value of the "upsell" property of the pricingModel

Parameters:
pPricingModel -
Returns:
boolean the value of the "upsell" property of the pricingModel