com.ibm.commerce.messaging.commands
Class OrderStatusCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.messaging.commands.OrderStatusCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderStatusCmd
Direct Known Subclasses:
OrderConfirmCmdImpl, OrderInvoiceCmdImpl, OrderShippingCmdImpl, OrderStatusServiceCmdImpl

public class OrderStatusCmdImpl
extends ControllerCommandImpl
implements OrderStatusCmd

The implementation of the OrderStatus command (see interface for a detailed description of the OrderStatus command)

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
static java.lang.String UPDATEMODE_COMPLETE
          The complete update mode
static java.lang.String UPDATEMODE_PARTIAL
          The partial update mode
 
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.messaging.commands. OrderStatusCmd
defaultCommandClassName, NAME
 
Constructor Summary
OrderStatusCmdImpl()
           
 
Method Summary
 boolean checkOrderStatusSequence( OrderFulfillmentStatusAccessBean orderStatusAB)
          Verifies that the sequence information of the order status to update does not conflict with the sequence information with the order status that is currently in the ORDSTAT table.
 void createOrderStatus()
          Creates a new entry in the ORDSTAT table based the the given information that is received through the request properties.
 boolean doPostProcess( TypedProperty aRequestProperty)
          Performs a verification check after the command executes.
 boolean doPreProcess( TypedProperty aRequestProperty)
          Performs a verification check before the command executes.
 boolean doProcess( TypedProperty aRequestProperty)
          Determine whether this order is new or not.
  AccessVector getIAccessVector()
          Returns the iAccessVector.
 java.lang.String getIMerchantOrderNumber()
          Returns the iMerchantOrderNumber.
 java.lang.Long getIOrderId()
          Returns the iOrderId.
protected   OrderFulfillmentStatusAccessBean getOrderStatus()
          Gets the order status
 java.util.Vector getOsItems()
          Returns the osItems.
  TypedProperty getOsProp()
          Returns the osProp.
  AccessVector getResources()
          Gets the access vector accessed by this command.
 boolean isReadyToCallExecute()
          Indicates whether the command is ready to execute.
 void performExecute()
          Performs a pre condition check on the request properties and if the pre condition check is ok, the business logic will be performed followed by a post condition check to ensure integrity is maintained.
 void propertySet( OrderFulfillmentStatusAccessBean ab, TypedProperty aProp)
          Fills the OrderFulfillmentStatusAccessBean object with the values that are found in the request properties.
 void reset()
          This resets the output properties to the values they had prior to calling the execute method, so that the get methods no longer work but the isReadyToCallExecute returns true.
protected  void setOrder( OrderAccessBean o)
          Sets the order
protected  void setOrderStatus( OrderFulfillmentStatusAccessBean os)
          Sets the order status
 void setRequestProperties( TypedProperty aRequestProperties)
          Binds the parameters received by the request properties to variables that are used for determining the order to updated.
 void updateOrder( OrderAccessBean abOrder)
          Updates the ORDSTAT table with the information given by the request properties.
 void validateParameters()
          This is where parameter checking is done.
 
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, 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
 

Field Detail
public static final java.lang.String COPYRIGHT
The internal copyright field.
See Also:
Constant Field Values

UPDATEMODE_PARTIAL

public static final java.lang.String UPDATEMODE_PARTIAL
The partial update mode
See Also:
Constant Field Values

UPDATEMODE_COMPLETE

public static final java.lang.String UPDATEMODE_COMPLETE
The complete update mode
See Also:
Constant Field Values
Constructor Detail

OrderStatusCmdImpl

public OrderStatusCmdImpl()
Method Detail

checkOrderStatusSequence

public boolean checkOrderStatusSequence(OrderFulfillmentStatusAccessBean orderStatusAB)
                                 throws ECException
Verifies that the sequence information of the order status to update does not conflict with the sequence information with the order status that is currently in the ORDSTAT table.
Parameters:
orderStatusAB - The OrderFulfillmentStatusAccessBean
Returns:
true If the new sequence is correct false if the new sequence is incorrect
Throws:
ECException
java.rmi.RemoteException - Raised whenever a communication related problems occured
FinderEception - Raised whenever a request object is not found
javax.naming.NamingException - Raised whenever a failure to look up the JNDI name occured
CreateException - Raised whenever a failure to create the EJB occured

createOrderStatus

public void createOrderStatus()
                       throws ECException
Creates a new entry in the ORDSTAT table based the the given information that is received through the request properties. ECException will be thrown if there is any problems with the update.
Throws:
ECException
java.rmi.RemoteException - Raised whenever a communication related problems occured
FinderEception - Raised whenever a request object is not found
javax.naming.NamingException - Raised whenever a failure to look up the JNDI name occured
CreateException - Raised whenever a failure to create the EJB occured

doPostProcess

public boolean doPostProcess(TypedProperty aRequestProperty)
                      throws ECException
