com.ibm.commerce.order.commands

Class AdminOrderCancelCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, AdminOrderCancelCmd, Protectable, 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 AdminOrderCancelCmdImpl
    extends OrderBaseCmdImpl
    implements AdminOrderCancelCmd
    This is the default implementation of the AdminOrderCancelCmd controller command used to cancel order.

    Input parameters:

    Name Description
    orderId The order Id abbreviations. Optional
    URL The redirect URL. Optional
    notifyMerchant The property indicates whether to notify merchant for order cancel. If the value is 1, the command will notify merchant. Otherwise, the command will not notify merchant when the value equals 0. Optional
    notifyShopper The property indicates whether to notify shopper for order cancel. If the value is 1, the command will notify shopper. Otherwise, the command will not notify shopper when the value equals 0. Optional
    forcedCancel The property indicates whether to reverse payment when the deposit has already happened. If the value is true, the command will reverse all approved payment even if deposits have already happened. Optional

    Behavior:

    • It calls CancelOrderCmd to cancel payment.
    • If order status equals "I", it calls RemoveJobCmd to remove scheduled order.
    • It calls DoInventoryActionCmd to reverse inventory.
    • If order status equals "W", it calls BusinessFlowEvent to raise the business flow event.
    • It calls CancelPONumberCmd to cancel purchase order number.
    • If notifyMerchant equals 1, it notifies merchant for order cancel.
    • If notifyShopper equals 1, it notifies shopper for order cancel.
    • It calls RaiseOrderEventCmd to raise business event.
    This command calls the following TaskCommands: This command uses the following AccessBeans:
    See Also:
    Serialized Form
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The full name of this command.
    • Constructor Detail

      • AdminOrderCancelCmdImpl

        public AdminOrderCancelCmdImpl()
    • Method Detail

      • getOrderId

        public java.lang.Long getOrderId()
        This method returns the id of the order.
        Returns:
        order id.
      • getURL

        public java.lang.String getURL()
        This method returns the URL .
        Returns:
        URL.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is called by the Command Framework to check if URL and orderId parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        true is the command is ready to execute and false otherwise.
      • performOrderCancel

        public static void performOrderCancel(CommandContext cmdCtxt,
                                              OrderAccessBean abOrder,
                                              java.lang.Boolean forcedCancel,
                                              TypedProperty requestProperties)
                                       throws ECException,
                                              java.sql.SQLException
        This static method performs an order cancel. It includes CancelOrderCmd to reverse payment, RemoveJobCmd to remove scheduled order, DoInventoryActionCmd to reverse inventory, and BusinessFlowEvent to raise business flow event.
        Parameters:
        cmdCtxt - a command context.
        abOrder - an order access bean.
        forcedCancel - a flag of forced cancel(if the flag is true, the command will reverse all approved deposit even if the deposits have already happened)
        requestProperties - a request property.
        Throws:
        ECException
        java.sql.SQLException
      • setOrderId

        public void setOrderId(java.lang.Long orderId)
        This method sets the id of the order.
        Parameters:
        orderId - order id.
      • setRequestProperties

        public void setRequestProperties(TypedProperty reqProperties)
                                  throws ECException
        This method sets request properties, if the parameter is null or unexpected value, the method will give it default value. The WebController calls the setRequestProperties method before invoking the execute method in this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking.
        Specified by:
        setRequestProperties in interface ControllerCommand
        Overrides:
        setRequestProperties in class ControllerCommandImpl
        Parameters:
        reqProperties - a request property.
        Throws:
        ECApplicationException.
        ECException
      • setURL

        public void setURL(java.lang.String astrURL)
        This method sets the redirect URL property of the command.
        Parameters:
        astrURL - the URL to redirect to after the command completes its processing. The payment information is to be appended to this URL as additional name-value pairs in the query string.
      • throwIllegalStatus

        public static void throwIllegalStatus(java.lang.String methodName)
                                       throws ECApplicationException
        This method reports and propagates error for invalid status.
        Parameters:
        methodName - a method name.
        Throws:
        ECApplicationException
      • setForcedCancel

        public void setForcedCancel(java.lang.Boolean cancel)
        This method sets the forcedCancel
        Parameters:
        cancel - a flag for Event-Driven Payments cancel, false as the default.
      • getForcedCancel

        public java.lang.Boolean getForcedCancel()
        This method gets the forcedCancel
        Returns:
        a flag for Event-Driven Payments cancel, false as the default.