com.ibm.commerce.returns.commands
Class AutoApproveReturnItemCmdImpl

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

public class AutoApproveReturnItemCmdImpl
extends TaskCommandImpl
implements AutoApproveReturnItemCmd

Overall Task command used for determining if a return mechandise authorization (RMA) item may be approved programatically. Calls AutoApproveReturnItemStandardChecksCmd and AutoApproveReturnItemPolicyCmd for approval logic. Gets a list of all auto-approve deny reasons for the current store, calls AutoApproveReturnItemStandardChecksCmd passing in list of possible deny reasons, calls AutoApproveReturnItemPolicyCmd passing in list of possible deny reasons, and based on list of actual deny reasons passed back, calculates new approval status and logs deny reasons against the RMA item.

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. AutoApproveReturnItemCmd
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
AutoApproveReturnItemCmdImpl()
          AutoApproveReturnItemCmdImpl constructor.
 
Method Summary
protected  void autoApproveRMAItem()
          Calculate whether RMA item can be approved programatically.
protected  java.util.Vector convertDenyReasons(java.util.List RMAItemDenyReasonList)
          Convert List of Deny Reason codes to DenyReason_ids.
protected  void loadDenyReasons()
          Gets list of deny reasons, code and id, applicable to current store.
 void performExecute()
          Execute the command.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
 void setRMAAB( RMAAccessBean rmaAB)
          Set the RMA being accessed.
 void setRMAItemAB( RMAItemAccessBean RMAItemAB)
          Set the RMA item being accessed.
 void validateParameters()
          Checks the following 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

AutoApproveReturnItemCmdImpl

public AutoApproveReturnItemCmdImpl()
AutoApproveReturnItemCmdImpl constructor.
Method Detail

autoApproveRMAItem

protected void autoApproveRMAItem()
                           throws FinderException,
                                  java.rmi.RemoteException,
                                  javax.naming.NamingException,
                                  CreateException,
ECException
Calculate whether RMA item can be approved programatically. Calls AutoApproveReturnItemStandardChecksCmd and AutoApproveReturnItemPolicyCmd, passing in a list of all possible deny reasons by code for a store. Converts returned list of deny reason applicable to the RMA item, from the generic codes to ids specific to store. Determines new RMA item status, and calls ApproveReturnItemCmd to set status and the deny reasons if any. If there is no auto-approval policy command applicable to the RMA, then a denial reason of ReturnConstants.DENY_REASON_NO_APPROVAL_POLICY will be applied to the RMA item.
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

convertDenyReasons

protected java.util.Vector convertDenyReasons(java.util.List RMAItemDenyReasonList)
                                       throws FinderException,
                                              java.rmi.RemoteException,
                                              javax.naming.NamingException,
                                              CreateException,
ECException
Convert List of Deny Reason codes to DenyReason_ids. Looks up appropriate deny reason id based on generic deny reason code used across stores.
Parameters:
RMAItemDenyReasonList - List of deny reason codes
Returns:
Deny reason Ids
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

loadDenyReasons

protected void loadDenyReasons()
                        throws FinderException,
                               java.rmi.RemoteException,
                               javax.naming.NamingException,
                               CreateException,
ECException
Gets list of deny reasons, code and id, applicable to current store.
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
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()
Description copied from class: AbstractECTargetableCommand
This method should be 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 AbstractECTargetableCommand

setRMAAB

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

setRMAItemAB

public void setRMAItemAB(RMAItemAccessBean RMAItemAB)
Set the RMA item being accessed.
Specified by:
setRMAItemAB in interface AutoApproveReturnItemCmd

validateParameters

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

Parameters

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If there is no RMAItemAB or if there is no RMAAB or if there is no TradingID in the RMAAB, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETER
ECException