Performs a verification check after the command executes.
Specified by:
doPostProcess in interface OrderStatusCmd
Parameters:
aRequestProperty - com.ibm.commerce.datatype.TypedProperty
Returns:
boolean
Throws:
ECException

doPreProcess

public boolean doPreProcess(TypedProperty aRequestProperty)
                     throws ECException
Performs a verification check before the command executes.
Specified by:
doPreProcess in interface OrderStatusCmd
Parameters:
aRequestProperty - com.ibm.commerce.datatype.TypedProperty
Returns:
boolean
Throws:
ECException

doProcess

public boolean doProcess(TypedProperty aRequestProperty)
                  throws ECException
Determine whether this order is new or not. If so, will add a new entry to the ORDSTAT table providing a WCS Order does exist. Else, an existing entry in the ORDSTAT table will be updated providing the sequence found in the request properties does not conflict with the sequence information found in the ORDSTAT table for the entry to be updated. Updating will depend on where versioning equals "TRUE". Versioning will update and version the entry and a new entry will be created in the ORDSTAT table with the information found in the request properties. No versioning only consists of updating the entry. After the order status is created or updated, the order items in the status message will be updated. The method will return false or throw an ECException if there is a problem with the given information or the update. If there are no problems, the method will return true.
Specified by:
doProcess in interface OrderStatusCmd
Parameters:
aRequestProperty - The request property
Returns:
boolean
Throws:
ECException

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector 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.
ECException

isReadyToCallExecute

public boolean isReadyToCallExecute()
Indicates whether the command is ready to execute.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true is the command is ready to be executed false if the command is not ready to be executed

performExecute

public void performExecute()
                    throws ECException
Performs a pre condition check on the request properties and if the pre condition check is ok, the business logic will be performed followed by a post condition check to ensure integrity is maintained. If either of the 3 steps fail, an ECException will be thrown.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

propertySet

public void propertySet(OrderFulfillmentStatusAccessBean ab,
TypedProperty aProp)
                 throws ECException
Fills the OrderFulfillmentStatusAccessBean object with the values that are found in the request properties. If values found in the request properties conflict with the allowed values for the OrderFulfillmentStatusAccessBean, an ECException is thrown.
Parameters:
ab - The OrderFulfillmentStatusAccessBean
aProp - The TypedProperty
Throws:
ECException
java.rmi.RemoteException - Raised whenever a communication related problems occured
FinderEception - Raised whenever a request object is not found
javax.naming.NamingException - Raised whenever a failure to look up the JNDI name occured
CreateException - Raised whenever a failure to create the EJB occured
java.lang.NumberFormatException - Raised whenever an invalid parameter value is passed

reset

public void reset()
This resets the output properties to the values they had prior to calling the execute method, so that the get methods no longer work but the isReadyToCallExecute returns true. It provides a convenient and efficient way to reuse the same command instance with changes in some input properties or in the CommandTarget.
Overrides:
reset in class AbstractECTargetableCommand

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECException
Binds the parameters received by the request properties to variables that are used for determining the order to updated. Also, a validation check is performed on some of the given parameters and if this check fails, an ECException is thrown.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
aRequestProperties - request properties
Throws:
ECException - Raised with _ERR_INVALID_ORDER_REFNUM whenever the order id is not contained in the request property

updateOrder

public void updateOrder(OrderAccessBean abOrder)
                 throws ECException
Updates the ORDSTAT table with the information given by the request properties.
Parameters:
abOrder - com.ibm.commerce.order.objects.OrderAccessBean
Throws:
ECException
java.rmi.RemoteException - Raised whenever a communication related problems occured
FinderEception - Raised whenever a request object is not found
javax.naming.NamingException - Raised whenever a failure to look up the JNDI name occured
CreateException - Raised whenever a failure to create the EJB occured

getOrderStatus

protected OrderFulfillmentStatusAccessBean getOrderStatus()
Gets the order status
Returns:
The order status

setOrderStatus

protected void setOrderStatus(OrderFulfillmentStatusAccessBean os)
Sets the order status

setOrder

protected void setOrder(OrderAccessBean o)
Sets the order

validateParameters

public void validateParameters()
                        throws ECException
This is where parameter checking is done. This method replaces checkParameters() in 5.1. The default implementation of validateParameters() is a no op. It is the responsibility of the command writers to implements this method if they want to perform server side parameter checking.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException.
ECException

getIAccessVector

public AccessVector getIAccessVector()
Returns the iAccessVector.
Returns:
AccessVector

getIMerchantOrderNumber

public java.lang.String getIMerchantOrderNumber()
Returns the iMerchantOrderNumber.
Returns:
String

getIOrderId

public java.lang.Long getIOrderId()
Returns the iOrderId.
Returns:
Long

getOsItems

public java.util.Vector getOsItems()
Returns the osItems.
Returns:
Vector

getOsProp

public TypedProperty getOsProp()
Returns the osProp.
Returns:
TypedProperty