com.ibm.commerce.order.commands
Class OrderTransferCheckCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.order.commands.OrderTransferCheckCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderTransferCheckCmd

public class OrderTransferCheckCmdImpl
extends ControllerCommandImpl
implements OrderTransferCheckCmd

Check to see if confirmation has been received for the specified order transferred to an external system, and re-direct to one of three specified URLs depending on the result of the check.

See Also:
Serialized Form

Field Summary
 
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.order.commands. OrderTransferCheckCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Constructor Summary
OrderTransferCheckCmdImpl()
           
 
Method Summary
protected  void addOutOrderIdName( TypedProperty responseProperties, java.lang.String[] sOkOrderIds, java.lang.String[] sWaitOrderIds, java.lang.String[] sTimeoutOrderIds)
          This add the 3 types of out OrderId list to the response properties
 java.lang.String getErrorUrl()
          Gets the error url
protected  java.lang.String getOkUrl()
          Gets the okURL property of the command.
protected  OrderAccessBean[] getOrderAccessBeans()
          This method will first check if the local variable is set or not.
protected  java.lang.Long[] getOrderIds()
          Gets the orderIds property of the command.
protected  java.lang.String[] getOutOkOrderIdNames()
          this return the outOkOrderIdNames property of the command.
protected  java.lang.String[] getOutTimeoutOrderIdNames()
          this return the outTimeoutOrderIdNames property of the command.
protected  java.lang.String[] getOutWaitOrderIdNames()
          this return the outWaitOrderIdNames property of the command.
  AccessVector getResources()
          Gets the access vector accessed by this command.
protected  java.lang.String getTimeoutUrl()
          Gets the timeoutURL property of the command.
protected  java.lang.String getTransferMode()
          Gets the transferMode property of the command.
protected  java.lang.String getWaitUrl()
          Gets the waitURL property of the command.
 void performExecute()
          Performs the main business logic of the command.
 void reset()
          Resets the instance variables of the command.
 void setErrorUrl(java.lang.String astrErrorUrl)
          Sets the error url
 void setOkUrl(java.lang.String url)
          Sets the okURL property of the command.
 void setOrderIds(java.lang.Long[] orderIds)
          Sets the orderIds property of the command.
 void setOutOkOrderIdNames(java.lang.String[] outOkOrderIdNames)
          Sets the outOkOrderIdNames property of the command.
 void setOutTimeoutOrderIdNames(java.lang.String[] outTimeoutOrderIdNames)
          Sets the outTimeoutOrderIdNames property of the command.
 void setOutWaitOrderIdNames(java.lang.String[] outWaitOrderIdNames)
          Sets the outWaitOrderIdNames property of the command.
 void setRequestProperties( TypedProperty reqParms)
          The WebController calls the setRequestProperties method before invoking the execute method in this command.
 void setTimeoutUrl(java.lang.String url)
          Sets the timeoutURL property of the command.
 void setTransferMode(java.lang.String transferMode)
          Sets the transferMode property of the command.
 void setWaitUrl(java.lang.String url)
          Sets the waitURL property of the command.
 void validateParameters()
          Checks the validity of supplied parameters.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, 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
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Constructor Detail

OrderTransferCheckCmdImpl

public OrderTransferCheckCmdImpl()
Method Detail

setOrderIds

public void setOrderIds(java.lang.Long[] orderIds)
Sets the orderIds property of the command.
Specified by:
setOrderIds in interface OrderTransferCheckCmd
Parameters:
orderIds - the order reference number of the Order for which the confirmation will be checked.

getOrderIds

protected java.lang.Long[] getOrderIds()
Gets the orderIds property of the command.
Returns:
Long[]

setTransferMode

public void setTransferMode(java.lang.String transferMode)
Sets the transferMode property of the command.
Specified by:
setTransferMode in interface OrderTransferCheckCmd
Parameters:
transferMode - - 0 - order has been transferred without the payment information (shopping cart transfer). 1 - order has been transferred with the payment information (purchase order transfer).

getTransferMode

protected java.lang.String getTransferMode()
Gets the transferMode property of the command.
Returns:
String

setOkUrl

public void setOkUrl(java.lang.String url)
Sets the okURL property of the command.
Specified by:
setOkUrl in interface OrderTransferCheckCmd
Parameters:
url - - The redirection URL that is returned if transfer confirmation for specified oder have been received.

getOkUrl

