com.ibm.commerce.order.calculation
Interface ApplyCalculationUsageCmd

All Superinterfaces:
BusinessPolicyCommand, CalculationCmd, TaskCommand
All Known Subinterfaces:
ApplyCalculationUsageTIKCmd, ApplyCouponUsageCmd, ApplyShippingCmd
All Known Implementing Classes:
ApplyCalculationUsageCmdImpl, ApplyCalculationUsageTIKCmdImpl, ApplyCouponUsageCmdImpl, ApplyShippingChargeByCarrierCmdImpl, ApplyShippingCmdImpl

public interface ApplyCalculationUsageCmd
extends CalculationCmd

Given a calculation usage and a list of items, this command will "apply" the calculation usage to the items.

For sales/shipping tax only, the caller has to specify the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store.

For more information, refer to the default implementation of this command, ApplyCalculationUsageCmdImpl.

This is also the base interface that commands registered as calculation methods of type "ApplyCalculationUsage" must extend. These commands include:

This command is registered as the following bootstrap calculation methods:

Calculation Method ID Calculation Usage ID Name
-202 -1 ApplyCalculationUsage (discount)
-222 -3 ApplyCalculationUsage (sales tax)
-232 -4 ApplyCalculationUsage (shipping tax)

This is also the business policy command interface of business policy type "ShippingCharge". Its implementations include:

For more information, refer to ApplyShippingCmd and its default implementation, ApplyShippingCmdImpl.

Field Summary
static java.lang.String COPYRIGHT
          The IBM copyright notice field.
static java.lang.String defaultCommandClassName
          The default implementation of this command.
static java.lang.String NAME
          The name of this command.
 
Method Summary
 void checkAppliedItems()
          Checks if a value has been calculated and applied to each and every item.
 java.util.Set getAppliedItems()
          Returns the items that have been applied to.
 void setItems( Item[] aItems)
          Sets the items.
 void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
          Sets the tax categories that should be active during execution.
 
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
 

Field Detail
public static final java.lang.String COPYRIGHT
The IBM copyright notice field.
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
The name of this command.
See Also:
Constant Field Values

defaultCommandClassName

public static final java.lang.String defaultCommandClassName
The default implementation of this command.
See Also:
Constant Field Values
Method Detail

checkAppliedItems

public void checkAppliedItems()
                       throws ECException
Checks if a value has been calculated and applied to each and every item. If not, an ECApplicationException with ECMessage _ERR_CALCODE will be thrown.
Throws:
ECException

getAppliedItems

public java.util.Set getAppliedItems()
Returns the items that have been applied to.
Returns:
the items (class: Item).

setItems

public void setItems(Item[] aItems)
Sets the items.
Parameters:
aItems - the items.

setTaxCategoryIds

public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
Sets the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store. For sales/shipping tax only.
Parameters:
anTaxCategoryIds - the tax category IDs.