com.ibm.commerce.order.calculation
Class CalculationCodeCombineCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.command.BusinessPolicyCommandImpl
                    |
                    +--com.ibm.commerce.order.calculation.CalculationCmdImpl
                          |
                          +--com.ibm.commerce.order.calculation.CalculationCodeCombineCmdImpl
All Implemented Interfaces:
BusinessPolicyCommand, CalculationCmd, CalculationCodeCombineCmd, ECCommand, TaskCommand
Direct Known Subclasses:
TaxCalculationCodeCombineCmdImpl

public class CalculationCodeCombineCmdImpl
extends CalculationCmdImpl
implements CalculationCodeCombineCmd

This is the default implementation of the CalculationCodeCombine command.

See Also:
CalculationCodeCombineCmd

Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl
policyId, requestProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.order.calculation.CalculationCodeCombineCmd
defaultCommandClassName, NAME
 
Constructor Summary
CalculationCodeCombineCmdImpl()
           
 
Method Summary
protected  void addItem(GroupKey aKey, Item aItem)
          This method is called by processItem() to add the item to the group indicated by the group key.
protected  Item[] callCodeQualify(CalculationCodeAccessBean aabCode, Item[] aItems)
          This method is called by createGroups() to invoke the CalculationCodeQualify command.
protected  GroupKey createGroupKey(CalculationCodeAccessBean aabCode, Item aItem)
          This method is called by processItem() to generate the group key.
protected  Group[] createGroups()
          This method is called by performExecute() to generate the groups.
protected  CalculationCodeAccessBean[] getCodes(Item aItem)
          This method is called by processItems() to identify the calculation codes associated with the item.
protected  CalculationCodeAccessBean getDefaultCode()
          This method is called by getCodes() to identify the default calculation code.
protected  CalculationCodeAccessBean[] getDirectlyAttachedCodes(Item aItem)
          This method is called by getCodes() to identify the calculation codes directly attached to the order item.
 Group[] getGroups()
          Returns the groups.
protected  CalculationCodeAccessBean[] getIndirectlyAttachedCodes(Item aItem)
          This method is called by getCodes() to identify the calculation codes indirectly attached to the item through its catalog entry.
protected  Item[] getItems()
          Returns the items.
protected  java.lang.Integer[] getTaxCategoryIds()
          Returns the tax categories.
protected  boolean isDirectAttachmentsOverride(Item aItem)
          This method is called by getCodes() to identify whether the directly attached calculation codes should override the indirectly attached calculation codes and the default calculation code.
protected  boolean isRestricted(CalculationCodeAccessBean aabCode)
          This method is called by createGroups() to identify whether the calculation code is restricted.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
protected  void processItem(Item aItem)
          This method is called by performExecute() to process an item.
 void reset()
          This method is called after a command has been executed to reset its states variables.
protected  void setGroups(Group[] aGroups)
          Sets the groups.
 void setItems(Item[] aItems)
          Sets the items.
 void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
          Sets the tax categories.
protected  java.lang.String toString(CalculationCodeAccessBean[] aabCodes)
           
 
Methods inherited from class com.ibm.commerce.order.calculation.CalculationCmdImpl
createCommand, 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.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, 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.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

CalculationCodeCombineCmdImpl

public CalculationCodeCombineCmdImpl()
Method Detail

addItem

protected void addItem(GroupKey aKey,
                       Item aItem)
This method is called by processItem() to add the item to the group indicated by the group key.

callCodeQualify

protected Item[] callCodeQualify(CalculationCodeAccessBean aabCode,
                                 Item[] aItems)
                          throws ECException
This method is called by createGroups() to invoke the CalculationCodeQualify command.

createGroupKey

protected GroupKey createGroupKey(CalculationCodeAccessBean aabCode,
                                  Item aItem)
                           throws ECException
This method is called by processItem() to generate the group key.

createGroups

protected Group[] createGroups()
                        throws ECException
This method is called by performExecute() to generate the groups.

getCodes

protected CalculationCodeAccessBean[] getCodes(Item aItem)
                                        throws ECException
This method is called by processItems() to identify the calculation codes associated with the item.

getDefaultCode

protected CalculationCodeAccessBean getDefaultCode()
                                            throws ECException
This method is called by getCodes() to identify the default calculation code.

getDirectlyAttachedCodes

protected CalculationCodeAccessBean[] getDirectlyAttachedCodes(Item aItem)
                                                        throws ECException
This method is called by getCodes() to identify the calculation codes directly attached to the order item.

getGroups

public Group[] getGroups()
Description copied from interface: CalculationCodeCombineCmd
Returns the groups.
Specified by:
getGroups in interface CalculationCodeCombineCmd

getIndirectlyAttachedCodes

protected CalculationCodeAccessBean[] getIndirectlyAttachedCodes(Item aItem)
                                                          throws ECException
This method is called by getCodes() to identify the calculation codes indirectly attached to the item through its catalog entry.

getItems

protected Item[] getItems()
Returns the items.

getTaxCategoryIds

protected java.lang.Integer[] getTaxCategoryIds()
Returns the tax categories.

isDirectAttachmentsOverride

protected boolean isDirectAttachmentsOverride(Item aItem)
                                       throws ECException
This method is called by getCodes() to identify whether the directly attached calculation codes should override the indirectly attached calculation codes and the default calculation code.

isRestricted

protected boolean isRestricted(CalculationCodeAccessBean aabCode)
                        throws ECException
This method is called by createGroups() to identify whether the calculation code is restricted.

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

processItem

protected void processItem(Item aItem)
                    throws ECException
This method is called by performExecute() to process an item.

reset

public void reset()
Description copied from class: AbstractECCommand
This method is called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class CalculationCmdImpl

setGroups

protected void setGroups(Group[] aGroups)
Sets the groups.

setItems

public void setItems(Item[] aItems)
Description copied from interface: CalculationCodeCombineCmd
Sets the items.
Specified by:
setItems in interface CalculationCodeCombineCmd

setTaxCategoryIds

public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
Description copied from interface: CalculationCodeCombineCmd
Sets the tax categories.
Specified by:
setTaxCategoryIds in interface CalculationCodeCombineCmd

toString

protected java.lang.String toString(CalculationCodeAccessBean[] aabCodes)
                             throws ECException