Class CachedPromotionResult
java.lang.Object
de.hybris.platform.util.BridgeAbstraction
de.hybris.platform.jalo.Item
de.hybris.platform.jalo.ExtensibleItem
de.hybris.platform.jalo.c2l.LocalizableItem
de.hybris.platform.jalo.GenericItem
de.hybris.platform.promotions.jalo.GeneratedPromotionResult
de.hybris.platform.promotions.jalo.PromotionResult
de.hybris.platform.promotions.jalo.GeneratedCachedPromotionResult
de.hybris.platform.promotions.jalo.CachedPromotionResult
- All Implemented Interfaces:
JaloOnlyItem,Serializable,Comparable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
Fields inherited from class de.hybris.platform.promotions.jalo.GeneratedCachedPromotionResult
CACHEDACTIONS, CACHEDCONSUMEDENTRIES, DEFAULT_INITIAL_ATTRIBUTESFields inherited from class de.hybris.platform.promotions.jalo.GeneratedPromotionResult
ACTIONS, ALLPROMOTIONACTIONS, ALLPROMOTIONACTIONSHANDLER, CERTAINTY, CONSUMEDENTRIES, CUSTOM, ORDER, ORDERHANDLER, PROMOTIONFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAction(SessionContext ctx, AbstractPromotionAction action) Adds an action to the promotion results.voidAdds a consumed entry to the current result.voidGenerated method - Addsvalueto allPromotionActions.voidaddToCachedActions(SessionContext ctx, AbstractPromotionAction action) voidprotected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Has to be implemented for each concrete subtype of item.doGetAttribute(SessionContext ctx, String attrQualifier) Custom attribute access as part ofJaloOnlyItemcontract.voiddoSetAttribute(SessionContext ctx, String attrQualifier, Object value) Custom attribute access as part ofJaloOnlyItemcontract.getActions(SessionContext ctx) Gets the collection ofAbstractPromotionActioninstances.Generated method - Getter of thePromotionResult.allPromotionActionsattribute.Generated method - Getter of theCachedPromotionResult.cachedActionsattribute.getCachedConsumedEntries(SessionContext sessionContext) Generated method - Getter of theCachedPromotionResult.cachedConsumedEntriesattribute.Generated method - Getter of thePromotionResult.certaintyattribute.Gets the collection ofPromotionOrderEntryConsumedconsumed.getCustom(SessionContext ctx) Generated method - Getter of thePromotionResult.customattribute.getOrder(SessionContext ctx) Generated method - Getter of thePromotionResult.orderattribute.Generated method - Getter of thePromotionResult.promotionattribute.final ComposedTypeProvides composed as part ofJaloOnlyItemcontract.final DateProvides creation time as part ofJaloOnlyItemcontract.final DateProvides modification time as part ofJaloOnlyItemcontract.final PKProvides PK part ofJaloOnlyItemcontract.voidRemoves a consumed entry from the current result.voidGenerated method - Removesvaluefrom allPromotionActions.voidremoveFromCachedActions(SessionContext ctx, AbstractPromotionAction action) voidvoidCustom removal logic as part ofJaloOnlyItemcontract.voidsetActions(SessionContext ctx, Collection actions) Sets the collection ofAbstractPromotionActioninstance.voidsetAllPromotionActions(SessionContext ctx, Set<AbstractPromotionAction> actions) Generated method - Setter of thePromotionResult.allPromotionActionsattribute.voidsetCachedActions(SessionContext ctx, Collection<AbstractPromotionAction> abstractPromotionActions) Generated method - Setter of theCachedPromotionResult.cachedActionsattribute.voidsetCachedConsumedEntries(SessionContext ctx, Collection<CachedPromotionOrderEntryConsumed> cachedConsumedEntries) Generated method - Setter of theCachedPromotionResult.cachedConsumedEntriesattribute.voidsetCertainty(SessionContext ctx, Float certainty) Generated method - Setter of thePromotionResult.certaintyattribute.voidsetConsumedEntries(SessionContext ctx, Collection entries) Sets the collection ofPromotionOrderEntryConsumedconsumed.voidsetCustom(SessionContext ctx, String custom) Generated method - Setter of thePromotionResult.customattribute.voidsetOrder(SessionContext ctx, AbstractOrder order) Generated method - Setter of thePromotionResult.orderattribute.voidsetPromotion(SessionContext ctx, AbstractPromotion promotion) Generated method - Setter of thePromotionResult.promotionattribute.Methods inherited from class de.hybris.platform.promotions.jalo.GeneratedCachedPromotionResult
getCachedActions, getCachedConsumedEntries, getDefaultAttributeModes, setCachedActions, setCachedConsumedEntriesMethods inherited from class de.hybris.platform.promotions.jalo.PromotionResult
apply, apply, deepCloneAllActions, deepCloneConsumedEntriesAndAttachToOrder, deepCloneConsumedEntryAndAttachToOrder, findOrderEntryWithEntryNumber, getConsumedCount, getConsumedCount, getCouldFire, getCouldFire, getDataUnigueKey, getDescription, getDescription, getDescription, getFired, getFired, getTotalDiscount, getTotalDiscount, isApplied, isApplied, isAppliedToOrder, isValid, remove, transferToOrder, undo, undoMethods inherited from class de.hybris.platform.promotions.jalo.GeneratedPromotionResult
addToAllPromotionActions, getActions, getAllPromotionActions, getCertainty, getCertaintyAsPrimitive, getCertaintyAsPrimitive, getConsumedEntries, getCustom, getOrder, getPromotion, removeFromAllPromotionActions, setActions, setAllPromotionActions, setCertainty, setCertainty, setCertainty, setConsumedEntries, setCustom, setOrder, setPromotionMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, getRelatedItems, setRelatedItemsMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, toString, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Constructor Details
-
CachedPromotionResult
public CachedPromotionResult()
-
-
Method Details
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Description copied from class:ItemHas to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map).In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }- Overrides:
createItemin classGeneratedPromotionResult- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
getCertainty
Description copied from class:GeneratedPromotionResultGenerated method - Getter of thePromotionResult.certaintyattribute.- Overrides:
getCertaintyin classGeneratedPromotionResult- Returns:
- the certainty - Certainty
-
setCertainty
Description copied from class:GeneratedPromotionResultGenerated method - Setter of thePromotionResult.certaintyattribute.- Overrides:
setCertaintyin classGeneratedPromotionResultcertainty- the certainty - Certainty
-
getCustom
Description copied from class:GeneratedPromotionResultGenerated method - Getter of thePromotionResult.customattribute.- Overrides:
getCustomin classGeneratedPromotionResult- Returns:
- the custom - Custom data stored on this promotion result by the promotion.
-
setCustom
Description copied from class:GeneratedPromotionResultGenerated method - Setter of thePromotionResult.customattribute.- Overrides:
setCustomin classGeneratedPromotionResultcustom- the custom - Custom data stored on this promotion result by the promotion.
-
getOrder
Description copied from class:GeneratedPromotionResultGenerated method - Getter of thePromotionResult.orderattribute.- Overrides:
getOrderin classGeneratedPromotionResult- Returns:
- the order
-
setOrder
Description copied from class:GeneratedPromotionResultGenerated method - Setter of thePromotionResult.orderattribute.- Overrides:
setOrderin classGeneratedPromotionResultorder- the order
-
getPromotion
Description copied from class:GeneratedPromotionResultGenerated method - Getter of thePromotionResult.promotionattribute.- Overrides:
getPromotionin classGeneratedPromotionResult- Returns:
- the promotion - The promotion
-
setPromotion
Description copied from class:GeneratedPromotionResultGenerated method - Setter of thePromotionResult.promotionattribute.- Overrides:
setPromotionin classGeneratedPromotionResultpromotion- the promotion - The promotion
-
addAction
Description copied from class:PromotionResultAdds an action to the promotion results.- Overrides:
addActionin classPromotionResult- Parameters:
ctx- The hybris contextaction- The action to add
-
getActions
Description copied from class:PromotionResultGets the collection ofAbstractPromotionActioninstances.- Overrides:
getActionsin classPromotionResult- Parameters:
ctx- The hybris session context- Returns:
- A collection of
AbstractPromotionActioninstances attached to this result.
-
setActions
Description copied from class:PromotionResultSets the collection ofAbstractPromotionActioninstance. TheAbstractPromotionActioninstances associated with this promotion result are owned (and part of) this result. They cannot belong to another instance, therefore when setting the collection anyAbstractPromotionActioninstances previously associated with this result, that are no longer associated are deleted from the database.- Overrides:
setActionsin classPromotionResult- Parameters:
ctx- The hybris session contextactions- the collection of actions
-
getAllPromotionActions
Description copied from class:GeneratedPromotionResultGenerated method - Getter of thePromotionResult.allPromotionActionsattribute.- Overrides:
getAllPromotionActionsin classGeneratedPromotionResult- Returns:
- the allPromotionActions
-
setAllPromotionActions
Description copied from class:GeneratedPromotionResultGenerated method - Setter of thePromotionResult.allPromotionActionsattribute.- Overrides:
setAllPromotionActionsin classGeneratedPromotionResultactions- the allPromotionActions
-
addToAllPromotionActions
Description copied from class:GeneratedPromotionResultGenerated method - Addsvalueto allPromotionActions.- Overrides:
addToAllPromotionActionsin classGeneratedPromotionResultaction- the item to add to allPromotionActions
-
removeFromAllPromotionActions
Description copied from class:GeneratedPromotionResultGenerated method - Removesvaluefrom allPromotionActions.- Overrides:
removeFromAllPromotionActionsin classGeneratedPromotionResultaction- the item to remove from allPromotionActions
-
getCachedActions
Description copied from class:GeneratedCachedPromotionResultGenerated method - Getter of theCachedPromotionResult.cachedActionsattribute.- Specified by:
getCachedActionsin classGeneratedCachedPromotionResult- Returns:
- the cachedActions - Cached list of actions
-
setCachedActions
public void setCachedActions(SessionContext ctx, Collection<AbstractPromotionAction> abstractPromotionActions) Description copied from class:GeneratedCachedPromotionResultGenerated method - Setter of theCachedPromotionResult.cachedActionsattribute.- Specified by:
setCachedActionsin classGeneratedCachedPromotionResultabstractPromotionActions- the cachedActions - Cached list of actions
-
addToCachedActions
-
removeFromCachedActions
-
getCachedConsumedEntries
public Collection<CachedPromotionOrderEntryConsumed> getCachedConsumedEntries(SessionContext sessionContext) Description copied from class:GeneratedCachedPromotionResultGenerated method - Getter of theCachedPromotionResult.cachedConsumedEntriesattribute.- Specified by:
getCachedConsumedEntriesin classGeneratedCachedPromotionResult- Returns:
- the cachedConsumedEntries - Cached list of consumed entries
-
setCachedConsumedEntries
public void setCachedConsumedEntries(SessionContext ctx, Collection<CachedPromotionOrderEntryConsumed> cachedConsumedEntries) Description copied from class:GeneratedCachedPromotionResultGenerated method - Setter of theCachedPromotionResult.cachedConsumedEntriesattribute.- Specified by:
setCachedConsumedEntriesin classGeneratedCachedPromotionResultcachedConsumedEntries- the cachedConsumedEntries - Cached list of consumed entries
-
addToCachedConsumedEntries
-
removeFromCachedConsumedEntries
public void removeFromCachedConsumedEntries(SessionContext ctx, CachedPromotionOrderEntryConsumed poec) -
addConsumedEntry
Description copied from class:PromotionResultAdds a consumed entry to the current result.- Overrides:
addConsumedEntryin classPromotionResult- Parameters:
ctx- the hybris contextpoec- the entry to add
-
removeConsumedEntry
Description copied from class:PromotionResultRemoves a consumed entry from the current result.- Overrides:
removeConsumedEntryin classPromotionResult- Parameters:
ctx- the hybris contextpoec- the entry to remove
-
getConsumedEntries
Description copied from class:PromotionResultGets the collection ofPromotionOrderEntryConsumedconsumed.- Overrides:
getConsumedEntriesin classPromotionResult- Parameters:
ctx- The hybris session context- Returns:
- A collection of
PromotionOrderEntryConsumedconsumed by this result.
-
setConsumedEntries
Description copied from class:PromotionResultSets the collection ofPromotionOrderEntryConsumedconsumed. ThePromotionOrderEntryConsumedinstances associated with this promotion result are owned (and part of) this result. They cannot belong to another instance, therefore when setting the collection anyPromotionOrderEntryConsumedinstances previously associated with this result, that are no longer associated are deleted from the database.- Overrides:
setConsumedEntriesin classPromotionResult- Parameters:
ctx- The hybris session contextentries- the collection of consumed entries
-
provideComposedType
Provides composed as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideComposedTypein interfaceJaloOnlyItem- Returns:
- ComposedType of this item
-
provideCreationTime
Provides creation time as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideCreationTimein interfaceJaloOnlyItem- Returns:
- creation time date of this item
-
provideModificationTime
Provides modification time as part ofJaloOnlyItemcontract. Never call directly- Specified by:
provideModificationTimein interfaceJaloOnlyItem- Returns:
- modification time date of this item
-
providePK
Provides PK part ofJaloOnlyItemcontract. Never call directly- Specified by:
providePKin interfaceJaloOnlyItem- Returns:
- PK of this item
-
removeJaloOnly
Custom removal logic as part ofJaloOnlyItemcontract. Never call directly- Specified by:
removeJaloOnlyin interfaceJaloOnlyItem- Throws:
ConsistencyCheckException- to signal that this item removal failed
-
doGetAttribute
Custom attribute access as part ofJaloOnlyItemcontract. Never call directly- Specified by:
doGetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextattrQualifier- the qualifier of the requested attribute- Returns:
- the attribute value
- Throws:
JaloSecurityException
-
doSetAttribute
public void doSetAttribute(SessionContext ctx, String attrQualifier, Object value) throws JaloBusinessException Custom attribute access as part ofJaloOnlyItemcontract. Never call directly- Specified by:
doSetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextattrQualifier- the qualifier of the requested attributevalue- the new attribute value- Throws:
JaloSecurityException- in case the session user is not allowed to write this attributeJaloBusinessException- in case any other error occured
-