com.ibm.commerce.order.calculation
Class DiscountCalculationCodeApplyCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.TaskCommandImpl
-
- com.ibm.commerce.command.BusinessPolicyCommandImpl
-
- com.ibm.commerce.order.calculation.CalculationCmdImpl
-
- com.ibm.commerce.order.calculation.DiscountCalculationCodeApplyCmdImpl
-
- All Implemented Interfaces:
- BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CalculationCmd, CalculationCodeApplyCmd, DiscountCalculationCodeApplyCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class DiscountCalculationCodeApplyCmdImpl extends CalculationCmdImpl implements DiscountCalculationCodeApplyCmd
The default implementation of
DiscountCalculationCodeApplyCmd
.Its behaviour is as follows:
- It adjusts the values if one or more of the values cross the zero boundary (see the method
CalculationHelper.correctZeroBoundaryCrossings(Item[], BigDecimal[], String, CommandContext, List)
. - creates an order adjustment for the order (see ORDADJUST).
- copies the calculation code descriptions and exempted tax categories to the order adjustment (see CALCODEDSC, CALCODTXEX, ORDADJDSC, ORDADJTXEX).
- for each value, creates an order item adjustment for the corresponding item (see ORDIADJUST).
Commands used:
- none
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
The IBM copyright notice field.-
Fields inherited from interface com.ibm.commerce.order.calculation.DiscountCalculationCodeApplyCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description DiscountCalculationCodeApplyCmdImpl()
Constructor for DiscountCalculationCodeApplyCmdImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
performExecute()
This method performs the business logic for this command.void
reset()
This method is called after a command has been executed.void
setCode(CalculationCodeAccessBean aabCode)
Sets the calculation code.void
setItems(Item[] aItems)
Sets the items.void
setValues(java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.void
setValues(java.lang.Integer anTaxCategoryId, java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.-
Methods inherited from class com.ibm.commerce.order.calculation.CalculationCmdImpl
getCurrency, getCustomProperties, getCustomProperty, getTimestamp, getUsageId, setCurrency, setCustomProperties, setCustomProperty, setTimestamp, setUsageId
-
Methods inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.order.calculation.CalculationCmd
getCurrency, getCustomProperties, getCustomProperty, getTimestamp, getUsageId, setCurrency, setCustomProperties, setCustomProperty, setTimestamp, setUsageId
-
Methods inherited from interface com.ibm.commerce.command.BusinessPolicyCommand
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
The IBM copyright notice field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DiscountCalculationCodeApplyCmdImpl
public DiscountCalculationCodeApplyCmdImpl()
Constructor for DiscountCalculationCodeApplyCmdImpl.
-
-
Method Detail
-
performExecute
public void performExecute() throws ECException
Description copied from class:AbstractECTargetableCommand
This method performs the business logic for this command. This method should be overwritten by all command writers. Command writers should call super.performExecute() as the first line in their method.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
- See Also:
ECCommand.performExecute()
-
reset
public void reset()
Description copied from class:AbstractECTargetableCommand
This method is called after a command has been executed. It is used to reset its states variables. After the call to reset, the command should be able to be executed again.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classCalculationCmdImpl
- See Also:
Command.reset()
-
setCode
public void setCode(CalculationCodeAccessBean aabCode)
Sets the calculation code.- Specified by:
setCode
in interfaceCalculationCodeApplyCmd
- Parameters:
aabCode
- the calculation code.
-
setItems
public void setItems(Item[] aItems)
Sets the items.- Specified by:
setItems
in interfaceCalculationCodeApplyCmd
- Parameters:
aItems
- the items.
-
setValues
public void setValues(java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.- Specified by:
setValues
in interfaceCalculationCodeApplyCmd
- Parameters:
adValues
- the order item adjustment amounts.
-
setValues
public void setValues(java.lang.Integer anTaxCategoryId, java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.- Specified by:
setValues
in interfaceCalculationCodeApplyCmd
- Parameters:
anTaxCategoryId
- the tax category ID. Always null.adValues
- the order item adjustment amounts.
-
-