com.ibm.commerce.returns.commands
Class ReturnCreditAndCloseScanCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.returns.commands.ReturnCreditAndCloseScanCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ReturnCreditAndCloseScanCmd

public class ReturnCreditAndCloseScanCmdImpl
extends ControllerCommandImpl
implements ReturnCreditAndCloseScanCmd

Initiate credits and close approved (status 'APP') return mechandise authorizations (RMA). This command would typically be run as a scheduled job.

Parameters

storeId (mandatory)
Identifier of the store under which this command runs.

Behaviour


Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands.ReturnCreditAndCloseScanCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
ReturnCreditAndCloseScanCmdImpl()
          ReturnCreditAndCloseScanCmdImpl constructor.
 
Method Summary
protected  boolean checkIfAllReceived(RMAAccessBean theRMA)
          Check to see if all items to be received have been received.
protected  boolean checkIfCredited(RMAAccessBean anRMAAB, java.util.List theRMAItems)
          Check to see if the RMA has already been credited.
protected  void closeRMA(RMAAccessBean anRMAAB)
          Close an RMA.
protected  void extendCommand()
          Extend the command.
 AccessVector getResources()
          Gets the vector of resources accessed by this command.
protected  java.sql.Timestamp getTimestampNow()
          This will set the NOW timestamp.
 void performExecute()
          Execute the command.
 void reset()
          Reset the command.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Constructor Detail

ReturnCreditAndCloseScanCmdImpl

public ReturnCreditAndCloseScanCmdImpl()
ReturnCreditAndCloseScanCmdImpl constructor.
Method Detail

checkIfAllReceived

protected boolean checkIfAllReceived(RMAAccessBean theRMA)
                              throws ECSystemException
Check to see if all items to be received have been received. All RTNRECEIPT records for the components of each RMA item are checked to ensure that each component is fully received.
Parameters:
theRMA - The RMA access bean to be checked.
Returns:
true if all items have been received for this RMA; false otherwise.

checkIfCredited

protected boolean checkIfCredited(RMAAccessBean anRMAAB,
                                  java.util.List theRMAItems)
                           throws ECException
Check to see if the RMA has already been credited. This also creates a list of the items in the RMA.
Parameters:
theRMAAB - The RMA access bean.
theRMAItems - The list to be filled in with the RMA item access beans.
Returns:
true if any item has already been credited; false otherwise.

closeRMA

protected void closeRMA(RMAAccessBean anRMAAB)
                 throws ECException
Close an RMA. Call the task command CloseReturnCmd.
Parameters:
anRMAAB - The RMA to close.

extendCommand

protected void extendCommand()
                      throws ECException
Extend the command. This is the last method called by performExecute(). This implementation calls the task command ExtendReturnCreditAndCloseScanCmd.

getResources

public AccessVector getResources()
                          throws ECException
Gets the vector of resources accessed by this command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
A vector of resource action pairs. Returns the store access bean.

getTimestampNow

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

performExecute

public void performExecute()
                    throws ECException
Execute the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

reset

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

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -