com.ibm.commerce.messaging.commands

Class OrderItemStatusCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, OrderItemStatusCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    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 Detail

      • COPYRIGHT

        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
    • Constructor Detail

      • OrderItemStatusCmdImpl

        public OrderItemStatusCmdImpl()
    • Method Detail

      • createOrderItemStatus

        public void createOrderItemStatus()
                                   throws ECException
        This method creates a new entry in the ORDISTAT table based on the given information received through the request properties. An ECException will be thrown if there are any problems with the update.
        Throws:
        ECException - Raised with messages _ERR_CREATE_EXCEPTION, _ERR_FINDER_EXCEPTION, _ERR_NAMING_EXCEPTION, _ERR_REMOTE_EXCEPTION when an exception is caught.
      • doPostProcess

        public boolean doPostProcess(TypedProperty aRequestProperty)
                              throws ECException
        This method performs a verification check after the command executes. It currently always returns true.
        Specified by:
        doPostProcess in interface OrderItemStatusCmd
        Parameters:
        aRequestProperty - Parameters used to aid the checking
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doPreProcess

        public boolean doPreProcess(TypedProperty aRequestProperty)
                             throws ECException
        This method performs a verification check before the command executes. It currently always returns true.
        Specified by:
        doPreProcess in interface OrderItemStatusCmd
        Parameters:
        aRequestProperty - Parameters used to aid the checking
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doProcess

        public boolean doProcess(TypedProperty aRequestProperty)
                          throws ECException
        This method determines whether this order item is new or not. If so, will add a new entry to the ORDISTAT table providing a WebSphere Commerce Server 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 updates the existing version and a new entry is 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.
        Specified by:
        doProcess in interface OrderItemStatusCmd
        Parameters:
        aRequestProperty - Input parameters
        Returns:
        True if command execute successfully, otherwise false.
        Throws:
        ECException - Raised when the update fails
        See Also:
        updateORderItemStatusVersion() and createOrderItemStatus()
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method indicates whether the command is ready to execute.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        • False if the parent isReadyToCallExecute fails.
        • False if order ID and merchant order number are both null.
        • False if order item ID and merchant item number are both null.
        • Otherwise true.
      • performExecute

        public void performExecute()
                            throws ECException
        This method performs a precondition check on the request properties. If the precondition check succeeds, the business logic (doProcess) will be performed followed by a postcondition check to ensure integrity is maintained. If either of the three steps fail, an ECException will be thrown.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - Raised by doPreProcess, doProcess, or doPostProcess
      • propertySet

        public void propertySet(OrderFulfillmentItemStatusAccessBean ab,
                                TypedProperty aProp)
                         throws ECException
        This method 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
        This method binds the parameters received by the request properties to variables that are used for determining the order item to update. 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
        Parameters:
        aRequestProperty - name-value pair containg the input parameters key orderId is mapped to variable iOrderId key merchantOrderNumber is mapped to iMerchantOrderNumber key orderItemId is mapped to variable iOrderItemId key merchantItemNumber is mapped to variable iMerchantitemNumber
        Throws:
        ECException - Raised with messages _ERR_LOOKUP_ORDERITEM_WITH_REFNUM, _ERR_INVALID_ORDER_REFNUM if the order item ID, or order ID is not valid.