atg.commerce.pricing
Class BulkShippingDiscountCalculator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.pricing.DiscountCalculatorService
              extended by atg.commerce.pricing.ShippingDiscountCalculator
                  extended by atg.commerce.pricing.BulkShippingDiscountCalculator
All Implemented Interfaces:
CalculatorInfoProvider, ShippingPricingCalculator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class BulkShippingDiscountCalculator
extends ShippingDiscountCalculator
implements CalculatorInfoProvider

Calculator to support bulk shipping discount. This calculator requires a discount structure with 1 or more discount detail. Each discount detail represents a tier of the bulk discount. Example PMDL:


Field Summary
static java.lang.String BULK_CALCULATOR_TYPE
          PMDL calculator type
static java.lang.String CLASS_VERSION
          Class version string
protected  BandedDiscountCalculatorHelper mBandedDiscountCalculatorHelper
          Banding discount calculator helper
protected  java.lang.String mDefaultBandingProperty
          Default banding property defaults to the order price info.
protected  java.lang.String mDefaultBandingPropertyScope
          Default banding property scope default null scope, i.e.
 
Fields inherited from class atg.commerce.pricing.DiscountCalculatorService
AMOUNT_INCREASE_TYPE, AMOUNT_OFF_TYPE, FIXED_PRICE_TYPE, ILLEGAL_TYPE, mPromotionTools, PERCENT_OFF_TYPE
 
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
BulkShippingDiscountCalculator()
           
 
Method Summary
 void doStartService()
          Checks to see if property qualifierService is set
 double getAdjuster(RepositoryItem pPricingModel, java.util.Map pExtraParameters)
          Uses the banded discount helper to determine the adjuster to use.
 BandedDiscountCalculatorHelper getBandedDiscountCalculatorHelper()
           
 CalculatorInfo getCalculatorInfo()
          Provide a CalculatorInfo for the calculator
 java.lang.String getCalculatorType()
          Gets the String calculator type of this calculator
 java.lang.String getDefaultBandingProperty()
           
 java.lang.String getDefaultBandingPropertyScope()
           
 void setBandedDiscountCalculatorHelper(BandedDiscountCalculatorHelper pBandedDiscountCalculatorHelper)
           
 void setDefaultBandingProperty(java.lang.String pDefaultBandingProperty)
           
 void setDefaultBandingPropertyScope(java.lang.String pDefaultBandingPropertyScope)
           
 
Methods inherited from class atg.commerce.pricing.ShippingDiscountCalculator
getAmountToDiscount, getAvailableMethods, getPricingTools, priceShippingGroup, setPricingTools
 
Methods inherited from class atg.commerce.pricing.DiscountCalculatorService
adjust, adjustAmount, getDiscountType, getDiscountType, getPricingModelProperties, getPromotionTools, getQualifierService, getQualifierService, isNegativeAmountException, setNegativeAmountException, setPricingModelProperties, setPromotionTools, setQualifierService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

BULK_CALCULATOR_TYPE

public static final java.lang.String BULK_CALCULATOR_TYPE
PMDL calculator type

See Also:
Constant Field Values

mDefaultBandingProperty

protected java.lang.String mDefaultBandingProperty
Default banding property defaults to the order price info.


mDefaultBandingPropertyScope

protected java.lang.String mDefaultBandingPropertyScope
Default banding property scope default null scope, i.e. not DIPI or QualifiedItem scope.


mBandedDiscountCalculatorHelper

protected BandedDiscountCalculatorHelper mBandedDiscountCalculatorHelper
Banding discount calculator helper

Constructor Detail

BulkShippingDiscountCalculator

public BulkShippingDiscountCalculator()
Method Detail

setDefaultBandingProperty

public void setDefaultBandingProperty(java.lang.String pDefaultBandingProperty)

getDefaultBandingProperty

public java.lang.String getDefaultBandingProperty()

setDefaultBandingPropertyScope

public void setDefaultBandingPropertyScope(java.lang.String pDefaultBandingPropertyScope)

getDefaultBandingPropertyScope

public java.lang.String getDefaultBandingPropertyScope()

getBandedDiscountCalculatorHelper

public BandedDiscountCalculatorHelper getBandedDiscountCalculatorHelper()

setBandedDiscountCalculatorHelper

public void setBandedDiscountCalculatorHelper(BandedDiscountCalculatorHelper pBandedDiscountCalculatorHelper)

getAdjuster

public double getAdjuster(RepositoryItem pPricingModel,
                          java.util.Map pExtraParameters)
                   throws PricingException
Uses the banded discount helper to determine the adjuster to use.

Overrides:
getAdjuster in class DiscountCalculatorService
Parameters:
pPricingModel - RepositoryItem pricing model
pExtraParameters - Map of optional extra parameters, may be null
Returns:
double adjuster to use or NaN if no valid band applies
Throws:
PricingException - if the method fails to get a valid double adjuster
See Also:
BandedDiscountCalculatorHelper.getAdjuster(RepositoryItem, Collection, Map, String, String)

getCalculatorType

public java.lang.String getCalculatorType()
Gets the String calculator type of this calculator

Returns:
String calculator type

getCalculatorInfo

public CalculatorInfo getCalculatorInfo()
Provide a CalculatorInfo for the calculator

Specified by:
getCalculatorInfo in interface CalculatorInfoProvider
Returns:
CalculatorInfo

doStartService

public void doStartService()
                    throws ServiceException
Checks to see if property qualifierService is set

Overrides:
doStartService in class ShippingDiscountCalculator
Throws:
ServiceException - if there was a problem initializing this service