com.ibm.commerce.edp.commands

Class EditCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, AEDPPaymentTaskCmd, AEDPTaskCmd, EditCmd, 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 EditCmdImpl
    extends AEDPPaymentTaskCmdImpl
    implements EditCmd
    This is the default implementation of the EditCmd task command.

    Behaviour:

    • This task command should be called when payment instructions are modified. This applies to amount changes or payment protocol data changes.
    • This class is used with Advanced Order Payments.
    • This task command is a wrapper on top of the event-driven payments edit API.

    Input parameters:

    commandContext The command context.
    orderId The order id.
    orderAmount The order amount.
    pis The payment instructions.

    Output parameters:

    None.

    Task commands called:

    See Also:
    Serialized Form
    • Constructor Detail

      • EditCmdImpl

        public EditCmdImpl()
    • Method Detail

      • getAccount

        public AccountAccessBean getAccount()
        This method returns the AccountAccessBean representing the business account if an account ID is present. null otherwise. This method will first check if the local variable iabAccount is set. If not set, it will attempt to retrieve the AccountAccessBean using the specified business account ID.
        Returns:
        An AccountAccessBean if it can be retrieved; null otherwise.
      • setAccountId

        public void setAccountId(java.lang.Long n)
        This method sets the business account ID. This is the common account ID if one is specified by the trading agreements used by the order items of the order being processed. If there is no common account ID, this method should not be called at all.
        Parameters:
        n - A Long that specifies the Account ID.
      • getAccountId

        public java.lang.Long getAccountId()
        This method returns the business account ID if one is specified by the trading agreements used by the order items of the order being processed. If there is no business account associated with any of the trading agreements, null is returned.
        Returns:
        A Long that specifies the account ID if present; null otherwise.
      • setEditResults

        public final void setEditResults(EDPEditResults localEditResults)
        This method sets the edit results.
        Specified by:
        setEditResults in interface EditCmd
        Parameters:
        localEditResults - An EDPEditResults that represents edit results to be set.
      • setBuyerPOId

        public void setBuyerPOId(java.lang.Long n)
        Do nothing
        Parameters:
        n - A Long that specifies the buyerPO ID.
      • getBuyerPOId

        public java.lang.Long getBuyerPOId()
        Do nothing
        Returns:
        A Long that specifies the internal ID of the BuyerPO record or null.
      • setForcedPaymentInstructionChangeFlag

        public void setForcedPaymentInstructionChangeFlag(boolean forcedChange)
        This method sets the forced flag indicating if the payment instruction edit operation will be forced or not. It is up to the caller to set the forceFlag whether they want to do the a forced operation or not.
        Specified by:
        setForcedPaymentInstructionChangeFlag in interface EditCmd
        Parameters:
        forcedChange - A boolean that indicates if the payment instruction edit operation is forced or not.
      • getOrderAccessBean

        public OrderAccessBean getOrderAccessBean()
        This method returns the order access bean associated with this command. It checks if the local variable is set. If not, it will attempt to get it by creating a new access bean.
        Returns:
        The OrderAccessBean that corresponds to the order associated with this request.
      • setOrderAmount

        public void setOrderAmount(java.math.BigDecimal paramOrderAmount)
        This method sets the total order amount.
        Specified by:
        setOrderAmount in interface EditCmd
        Parameters:
        paramOrderAmount - A BigDecimal that specifies the total order amount.
      • getOrderAmount

        public java.math.BigDecimal getOrderAmount()
        This method returns the total order amount.
        Returns:
        A BigDecimal that specifies the total order amount; null may be returned.
      • setPONumber

        public void setPONumber(java.lang.String sPONumber)
        This method sets the purchase order number. Do nothing
        Specified by:
        setPONumber in interface EditCmd
        Parameters:
        sPONumber - A String that specifies the purchase order number specified by the buyer.
      • getPONumber

        public java.lang.String getPONumber()
        This method returns null
        Returns:
        null
      • setPaymentInstructions

        public void setPaymentInstructions(java.util.ArrayList paramPIs)
        This method sets the payment instructions affected by this payment instruction edit operation.
        Specified by:
        setPaymentInstructions in interface EditCmd
        Parameters:
        paramPIs - An ArrayList that represents the payment instructions (EDPPaymentInstruction).
      • getPaymentInstructions

        public java.util.ArrayList getPaymentInstructions()
        This method returns the list of payment instructions affected by this payment instruction edit operation.
        Returns:
        An ArrayList that represents the list of payment instructions (EDPPaymentInstruction) affected by this payment instruction edit operation.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is called by the Command Framework to check if all basic mandatory 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:
        A boolean that indicates if this command is ready to execute . It's true if the command is ready to execute and false otherwise.
      • reset

        public void reset()
        This command resets the command fields. After this method is invoked, and proper attributes are set, the command can be executed again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AEDPPaymentTaskCmdImpl
      • processFG

        public void processFG()
                       throws EDPException,
                              ECException

        This method is the main method to process the current payment instruction edit operation.

        It not only edits the payment instructions in payment rules, but also edits the payment instructions in payment processing. Also, it edits the EDP order.

        Throws:
        EDPException
        ECException
      • systemEditableAddOrderAmount

        public void systemEditableAddOrderAmount(java.lang.Long edpOrderId,
                                                 java.math.BigDecimal addToPIAmount)
                                          throws EDPException,
                                                 ECException

        This method increases a payment instruction amount as a systemEditable operation.

        This is a public method to be invoked for ReservePayment. This seems a hack but it is working so far. This has a good potential for refactoring in the future...

        A wrapper for editAddOrderAmount. Invokes editAddOrderAmount if the systemEditable flag is true, throws an exception otherwise.

        Specified by:
        systemEditableAddOrderAmount in interface EditCmd
        Parameters:
        edpOrderId - A Long that specifies the Order Data Access Bean on which action is to be taken
        addToPIAmount - A BigDecimal that specifies the new amount associated with the PI.
        Throws:
        EDPException
        ECException
      • toString

        public java.lang.String toString()
        This method converts this payment instruction edit operation data into a human-readable string.
        Overrides:
        toString in class AEDPPaymentTaskCmdImpl
        Returns:
        The human-readable String representing the data of this request.