protected java.lang.String getOkUrl()
Gets the okURL property of the command.
Returns:
String

setTimeoutUrl

public void setTimeoutUrl(java.lang.String url)
Sets the timeoutURL property of the command.
Specified by:
setTimeoutUrl in interface OrderTransferCheckCmd
Parameters:
url - - The redirection URL that is returned if transfer confirmation has not yet been received, and a timeoutInterval+orderLastUpdateTime is bigger or equal to the current time.

getTimeoutUrl

protected java.lang.String getTimeoutUrl()
Gets the timeoutURL property of the command.
Returns:
String

setWaitUrl

public void setWaitUrl(java.lang.String url)
Sets the waitURL property of the command.
Specified by:
setWaitUrl in interface OrderTransferCheckCmd
Parameters:
url - - The redirection URL that is returned if transfer confirmation has not yet been received, and a timeoutInterval+orderLastUpdateTime is less than the current time.

getWaitUrl

protected java.lang.String getWaitUrl()
Gets the waitURL property of the command.
Returns:
String

setOutOkOrderIdNames

public void setOutOkOrderIdNames(java.lang.String[] outOkOrderIdNames)
Sets the outOkOrderIdNames property of the command.
Specified by:
setOutOkOrderIdNames in interface OrderTransferCheckCmd
Parameters:
outOkOrderIdNames - The names of name value pairs that should be added to the redirection URL. The values of the added name value pairs are the identifiers of the checked orders that have transfer confirmations.

getOutOkOrderIdNames

protected java.lang.String[] getOutOkOrderIdNames()
this return the outOkOrderIdNames property of the command.
Returns:
String[]

setOutWaitOrderIdNames

public void setOutWaitOrderIdNames(java.lang.String[] outWaitOrderIdNames)
Sets the outWaitOrderIdNames property of the command.
Specified by:
setOutWaitOrderIdNames in interface OrderTransferCheckCmd
Parameters:
outWaitOrderIdNames - The names of name value pairs that should be added to the redirection URL. The values of the added name value pairs are the identifiers of the checked orders that do not yet have transfer confirmations, but whose timeoutInterval+orderLastUpdateTime values are not less than the current time.

getOutWaitOrderIdNames

protected java.lang.String[] getOutWaitOrderIdNames()
this return the outWaitOrderIdNames property of the command.
Returns:
String[]

setOutTimeoutOrderIdNames

public void setOutTimeoutOrderIdNames(java.lang.String[] outTimeoutOrderIdNames)
Sets the outTimeoutOrderIdNames property of the command.
Specified by:
setOutTimeoutOrderIdNames in interface OrderTransferCheckCmd
Parameters:
outTimeoutOrderIdNames - The names of name value pairs that should be added to the redirection URL. The values of the added name value pairs are the identifiers of the checked orders that do not yet have transfer confirmations, but whose timeoutInterval+orderLastUpdateTime values are less than the current time.

getOutTimeoutOrderIdNames

protected java.lang.String[] getOutTimeoutOrderIdNames()
this return the outTimeoutOrderIdNames property of the command.
Returns:
String[]

getOrderAccessBeans

protected OrderAccessBean[] getOrderAccessBeans()
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 array of AccessBean.
Returns:
OrderAccessBean

getResources

public AccessVector getResources()
                          throws ECException
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
Returns:
AccessVector - a vector of resource action pairs
Throws:
ECException

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECApplicationException
The WebController calls the setRequestProperties method before invoking the execute method in this command.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
reqParms - request properties
Throws:
ECApplicationException

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
Throws:
ECException

addOutOrderIdName

protected void addOutOrderIdName(TypedProperty responseProperties,
                                 java.lang.String[] sOkOrderIds,
                                 java.lang.String[] sWaitOrderIds,
                                 java.lang.String[] sTimeoutOrderIds)
This add the 3 types of out OrderId list to the response properties
Parameters:
responseProperties - The responding TypedProperty
sOkOrderIds - String Array of ok OrderId
sWaitOrderIds - String Array of wait OrderId
sTimeoutOrderIds - String Array of timeout OrderId

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

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.
ECException

getErrorUrl

public java.lang.String getErrorUrl()
Gets the error url
Returns:
Returns a String

setErrorUrl

public void setErrorUrl(java.lang.String astrErrorUrl)
Sets the error url
Specified by:
setErrorUrl in interface OrderTransferCheckCmd
Parameters:
astrErrorUrl - The error url to set