public class ShippingDiscountCalculator extends DiscountCalculatorService implements ShippingPricingCalculator
Qualifier.findQualifyingShipping for this purpose. If it gets back a ShippingGroup,
a ShippingPriceInfo is computed based on the input PricingModel (RepositoryItem).
If it obtains an ShippingGroup that qualified then it can determine the discount either via a DiscountStructure object being
passed into the calculator via the extra parameters map with key Constants.DISCOUNT_STRUCTURE or by getting the
discountType and adjuster properties of the input PricingModel (RepositoryItem).
Qualifier| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
AMOUNT_INCREASE_TYPE, AMOUNT_OFF_TYPE, FIXED_PRICE_TYPE, ILLEGAL_TYPE, mPromotionTools, PERCENT_OFF_TYPESERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
ShippingDiscountCalculator() |
| Modifier and Type | Method and Description |
|---|---|
void |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
protected double |
getAmountToDiscount(Order pOrder,
ShippingPriceInfo pPriceQuote,
ShippingGroup pShippingGroup,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This will return the amount that will eventually be discounted.
|
void |
getAvailableMethods(java.util.List pMethods,
ShippingGroup pShipment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Get shipping methods available to deliver the shipping group.
|
PricingTools |
getPricingTools()
pricing tools to help with generating prices
|
void |
priceShippingGroup(Order pOrder,
ShippingPriceInfo pPriceQuote,
ShippingGroup pShipment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price a shipment within a context
|
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with generating prices
|
adjust, adjustAmount, adjustAmount, getAdjuster, getDiscountType, getDiscountType, getPricingModelProperties, getPromotionTools, getQualifierService, getQualifierService, isNegativeAmountException, setNegativeAmountException, setPricingModelProperties, setPromotionTools, setQualifierServiceaddLogListener, createAdminServlet, doStopService, 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 setPricingTools(PricingTools pPricingTools)
pPricingTools - new value to setpublic PricingTools getPricingTools()
public void priceShippingGroup(Order pOrder, ShippingPriceInfo pPriceQuote, ShippingGroup pShipment, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceShippingGroup in interface ShippingPricingCalculatorpOrder - the Order in the context of which pShipment is being priced.pPriceQuote - ShippingPriceInfo representing the price quote for the shipmentpShipment - The shipment to pricepPricingModel - A Collection of RepositoryItems representing PricingModelspProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingExceptionpublic void getAvailableMethods(java.util.List pMethods,
ShippingGroup pShipment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
throws PricingException
getAvailableMethods in interface ShippingPricingCalculatorpMethods - List of Strings representing shipping methodspShipment - The shipping group to deliverpPricingModel - A Collection of RepositoryItems representing PricingModelspProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingExceptionprotected double getAmountToDiscount(Order pOrder, ShippingPriceInfo pPriceQuote, ShippingGroup pShippingGroup, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder - The order containing the shipping grouppPriceQuote - ShippingPriceInfo representing the current price quote for the shipping grouppShippingGroup - The shipping group that will be discounted (ignored by default)pPricingModel - A RepositoryItems representing a PricingModel (ignored by default)pProfile - The user's profile (ignored by default)pExtraParameters - A Map of extra parameters to be used in the pricing, may be null (ignored by default)PricingExceptionpublic void doStartService()
throws ServiceException
GenericServicedoStartService in class GenericServiceServiceException - if the Service had a problem starting up