com.ibm.commerce.payment.commands

Class ValidatePONumberCmdImpl

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

    Behaviour:

    • Checks the buyerPONumber against predefined POs (Limited or Blanket PO) in the Trading Agreement (of the Account). If the buyerPONumber is one of the predefined PO but the PO is no longer active, then throws an ECApplicationException.
    • If the buyerPONumber is not a predefined PO and individualPO is not specified for the Trading Agreement, then the buyerPONumber is invalid. Throws an ECApplicationException.
    • If the buyerPONumber is not a predefined PO and individualPO is specified for the Trading Agreement (of the Account). Then make sure this "individual" PONumber has not been used for this Account if uniqueness is in the PurchaseOrderTC (POTCIndividual). Otherwise, throws an ECApplicationException.

    This command uses the following AccessBeans:

    Task commands called:

    None
    See Also:
    Serialized Form
    • Constructor Detail

      • ValidatePONumberCmdImpl

        public ValidatePONumberCmdImpl()
    • Method Detail

      • getBuyerPOId

        public java.lang.Long getBuyerPOId()
        This method returns the internal ID of the BuyerPO record if the specified buyer purchase order number is valid. Otherwise returns a null.
        Specified by:
        getBuyerPOId in interface ValidatePONumberCmd
        Returns:
        the internal ID of the BuyerPO record or null
      • reset

        public void reset()
        This method resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters. Then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

        This is useful if the command instance is to be called multiple times with different command parameters.

        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setAccount

        public void setAccount(AccountAccessBean abAccount)
        This method sets the Account property of the command.
        Specified by:
        setAccount in interface ValidatePONumberCmd
        Parameters:
        abAccount - The AccountAccessBean of the order is associated with.
      • setBuyerPONumber

        public void setBuyerPONumber(java.lang.String sBPONum)
        This method sets the buyerPONumber property of the command.
        Specified by:
        setBuyerPONumber in interface ValidatePONumberCmd
        Parameters:
        sBPONum - A String that specifies the actual buyer purchase order number specified by the customer for the purchase.
      • setCreateFlag

        public void setCreateFlag(boolean createFlag)
        This method sets the createFlag property of the command. By default, the flag is set to true. And the command will create new BuyerPurchaseOrder object for a new Individual PO after verifying that an Individual PO is allowed. Set the flag to false if you do not want the command to create any BuyerPurchaseOrder object as a by-product of the Validation.
        Specified by:
        setCreateFlag in interface ValidatePONumberCmd
        Parameters:
        createFlag - A boolean that indicates if the command will create a new BuyerPO record if needed.
      • setErrorViewName

        public void setErrorViewName(java.lang.String sEVN)
        This method sets the error view to be used to report error. This overrides the default error view of the command.
        Specified by:
        setErrorViewName in interface ValidatePONumberCmd
        Parameters:
        sEVN - A String that specifies the Error View name.
        See Also:
        ValidatePONumberCmd.ERRTASK_NAME
      • setOrder

        public void setOrder(OrderAccessBean ab)
        This method sets the order property of the command.
        Specified by:
        setOrder in interface ValidatePONumberCmd
        Parameters:
        ab - The OrderAccessBean of the Order.