com.ibm.commerce.returns.commands
Class AutoApproveReturnItemCmdImpl
java.lang.Object
|
+--com.ibm.commerce.command.AbstractECCommand
|
+--com.ibm.commerce.command.TaskCommandImpl
|
+--com.ibm.commerce.returns.commands.AutoApproveReturnItemCmdImpl
- All Implemented Interfaces:
- AutoApproveReturnItemCmd, ECCommand, TaskCommand
- public class AutoApproveReturnItemCmdImpl
- extends TaskCommandImpl
- implements AutoApproveReturnItemCmd
Overall 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.
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 is 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()
Performs server side parameter checking. |
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 |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 |
AutoApproveReturnItemCmdImpl
public AutoApproveReturnItemCmdImpl()
- AutoApproveReturnItemCmdImpl constructor.
autoApproveRMAItem
protected void autoApproveRMAItem()
throws javax.ejb.FinderException,
java.rmi.RemoteException,
javax.naming.NamingException,
javax.ejb.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.
convertDenyReasons
protected java.util.Vector convertDenyReasons(java.util.List RMAItemDenyReasonList)
throws javax.ejb.FinderException,
java.rmi.RemoteException,
javax.naming.NamingException,
javax.ejb.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
loadDenyReasons
protected void loadDenyReasons()
throws javax.ejb.FinderException,
java.rmi.RemoteException,
javax.naming.NamingException,
javax.ejb.CreateException,
ECException
- Gets list of deny reasons, code and id, applicable to current store.
performExecute
public void performExecute()
throws ECException
- Execute the command.
- 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.
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 AbstractECCommand
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
- Parameters:
RMAitemAB
- the RMA item access bean.
validateParameters
public void validateParameters()
throws ECException
- Description copied from interface:
ECCommand
- Performs server side parameter checking. This method replaces the checkParameters() method in a previous
version of the code.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
ECException.
-