com.ibm.commerce.messaging.commands
Class OrderItemStatusCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.messaging.commands.OrderItemStatusCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, OrderItemStatusCmd, TaskCommand

public class OrderItemStatusCmdImpl
extends TaskCommandImpl
implements OrderItemStatusCmd

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

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
protected  java.lang.String iMerchantItemNumber
          The merchant order item number
protected  java.lang.String iMerchantOrderNumber
          The merchant order number
protected  java.lang.Long iOrderId
          The order id identifying this order.
protected  java.lang.Long iOrderItemId
          The order item id identifying this order item.
static java.lang.String itemCmdName
          The command name that handles the status updates for the items belonging to an order.
protected  TypedProperty oiProp
          The order item property for this order item.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.messaging.commands. OrderItemStatusCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
OrderItemStatusCmdImpl()
           
 
Method Summary
 void createOrderItemStatus()
          Creates a new entry in the ORDISTAT 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 item is new or not.
 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( OrderFulfillmentItemStatusAccessBean ab, TypedProperty aProp)
          Fills the OrderFulfillmentItemStatusAccessBean object with the values that are found in the request properties.
 void setOrderItemStatusProperties( TypedProperty aRequestProperties)
          Binds the parameters received by the request properties to variables that are used for determining the order item to updated.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

itemCmdName

public static final java.lang.String itemCmdName
The command name that handles the status updates for the items belonging to an order.
See Also:
Constant Field Values

oiProp

protected TypedProperty oiProp
The order item property for this order item.

iOrderId

protected java.lang.Long iOrderId
The order id identifying this order.

iMerchantOrderNumber

protected java.lang.String iMerchantOrderNumber
The merchant order number

iOrderItemId

protected java.lang.Long iOrderItemId
The order item id identifying this order item.

iMerchantItemNumber

protected java.lang.String iMerchantItemNumber
The merchant order item number
Constructor Detail

OrderItemStatusCmdImpl

public OrderItemStatusCmdImpl()
Method Detail

createOrderItemStatus

public void createOrderItemStatus()
                           throws ECException
Creates a new entry in the ORDISTAT 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 - Raised with messages _ERR_CREATE_EXCEPTION, _ERR_FINDER_EXCEPTION, _ERR_NAMING_EXCEPTION, _ERR_REMOTE_EXCEPTION when the ejb catches an exception.

doPostProcess

public boolean doPostProcess(TypedProperty aRequestProperty)
                      throws ECException
Performs a verification check after the command executes.
Specified by:
doPostProcess in interface OrderItemStatusCmd
Parameters:
aRequestProperty - Parameters used to aid the checking
Returns:
true if command executed successfully false if otherwise
Throws:
ECException

doPreProcess

public boolean doPreProcess(TypedProperty aRequestProperty)
                     throws ECException
Performs a verification check before the command executes.
Specified by:
doPreProcess in interface OrderItemStatusCmd
Parameters:
aRequestProperty - Parameters used to aid the checking
Returns:
true if command can be executed flase if otherwise
Throws:
ECException

doProcess

public boolean doProcess(TypedProperty aRequestProperty)
                  throws ECException
Determine whether this order item is new or not. If so, will add a new entry to the ORDISTAT table providing a WCS Order Item ID does exist. Else, an existing entry in the ORDISTAT table will 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 ORDISTAT table with the information found in the request properties. No versioning only consists of updating the entry in the ORDISTAT table. 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 OrderItemStatusCmd
Parameters:
aRequestProperty - Input parameters
Returns:
true if command execute successfully, false with otherwise
Throws:
ECException - Raised when the update fails
See Also:
updateORderItemStatusVersion() and createOrderItemStatus()

isReadyToCallExecute

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

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 - Raised by doPreProcess, doProcess, or doPostProcess

propertySet

public void propertySet(OrderFulfillmentItemStatusAccessBean ab,
TypedProperty aProp)
                 throws ECException
Fills the OrderFulfillmentItemStatusAccessBean 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 OrderFulfillmentItemStatusAccessBean, an ECException is thrown.
Parameters:
ab - The order fulfillment item status access bean to take the new data
aProp - Property containing data to be moved to the access bean
Throws:
ECException - Raised with messages _ERR_OS_INVALID_NUMERIC, _ERR_OS_INVALID_TIMESTAMP, _ERR_CREATE_EXCEPTION, _ERR_FINDER_EXCEPTION, _ERR_REMOTE_EXCEPTION, _ERR_GENERIC if the monetary amounts are not valid numerical values, timestamp is not valid, or when the ejb throws an exception.

setOrderItemStatusProperties

public void setOrderItemStatusProperties(TypedProperty aRequestProperties)
                                  throws ECException
Binds the parameters received by the request properties to variables that are used for determining the order item 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:
setOrderItemStatusProperties in interface OrderItemStatusCmd
Throws:
ECException - Raised with messages _ERR_LOOKUP_ORDERITEM_WITH_REFNUM, _ERR_INVALID_ORDER_REFNUM if the ordier item id, or order id is not valid.