com.ibm.commerce.negotiation.commands

Class AuctionTaskBaseCmdImpl

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AuctionTaskBaseCmdImpl

        public AuctionTaskBaseCmdImpl()
        AuctionTaskBaseCmdImpl default constructor.
    • Method Detail

      • compareUptoMinute

        public static int compareUptoMinute(java.sql.Timestamp time1,
                                            java.sql.Timestamp time2)
        Compare two timestamps up to the minute level.

        2001-10-20 13:24:34.384 is considered equal to 2001-10-20 13:24:00.0

        1. returns 0 when t1 == t2.
        2. returns 1 when t1 > t2.
        3. returns -1 when t1 < t2.
        4. returns -100 when t1 or t2 is null.
        Parameters:
        time1 -
        time2 -
        Returns:
        int
      • getAuctionReferenceNumber

        public java.lang.Long getAuctionReferenceNumber()
        Gets auction's ID (also known as identifier).
        Returns:
        the auction ID.
      • getAuctionType

        public java.lang.String getAuctionType()
        Returns the auction type.

        O for open cry, SB for sealed bid, and D for dutch.

        Returns:
        the type.
      • getBidRuleId

        public java.lang.Long getBidRuleId()
        Returns the bid rule ID.
        Returns:
        bid rule ID.
      • getCloseType

        public int getCloseType()
        Gets the auction's closing type.

        Auction closing rule has the following valid values:

        1. 1=auction closes at a fixed end time.
        2. 2=auction closes if a specified amount of time has elapsed since the last bid.
        3. 3=based on logical OR between 1 and 2.
        4. 4=based on logical AND between 1 and 2.
        Returns:
        int
      • getCurrency

        public java.lang.String getCurrency()
        Gets the currency type for the auction.
        Returns:
        the currency string.
      • getCurrentAskPrice

        public java.math.BigDecimal getCurrentAskPrice()
        Gets dutch auction's current asks price.
        Returns:
        the price.
      • getCurrentAvailableQuantity

        public java.lang.Double getCurrentAvailableQuantity()
        Gets the current available quantity for an auction.
        Returns:
        the quantity.
      • getDeposit

        public java.math.BigDecimal getDeposit()
        Gets deposit required by the auction.
        Returns:
        BigDecimal
      • getDurationDays

        public java.lang.Integer getDurationDays()
        Gets duration days related to auction closing rule.
        Returns:
        the Integer object.
      • getEndTime

        public java.sql.Timestamp getEndTime()
        Gets auction's end time.
        Returns:
        Timestamp
      • getErrorContent

        public java.util.Hashtable getErrorContent()
        Gets error hashtable.
        Returns:
        Hashtable of error codes.
      • getErrorFlag

        public boolean getErrorFlag()
        Gets error flag.
        Returns:
        the Error Flag
      • getFulfillmentCenterId

        public java.lang.Integer getFulfillmentCenterId()
        Gets fulfillment center ID.
        Returns:
        the identifier.
      • getLanguageId

        public java.lang.Integer getLanguageId()
        Gets language ID.
        Returns:
        java.lang.Integer
      • getLongDescription

        public java.lang.String getLongDescription(java.lang.Integer langid)
        Gets long description for the auction.
        Parameters:
        langid - is the language ID. It is an integer.
        Returns:
        java.lang.String
      • getOwnerId

        public java.lang.Long getOwnerId()
        Gets auction's owner ID.
        Returns:
        java.lang.Long
      • getPricingRuleType

        public java.lang.String getPricingRuleType()
        Gets auction's pricing rule type.

        ND for nondiscriminative, D for discriminative.

        Returns:
        String
      • getProductDisplayPage

        public java.lang.String getProductDisplayPage()
        Gets product display page.
        Returns:
        java.lang.String
      • getProductId

        public java.lang.Long getProductId()
        Gets product (also known as catalog entry) ID.
        Returns:
        java.lang.String
      • getQuantity

        public java.lang.Double getQuantity()
        Gets auction quantity.
        Returns:
        java.lang.String
      • getReservationId

        public java.lang.Long getReservationId()
        Returns the reservation identifier.
        Returns:
        java.lang.Long
      • getReservePrice

        public java.math.BigDecimal getReservePrice()
        Returns reserve price.
        Returns:
        java.math.BigDecimal
      • getRuleDisplayPage

        public java.lang.String getRuleDisplayPage()
        Gets auction's rule display page.
        Returns:
        java.lang.String
      • getShortDescription

        public java.lang.String getShortDescription(java.lang.Integer langid)
        Gets auction's short description.
        Parameters:
        langid - is the language ID. It is an integer.
        Returns:
        java.lang.String
      • getStartPrice

        public java.math.BigDecimal getStartPrice()
        Gets dutch auction's openning price.
        Returns:
        the starting price for the dutch auction.
      • getStartTime

        public java.sql.Timestamp getStartTime()
        Gets auction's start time.
        Returns:
        java.sql.Timestamp
      • isErrorFlag

        public boolean isErrorFlag()
        Gets error flag.
        Returns:
        boolean
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Is ready to call Execute method.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        true if it is ready. False if it is not ready.
      • reset

        public void reset()
        reset the parameters..
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • saveDescriptions

        public void saveDescriptions()
                              throws java.lang.Exception
        Saves the short and long descriptions for the auction.
        Throws:
        if - anything goes wrong.
        java.lang.Exception
      • setAuctionType

        public void setAuctionType(java.lang.String s)
                            throws ECException
        Sets auction type for the command.
        1. O for open cry auction type.
        2. SB for sealed bid auction type.
        3. D for dutch auction type.
        Parameters:
        s - The auction type.
        Throws:
        ECException
      • setBidRuleId

        public void setBidRuleId(java.lang.Long br_id)
                          throws ECException
        Stores the identifier of the bid control rule used by the auction.
        Specified by:
        setBidRuleId in interface AuctionTaskBaseCmd
        Parameters:
        br_id - is the bid rule ID.
        Throws:
        throws - ECException if anything goes wrong.
        ECException
      • setCloseType

        public void setCloseType(int aType)
                          throws ECException
        Stores an integer representing the auction close type.

        Auction closing rule has the following valid values:

        1. 1=auction closes at a fixed end time.
        2. 2=auction closes if a specified amount of time has elapsed since the last bid.
        3. 3=based on logical OR between 1 and 2.
        4. 4=based on logical AND between 1 and 2.
        Specified by:
        setCloseType in interface AuctionTaskBaseCmd
        Parameters:
        aType -
        Throws:
        ECException
      • setCurrentAvailableQuantity

        public void setCurrentAvailableQuantity(java.lang.Double q)
        Sets current available quantity. This quantity is used by dutch auction type only.
        Parameters:
        q - The current available quantity.
      • setDeposit

        public void setDeposit(java.math.BigDecimal amount)
                        throws ECException
        Stores the value of the deposit that should accompany each bid for the auction.
        Specified by:
        setDeposit in interface AuctionTaskBaseCmd
        Parameters:
        amount -
        Throws:
        ECException
      • setDurationDays

        public void setDurationDays(java.lang.Integer days)
        Saves the number of days between successive bids for which the auction will be active.
        Specified by:
        setDurationDays in interface AuctionTaskBaseCmd
        Parameters:
        days - java.lang.Integer
      • setDurationTime

        public void setDurationTime(java.lang.Integer hours,
                                    java.lang.Integer minutes)
        Sets up the duration timestamp based on hours and minutes.
        Specified by:
        setDurationTime in interface AuctionTaskBaseCmd
        Parameters:
        hours -
        minutes -
      • setErrorContent

        public void setErrorContent(java.util.Hashtable newErrorContent)
        Sets error content hashtable.
        Parameters:
        newErrorContent -
      • setErrorFlag

        public void setErrorFlag(boolean newErrorFlag)
        Sets error flag.
        Parameters:
        newErrorFlag -
      • setFulfillmentCenterId

        public void setFulfillmentCenterId(java.lang.Integer newFulfillmentCenterId)
        Sets fullfillment center ID.
        Specified by:
        setFulfillmentCenterId in interface AuctionTaskBaseCmd
        Parameters:
        newFulfillmentCenterId -
      • setLanguageId

        public void setLanguageId(java.lang.Integer id)
        Sets language ID.
        Parameters:
        id -
      • setLongDescription

        public void setLongDescription(java.lang.Integer langid,
                                       java.lang.String ld)
                                throws ECException
        Stores the long description for the auction for the specified language.
        Specified by:
        setLongDescription in interface AuctionTaskBaseCmd
        Parameters:
        langid - Language ID.
        ld - Long description.
        Throws:
        ECException
      • setOwnerId

        public void setOwnerId(java.lang.Long id)
        Sets auction owner ID.
        Parameters:
        id - The owner's ID.
      • setProductId

        public void setProductId(java.lang.Long theId)
                          throws ECException
        Sets product (also known as catalog entry) ID.
        Parameters:
        theId - is used to set the product (also known as catalog entry) ID. It is of type java.lang.Long.
        Throws:
        ECException
      • setQuantity

        public void setQuantity(java.lang.Double q)
        Sets auction quantity.
        Specified by:
        setQuantity in interface AuctionTaskBaseCmd
        Parameters:
        q - is the quantity.
      • setReservationId

        public void setReservationId(java.lang.Long newReservationId)
        Stores the identifier for the reservation.
        Specified by:
        setReservationId in interface AuctionTaskBaseCmd
        Parameters:
        newReservationId -
      • setShortDescription

        public void setShortDescription(java.lang.Integer langid,
                                        java.lang.String s)
                                 throws ECException
        Stores the short description for the specified language.
        Specified by:
        setShortDescription in interface AuctionTaskBaseCmd
        Parameters:
        langid - The language ID.
        s - The short description.
        Throws:
        ECException
      • setStartPrice

        public void setStartPrice(java.math.BigDecimal newStartPrice)
        Stores the starting price for the dutch auction.
        Specified by:
        setStartPrice in interface AuctionTaskBaseCmd
        Parameters:
        newStartPrice -