org.broadleafcommerce.core.offer.service
Class AbstractOfferServiceExtensionHandler

java.lang.Object
  extended by org.broadleafcommerce.common.extension.AbstractExtensionHandler
      extended by org.broadleafcommerce.core.offer.service.AbstractOfferServiceExtensionHandler
All Implemented Interfaces:
ExtensionHandler, OfferServiceExtensionHandler

public class AbstractOfferServiceExtensionHandler
extends AbstractExtensionHandler
implements OfferServiceExtensionHandler

Author:
Andre Azzolini (apazzolini), bpolster

Field Summary
 
Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority
 
Constructor Summary
AbstractOfferServiceExtensionHandler()
           
 
Method Summary
 ExtensionResultStatusType applyAdditionalFilters(List<Offer> offers)
           
 ExtensionResultStatusType applyItemOffer(PromotableOrder order, PromotableCandidateItemOffer itemOffer, Map<String,Object> contextMap)
          Modules may need to extend the applyItemOffer logic For example, a subscription module might creates future payment adjustments.
 ExtensionResultStatusType calculatePotentialSavings(PromotableCandidateItemOffer itemOffer, PromotableOrderItem item, int quantity, Map<String,Object> contextMap)
          Modules may extend the calculatePotentialSavings method.
 ExtensionResultStatusType chooseSaleOrRetailAdjustments(PromotableOrder order)
          Allows a module to finalize adjustments.
 ExtensionResultStatusType createOrderItemPriceDetailAdjustment(ExtensionResultHolder resultHolder, OrderItemPriceDetail itemDetail)
          Allows module extensions to add a create a new instance of OrderItemPriceDetailAdjustment.
 ExtensionResultStatusType resetPriceDetails(PromotableOrderItem item)
          Modules may need to clear additional offer details when resetPriceDetails is called.
 ExtensionResultStatusType synchronizeAdjustmentsAndPrices(PromotableOrder order)
          Allows a module to amend the data that synchronizes the PromotableOrder with the Order
 
Methods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
getPriority, isEnabled, setEnabled, setPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
 

Constructor Detail

AbstractOfferServiceExtensionHandler

public AbstractOfferServiceExtensionHandler()
Method Detail

applyAdditionalFilters

public ExtensionResultStatusType applyAdditionalFilters(List<Offer> offers)
Specified by:
applyAdditionalFilters in interface OfferServiceExtensionHandler

calculatePotentialSavings

public ExtensionResultStatusType calculatePotentialSavings(PromotableCandidateItemOffer itemOffer,
                                                           PromotableOrderItem item,
                                                           int quantity,
                                                           Map<String,Object> contextMap)
Description copied from interface: OfferServiceExtensionHandler
Modules may extend the calculatePotentialSavings method. Once the handlers run, the contextMap will be checked for an entry with a key of "savings". If that entry returns a non-null Money, that value will be returned from the calling method. Otherwise, the map will be checked for an entry with a key of "quantity". If a non-null Integer is returned, that value will replace the quantity call in the normal call to calculatePotentialSavings. This extension is utilized by one or more BLC enterprise modules including Subscription.

Specified by:
calculatePotentialSavings in interface OfferServiceExtensionHandler
Returns:

resetPriceDetails

public ExtensionResultStatusType resetPriceDetails(PromotableOrderItem item)
Description copied from interface: OfferServiceExtensionHandler
Modules may need to clear additional offer details when resetPriceDetails is called.

Specified by:
resetPriceDetails in interface OfferServiceExtensionHandler
Returns:

applyItemOffer

public ExtensionResultStatusType applyItemOffer(PromotableOrder order,
                                                PromotableCandidateItemOffer itemOffer,
                                                Map<String,Object> contextMap)
Description copied from interface: OfferServiceExtensionHandler
Modules may need to extend the applyItemOffer logic For example, a subscription module might creates future payment adjustments. The module add an attribute of type Boolean to the contextMap named "stopProcessing" indicating to the core offer engine that further adjustment processing is not needed.

Specified by:
applyItemOffer in interface OfferServiceExtensionHandler
Returns:

synchronizeAdjustmentsAndPrices

public ExtensionResultStatusType synchronizeAdjustmentsAndPrices(PromotableOrder order)
Description copied from interface: OfferServiceExtensionHandler
Allows a module to amend the data that synchronizes the PromotableOrder with the Order

Specified by:
synchronizeAdjustmentsAndPrices in interface OfferServiceExtensionHandler
Returns:

chooseSaleOrRetailAdjustments

public ExtensionResultStatusType chooseSaleOrRetailAdjustments(PromotableOrder order)
Description copied from interface: OfferServiceExtensionHandler
Allows a module to finalize adjustments.

Specified by:
chooseSaleOrRetailAdjustments in interface OfferServiceExtensionHandler
Returns:

createOrderItemPriceDetailAdjustment

public ExtensionResultStatusType createOrderItemPriceDetailAdjustment(ExtensionResultHolder resultHolder,
                                                                      OrderItemPriceDetail itemDetail)
Description copied from interface: OfferServiceExtensionHandler
Allows module extensions to add a create a new instance of OrderItemPriceDetailAdjustment. The module should add the value to the resultHolder.getContextMap() with a key of "OrderItemPriceDetailAdjustment"

Specified by:
createOrderItemPriceDetailAdjustment in interface OfferServiceExtensionHandler
Returns:


Copyright © 2013. All Rights Reserved.