atg.commerce.pricing
Interface PricingModelHolderVetoer


public interface PricingModelHolderVetoer

Interface to implement a promotion vetoer. Allows promotions to be vetoed before adding to the PricingModelHolder. Vetoers can be configured for a pricing engine. The engine will first call the prepareForVetoing method before iterating over the promotions and calling the vetoPromotion method.

See Also:
PricingEngineService.mPricingModelHolderVetoers

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 java.lang.Object prepareForVetoing(PricingEngineService pPricingEngine, RepositoryItem pProfile)
          Prepares a vetoer for vetoing promotions.
 java.lang.String vetoPromotion(PricingEngineService pPricingEngine, RepositoryItem pPromotion, RepositoryItem pProfile, java.lang.Object pVetoParam)
          Allows the promotion to be vetoed before adding to the PricingModelHolder
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

prepareForVetoing

java.lang.Object prepareForVetoing(PricingEngineService pPricingEngine,
                                   RepositoryItem pProfile)

Prepares a vetoer for vetoing promotions. Information can be returned from this method as an Object which will subsequently be passed into the vetoPromotion method for vetoing each promotion.

An implementation should only return null if it's vetoPromotion method should not be subsequently called for each promotion.

Parameters:
pPricingEngine - PricingEngineService that called this vetoer
pProfile - Profile of the PricingModelHolder session.
Returns:
Object that will be passed into vetoPromotion or null if this vetoer should not be used.
See Also:
#vetoPromotion(PricingEngineService, RepositoryItem, Object)

vetoPromotion

java.lang.String vetoPromotion(PricingEngineService pPricingEngine,
                               RepositoryItem pPromotion,
                               RepositoryItem pProfile,
                               java.lang.Object pVetoParam)

Allows the promotion to be vetoed before adding to the PricingModelHolder

Note: the passed in promotion may be a promotion OR a promotionStatus item so implementations must handle either type being passed in.

Parameters:
pPricingEngine - PricingEngineService that called this vetoer
pPromotion - RepositoryItem promotion or promotionStatus item.
pProfile - Profile of the PricingModelHolder session.
pVetoParam - Object returned by prepareForVetoing method, guaranteed to not be null
Returns:
null if the promotion should not be vetoed else a String describing why the promotion was vetoed.
See Also:
prepareForVetoing(PricingEngineService, RepositoryItem)