public class CachingPromotionsManager extends PromotionsManager
PromotionsManager.AutoApplyMode, PromotionsManager.RestrictionSetResultExtension.RestrictedLanguagesProvider, Extension.RightsProviderManager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CACHING_ALLOWED |
CATEGORYPROMOTIONRELATION_MARKMODIFIED, CATEGORYPROMOTIONRELATION_SRC_ORDERED, CATEGORYPROMOTIONRELATION_TGT_ORDERED, DEFAULT_INITIAL_ATTRIBUTES, ORDER2PROMOTIONRESULTSRELATIONALLPROMOTIONRESULTSHANDLER, PRODUCTPROMOTIONRELATION_MARKMODIFIED, PRODUCTPROMOTIONRELATION_SRC_ORDERED, PRODUCTPROMOTIONRELATION_TGT_ORDERED| Constructor and Description |
|---|
CachingPromotionsManager() |
autoApplyApplies, buildQueryForDistinctProductPromotionQuery, cleanupCart, cleanupOrphanedResults, cleanupOrphanedResults, createEssentialData, createPromotionGroup, createPromotionPriceRow, createPromotionPriceRow, createPromotionQuantityAndPricesRow, evaluatePromotion, evaluateRestrictions, evaluateRestrictions, filterPromotionsByRestrictions, findOrderAndProductPromotionsSortByPriority, fixupVouchersReapplyVouchers, fixupVouchersRemoveVouchers, getBaseProductsForOrder, getComposedType, getDefaultPromotionGroup, getDefaultPromotionGroup, getInstance, getLanguageNeutralSessionContext, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getProductPromotions, getProductPromotions, getProductPromotions, getPromotionGroup, getPromotionResults, getPromotionResults, initialiseDefaultLocalisedValues, initialiseDefaultLocalisedValues, keepApplied, makeActionGUID, notifyInitializationEnd, notifyInitializationStart, transferPromotionsToOrder, updatePromotions, updatePromotionsNotThreadSafeaddToAllPromotionResults, addToAllPromotionResults, addToPromotions, addToPromotions, addToPromotions, addToPromotions, createAbstractPromotionAction, createAbstractPromotionAction, createAbstractPromotionRestriction, createAbstractPromotionRestriction, createCachedPromotionNullAction, createCachedPromotionNullAction, createCachedPromotionOrderAddFreeGiftAction, createCachedPromotionOrderAddFreeGiftAction, createCachedPromotionOrderAdjustTotalAction, createCachedPromotionOrderAdjustTotalAction, createCachedPromotionOrderChangeDeliveryModeAction, createCachedPromotionOrderChangeDeliveryModeAction, createCachedPromotionOrderEntryAdjustAction, createCachedPromotionOrderEntryAdjustAction, createCachedPromotionOrderEntryConsumed, createCachedPromotionOrderEntryConsumed, createCachedPromotionResult, createCachedPromotionResult, createOrderPromotion, createOrderPromotion, createOrderThresholdChangeDeliveryModePromotion, createOrderThresholdChangeDeliveryModePromotion, createOrderThresholdDiscountPromotion, createOrderThresholdDiscountPromotion, createOrderThresholdFreeGiftPromotion, createOrderThresholdFreeGiftPromotion, createOrderThresholdFreeVoucherPromotion, createOrderThresholdFreeVoucherPromotion, createOrderThresholdPerfectPartnerPromotion, createOrderThresholdPerfectPartnerPromotion, createProductBOGOFPromotion, createProductBOGOFPromotion, createProductBundlePromotion, createProductBundlePromotion, createProductFixedPricePromotion, createProductFixedPricePromotion, createProductMultiBuyPromotion, createProductMultiBuyPromotion, createProductOneToOnePerfectPartnerPromotion, createProductOneToOnePerfectPartnerPromotion, createProductPercentageDiscountPromotion, createProductPercentageDiscountPromotion, createProductPerfectPartnerBundlePromotion, createProductPerfectPartnerBundlePromotion, createProductPerfectPartnerPromotion, createProductPerfectPartnerPromotion, createProductPromotion, createProductPromotion, createProductSteppedMultiBuyPromotion, createProductSteppedMultiBuyPromotion, createPromotionGroup, createPromotionGroup, createPromotionNullAction, createPromotionNullAction, createPromotionOrderAddFreeGiftAction, createPromotionOrderAddFreeGiftAction, createPromotionOrderAdjustTotalAction, createPromotionOrderAdjustTotalAction, createPromotionOrderChangeDeliveryModeAction, createPromotionOrderChangeDeliveryModeAction, createPromotionOrderEntryAdjustAction, createPromotionOrderEntryAdjustAction, createPromotionOrderEntryConsumed, createPromotionOrderEntryConsumed, createPromotionPriceRow, createPromotionPriceRow, createPromotionProductRestriction, createPromotionProductRestriction, createPromotionQuantityAndPricesRow, createPromotionQuantityAndPricesRow, createPromotionResult, createPromotionResult, createPromotionUserRestriction, createPromotionUserRestriction, getAllPromotionResults, getAllPromotionResults, getDefaultAttributeModes, getName, getPreviousDeliveryMode, getPreviousDeliveryMode, getPromotions, getPromotions, getPromotions, getPromotions, getPromotionsCount, getPromotionsCount, getPromotionsCount, getPromotionsCount, removeFromAllPromotionResults, removeFromPromotions, removeFromPromotions, removeFromPromotions, removeFromPromotions, setAllPromotionResults, setAllPromotionResults, setPreviousDeliveryMode, setPreviousDeliveryMode, setPromotions, setPromotions, setPromotions, setPromotionscheckBeforeItemRemoval, createProjectData, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, isCreatorDisabled, notifyItemRemoval, onFirstSessionCreation, writeReplaceafterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrapprotected static final java.lang.String CACHING_ALLOWED
public PromotionOrderResults updatePromotions(SessionContext ctx, java.util.Collection<PromotionGroup> promotionGroups, AbstractOrder order)
PromotionsManagerAbstractOrder object.
This method will automatically apply all possible product promotional updates to the cart, but not apply order
level promotions. Any previously applied order level promotions will remain applied. Promotions are evaluated at
the current system time.
The promotion results are stored in the database and the same PromotionOrderResults can be obtained later
by calling PromotionsManager.getPromotionResults(de.hybris.platform.jalo.order.AbstractOrder).updatePromotions in class PromotionsManagerctx - The hybris session contextpromotionGroups - The promotion groups to evaluateorder - The order object to update with the results of the promotionsPromotionsManager.updatePromotions(SessionContext, Collection, AbstractOrder, boolean, AutoApplyMode, AutoApplyMode, Date),
PromotionsManager.getPromotionResults(de.hybris.platform.jalo.order.AbstractOrder),
PromotionsManager.getPromotionResults(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.order.AbstractOrder),
PromotionsManager.getPromotionResults(SessionContext, Collection, AbstractOrder, boolean, AutoApplyMode, AutoApplyMode, Date)public PromotionOrderResults updatePromotions(SessionContext ctx, java.util.Collection<PromotionGroup> promotionGroups, AbstractOrder order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
PromotionsManagerAbstractOrder object.
The resulting promotions can be retrieved later by calling PromotionsManager.getPromotionResults(de.hybris.platform.jalo.order.AbstractOrder). The order must be
calculated before calling this method. PromotionsManager.updatePromotions(java.util.Collection<de.hybris.platform.promotions.jalo.PromotionGroup>, de.hybris.platform.jalo.order.AbstractOrder) must be called after calling
AbstractOrder.recalculate() on the AbstractOrder. Where the PromotionsManager.AutoApplyMode is set to
PromotionsManager.AutoApplyMode.KEEP_APPLIED the state of any previously applied PromotionResult is recorded and if
it is still in the fired state (PromotionResult.isApplied()) after reevaluating the promotions it will be
automatically reapplied.
The promotion results are stored in the database and the same PromotionOrderResults can be obtained later
by calling PromotionsManager.getPromotionResults(de.hybris.platform.jalo.order.AbstractOrder).updatePromotions in class PromotionsManagerctx - The hybris session contextpromotionGroups - The promotion groups to evaluateorder - The AbstractOrder object to update the promotions forevaluateRestrictions - If true any promotion restrictions will be observed, if false all promotion restrictions
are ignoredproductPromotionMode - The auto apply mode. This determines whether this method applies any product promotional changes to line
items or discounts to the overall amountorderPromotionMode - The auto apply mode. This determines whether this method applies any order promotional changes to line
items or discounts to the overall amountdate - The effective date for the promotions to check. Use this to to see the effects of promotions in the past
or future.PromotionsManager.getPromotionResults(de.hybris.platform.jalo.order.AbstractOrder),
PromotionsManager.getPromotionResults(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.order.AbstractOrder),
PromotionsManager.getPromotionResults(SessionContext, Collection, AbstractOrder, boolean, AutoApplyMode, AutoApplyMode, Date)public PromotionOrderResults getPromotionResults(SessionContext ctx, AbstractOrder order)
PromotionsManagerPromotionsManager.updatePromotions(java.util.Collection<de.hybris.platform.promotions.jalo.PromotionGroup>, de.hybris.platform.jalo.order.AbstractOrder) for the same order.
If any of the promotion results are invalid then they will be ignored. To force the list of promotions to be
recalculated either call PromotionsManager.updatePromotions(java.util.Collection<de.hybris.platform.promotions.jalo.PromotionGroup>, de.hybris.platform.jalo.order.AbstractOrder) or call the version of
PromotionsManager.getPromotionResults(SessionContext, Collection, AbstractOrder, boolean, AutoApplyMode, AutoApplyMode, Date)
.getPromotionResults in class PromotionsManagerctx - The session contextorder - The order to get the promotion results forPromotionsManager.updatePromotions(Collection, AbstractOrder),
PromotionsManager.updatePromotions(SessionContext, Collection, AbstractOrder),
PromotionsManager.updatePromotions(SessionContext, Collection, AbstractOrder, boolean, AutoApplyMode, AutoApplyMode, Date)public void cleanupCart(SessionContext ctx, Cart cart)
PromotionsManagercleanupCart in class PromotionsManagerctx - The session contextcart - The Cart to delete the results forpublic void transferPromotionsToOrder(SessionContext ctx, AbstractOrder source, Order target, boolean onlyTransferAppliedPromotions)
PromotionsManagertransferPromotionsToOrder in class PromotionsManagerctx - The session contextsource - The cart that has promotionstarget - The order that promotions should be applied toonlyTransferAppliedPromotions - Flag to indicate that only applied promotions should be transfered. If false all promotion results will
be transferedprotected java.util.List<PromotionResult> getPromotionResultsInternal(SessionContext ctx, AbstractOrder order)
PromotionsManagergetPromotionResultsInternal in class PromotionsManagerctx - The session contextorder - The order to get the promotion results forprotected void deleteStoredPromotionResults(SessionContext ctx, AbstractOrder order, boolean undoActions)
PromotionsManagerdeleteStoredPromotionResults in class PromotionsManagerctx - The session contextorder - The order to delete the results forundoActions - Undo the actions before deleting the promotion resultspublic PromotionOrderEntryConsumed createPromotionOrderEntryConsumed(SessionContext ctx, java.lang.String code, AbstractOrderEntry orderEntry, long quantity)
PromotionsManagerPromotionOrderEntryConsumed instance.createPromotionOrderEntryConsumed in class PromotionsManagerctx - The session contextcode - The object's codeorderEntry - The AbstractOrderEntry that is the base order entry for the objectquantity - The quantity mapped through from the base order entryPromotionOrderEntryConsumedpublic PromotionOrderEntryConsumed createPromotionOrderEntryConsumed(SessionContext ctx, java.lang.String code, AbstractOrderEntry orderEntry, long quantity, double adjustedUnitPrice)
PromotionsManagerPromotionOrderEntryConsumed instance.createPromotionOrderEntryConsumed in class PromotionsManagerctx - The session contextcode - The object's codeorderEntry - The AbstractOrderEntry that is the base order entry for the objectquantity - The quantity mapped through from the base order entryadjustedUnitPrice - The adjusted unit pricePromotionOrderEntryConsumedpublic PromotionResult createPromotionResult(SessionContext ctx, AbstractPromotion promotion, AbstractOrder order, float certainty)
PromotionsManagerPromotionResult instance.createPromotionResult in class PromotionsManagerctx - The session contextpromotion - The AbstractPromotion that created the PromotionResultorder - The AbstractOrder that the PromotionResult is related tocertainty - The certainty of firing in the range 0 to 1. 1.0 is fired, less than 1.0 is could fire.PromotionResultpublic PromotionOrderAdjustTotalAction createPromotionOrderAdjustTotalAction(SessionContext ctx, double totalAdjustment)
PromotionsManagerPromotionOrderAdjustTotalAction instance.createPromotionOrderAdjustTotalAction in class PromotionsManagerctx - The session contexttotalAdjustment - The amount to adjust the order total (positive increases order total, negative decreases)PromotionOrderAdjustTotalActionpublic PromotionOrderAddFreeGiftAction createPromotionOrderAddFreeGiftAction(SessionContext ctx, Product product, PromotionResult result)
PromotionsManagerPromotionOrderAddFreeGiftAction instance.createPromotionOrderAddFreeGiftAction in class PromotionsManagerctx - The session contextproduct - The Product to give awayresult - The PromotionResult that owns this action.PromotionOrderAddFreeGiftActionpublic PromotionOrderChangeDeliveryModeAction createPromotionOrderChangeDeliveryModeAction(SessionContext ctx, DeliveryMode deliveryMode)
PromotionsManagerPromotionOrderChangeDeliveryModeAction instance.createPromotionOrderChangeDeliveryModeAction in class PromotionsManagerctx - The session contextdeliveryMode - The DeliveryMode to set on the orderPromotionOrderChangeDeliveryModeActionpublic PromotionOrderEntryAdjustAction createPromotionOrderEntryAdjustAction(SessionContext ctx, Product product, long quantity, double adjustment)
createPromotionOrderEntryAdjustAction in class PromotionsManagerctx - The session contextproduct - The Product to adjustquantity - The quantity to adjustadjustment - The adjustment to makePromotionOrderEntryAdjustActionpublic PromotionOrderEntryAdjustAction createPromotionOrderEntryAdjustAction(SessionContext ctx, AbstractOrderEntry entry, long quantity, double adjustment)
PromotionsManagerPromotionOrderEntryAdjustAction instance.createPromotionOrderEntryAdjustAction in class PromotionsManagerctx - The session contextentry - The AbstractOrderEntry to adjustquantity - The quantity to adjustadjustment - The adjustment to makePromotionOrderEntryAdjustActionpublic PromotionOrderEntryAdjustAction createPromotionOrderEntryAdjustAction(SessionContext ctx, AbstractOrderEntry entry, double adjustment)
PromotionsManagercreatePromotionOrderEntryAdjustAction in class PromotionsManagerctx - The session contextentry - The AbstractOrderEntry to adjustadjustment - The adjustment to makePromotionOrderEntryAdjustActionpublic PromotionNullAction createPromotionNullAction(SessionContext ctx)
PromotionsManagerPromotionNullAction instance.createPromotionNullAction in class PromotionsManagerctx - The session contextPromotionNullActionpublic void removeFromAllPromotionResults(SessionContext ctx, AbstractOrder item, PromotionResult value)
GeneratedPromotionsManagervalue from allPromotionResults.removeFromAllPromotionResults in class GeneratedPromotionsManagervalue - the item to remove from allPromotionResultsprotected PromotionOrderResults doUpdatePromotions(SessionContext ctx, java.util.Collection<PromotionGroup> promotionGroups, AbstractOrder order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
protected PromotionOrderResults doUpdatePromotionsOutOfCache(SessionContext ctx, java.util.Collection<PromotionGroup> promotionGroups, AbstractOrder order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
protected java.util.List<PromotionResult> getNonCachedPromotionResultsInternal(SessionContext ctx, AbstractOrder order)
protected <T> T applyWithCachingEnabled(SessionContext ctx, AbstractOrder order, java.util.function.BiFunction<SessionContext,AbstractOrder,T> function)
protected JaloSession getCurrentJaloSession()
protected void acceptWithCachingEnabled(SessionContext ctx, AbstractOrder order, java.util.function.BiConsumer<SessionContext,AbstractOrder> consumer)
protected void setCachingAllowed(SessionContext ctx, AbstractOrder order)
protected boolean isCachingAllowed(SessionContext ctx)
public CachingStrategy getCache()
public void setCache(CachingStrategy cache)
Copyright © 2018 SAP SE. All Rights Reserved.