com.ibm.commerce.returns.commands
Class CreditReturnItemCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.returns.commands.CreditReturnItemCmdImpl
All Implemented Interfaces:
CreditReturnItemCmd, ECCommand, ECTargetableCommand, TaskCommand

public class CreditReturnItemCmdImpl
extends TaskCommandImpl
implements CreditReturnItemCmd

Default implementation of the CreditReturnItemCmdImpl interface. Activate the refund for a return mechandise authorization (RMA) and its items if there is one and it is approved.

Behaviour

Utilizes these access beans

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands. CreditReturnItemCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CreditReturnItemCmdImpl()
          CreditReturnItemCmdImpl constructor.
 
Method Summary
protected   RMAAccessBean getRMAAB()
          Get the RMA access bean.
protected  java.util.Vector getRMAItemABs()
          Get the list of RMA item access beans.
protected  java.sql.Timestamp getTimestampNow()
          This will get the NOW timestamp.
protected  java.math.BigDecimal getTotalRefund()
          Get the total refund for the RMA.
protected  boolean isRefund( RMAAccessBean anRMAAB)
          Is there a refund? There is a refund if the total credit in the RMA is > 0.
protected  boolean isRefundApproved( RMAAccessBean anRMAAB, java.util.List theRMAItemABs)
          Is the refund approved? This calls the ApproveRefundPolicyCmd policy implementation.
 void performExecute()
          Execute the command.
 void reset()
          Reset the command.
 void setRMAAB( RMAAccessBean anRMAAB)
          Set the RMA being accessed.
 void setRMAItemABs(java.util.Vector anRMAItemABList)
          Set the RMA items being credited.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreditReturnItemCmdImpl

public CreditReturnItemCmdImpl()
CreditReturnItemCmdImpl constructor.
Method Detail

getRMAAB

protected RMAAccessBean getRMAAB()
Get the RMA access bean.
Returns:
The RMA access bean.

getRMAItemABs

protected java.util.Vector getRMAItemABs()
Get the list of RMA item access beans.
Returns:
The list of RMA item access beans.

getTimestampNow

protected java.sql.Timestamp getTimestampNow()
This will get the NOW timestamp. It only gets set on the first call.
Returns:
The NOW timestamp.

getTotalRefund

protected java.math.BigDecimal getTotalRefund()
                                       throws ECSystemException
Get the total refund for the RMA.
Returns:
The total refund amount.
ECSystemException

isRefund

protected boolean isRefund(RMAAccessBean anRMAAB)
                    throws ECSystemException
Is there a refund? There is a refund if the total credit in the RMA is > 0.
Parameters:
anRMAAB - RMA access bean
Returns:
true if there is a refund; false otherwise.
ECSystemException

isRefundApproved

protected boolean isRefundApproved(RMAAccessBean anRMAAB,
                                   java.util.List theRMAItemABs)
                            throws ECException
Is the refund approved? This calls the ApproveRefundPolicyCmd policy implementation.
Parameters:
anRMAAB - The RMA access bean.
theRMAItemABs - The list of RMA item access beans.
Returns:
true if the refund is approved; false otherwise.
ECException

performExecute

public void performExecute()
                    throws ECException
Execute the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
ECException

reset

public void reset()
Reset the command.
Overrides:
reset in class AbstractECTargetableCommand

setRMAAB

public void setRMAAB(RMAAccessBean anRMAAB)
Set the RMA being accessed.
Specified by:
setRMAAB in interface CreditReturnItemCmd
Parameters:
anRMAAB - The RMA access bean.

setRMAItemABs

public void setRMAItemABs(java.util.Vector anRMAItemABList)
Set the RMA items being credited.
Specified by:
setRMAItemABs in interface CreditReturnItemCmd
Parameters:
anRMAItemABList - The RMA item access bean vector.

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters. Checks the following parameters:

Parameters

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If there is no RMAABean or there is no vector of RMAItemAccessBean, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETER
ECException