com.ibm.commerce.payment.commands
Class PayResetPMCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.payment.commands.PayResetPMCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, PayResetPMCmd, Protectable

public class PayResetPMCmdImpl
extends ControllerCommandImpl
implements PayResetPMCmd

This PayResetPMCmd Controller Command implementation resets the payment for an order that has been submitted to the Payment Manager for processing. Only order that has failed the submission could have its payment reset via this command. If successful, this command also returns the WebSphere Commerce Order to the "Pending" state so that the Order could be re-submitted for processing.


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.payment.commands.PayResetPMCmd
COPYRIGHT, defaultCommandClassName, ERR_CODE_BAD_SYS, ERR_CODE_CANCEL_ORDER_NOT_ALLOWED, ERRTASK_NAME, NAME
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
PayResetPMCmdImpl()
           
 
Method Summary
protected  OrderAccessBean getOrderAccessBean()
          This method will first check if the local variable is set or not.
protected  java.lang.Long getOrderId()
          Gets the orderId property of the command.
 AccessVector getResources()
          Gets the access vector accessed by this command.
 java.lang.Integer getStoreId()
          Gets the store ID associated with the Order.
protected  java.lang.String getUrl()
          Gets the URL property of the command.
 boolean isReadyToCallExecute()
          This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command.
 void performExecute()
          Performs the main business logic of the command.
 void reset()
          Resets the instance variables of the command.
 void setOrderId(java.lang.Long orderId)
          Sets the orderId property of the command.
protected  void setStoreId(java.lang.Integer storeId)
          Saves the store ID that the Order is part of for easy access.
 void setUrl(java.lang.String astrUrl)
          Sets the URL property of the command.
 void validateParameters()
          Checks the validity of supplied 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, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getUser, getUserId, 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.security.Protectable
fulfills, getOwner
 

Constructor Detail

PayResetPMCmdImpl

public PayResetPMCmdImpl()
Method Detail

getOrderAccessBean

protected OrderAccessBean getOrderAccessBean()
This method will first check if the local variable is set or not. If not set it will attempt to get it by create a new AccessBean.

getOrderId

protected java.lang.Long getOrderId()
Gets the orderId property of the command. The orderId is the order reference number of the Order for which the payment information is to be reset.

getResources

public AccessVector getResources()
                          throws ECException
Description copied from interface: ECCommand
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.

Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Returns:
AccessVector - a vector of resource action pairs

getStoreId

public java.lang.Integer getStoreId()
Gets the store ID associated with the Order.
Specified by:
getStoreId in interface ECCommand
Overrides:
getStoreId in class AbstractECTargetableCommand
Returns:
java.lang.Integer

getUrl

protected java.lang.String getUrl()
Gets the URL property of the command. This is the URL to redirect to after the command completes its processing.

isReadyToCallExecute

public boolean isReadyToCallExecute()
This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Following copied from class: com.ibm.commerce.command.AbstractECTargetableCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
Performs the main business logic of 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()
Resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters, then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

This is useful if the command instance is to be called multiple times with different command parameters.

Overrides:
reset in class AbstractECTargetableCommand

setOrderId

public void setOrderId(java.lang.Long orderId)
Sets the orderId property of the command.
Specified by:
setOrderId in interface PayResetPMCmd
Parameters:
orderId - the order reference number of the Order for which the payment information is to be reset.

setStoreId

protected void setStoreId(java.lang.Integer storeId)
Saves the store ID that the Order is part of for easy access.
Parameters:
storeId - java.lang.Integer

setUrl

public void setUrl(java.lang.String astrUrl)
Sets the URL property of the command.
Specified by:
setUrl in interface PayResetPMCmd
Parameters:
url - the URL to redirect to after the command completes its processing.

validateParameters

public void validateParameters()
                        throws ECException
Checks the validity of supplied parameters.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException. -