com.ibm.commerce.couponredemption.commands

Class UseCouponIdTaskCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, UseCouponIdTaskCmd, 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

    Deprecated. 
    The WC54 coupon feature will be replaced by the WC56 promotion engine coupon feature.

    public class UseCouponIdTaskCmdImpl
    extends TaskCommandImpl
    implements UseCouponIdTaskCmd
    This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out. First, this command check whether the specified coupons belong to the shopper. If yes, then the CheckValidityCmd command is called to find the eCoupons that are not expired. For the not expired eCoupons, CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable coupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and CouponDSSTaskCmd command is called to check for any conflict.
    See Also:
    Serialized Form
    • Constructor Detail

      • UseCouponIdTaskCmdImpl

        public UseCouponIdTaskCmdImpl()
        Deprecated. 
        UseCouponIdCmdImpl constructor calls super.
    • Method Detail

      • checkCouponIdShopperState

        public boolean checkCouponIdShopperState()
                                          throws ECSystemException
        Deprecated. 
        Returns true if the CouponId are for this shopper and in Usable state. If the user is virtual coupon user, then and entry is created in the CouponEmailMapAccessBean for cpwalletId and shopperEmailId fields.
        Returns:
        true if the coupon belongs to this user and is in usable state.
        Throws:
        ECSystemException
      • getCalculationUsage

        public java.lang.Integer getCalculationUsage()
        Deprecated. 
        Returns the calculation usage code.
        Returns:
        the calculation usage code.
      • getConflicts

        public java.util.Hashtable getConflicts()
        Deprecated. 
        Returns the conflicts information.
        Specified by:
        getConflicts in interface UseCouponIdTaskCmd
        Returns:
        Hashtable containing conflict information.
      • getCouponIds

        public java.lang.Long[] getCouponIds()
        Deprecated. 
        Returns the couponIds.
        Returns:
        the array of coupon ids.
      • getCurrency

        public java.lang.String getCurrency()
        Deprecated. 
        Gets the currency.
        Returns:
        the currency used.
      • getErrorCode

        public java.lang.Integer getErrorCode()
        Deprecated. 
        Returns the error code.
        Specified by:
        getErrorCode in interface UseCouponIdTaskCmd
        Returns:
        the error code indicating what was the reason for the coupons to not be applicable.
      • getInvalidCoupons

        public java.util.Vector getInvalidCoupons()
        Deprecated. 
        Returns the invalid coupons.
        Specified by:
        getInvalidCoupons in interface UseCouponIdTaskCmd
        Returns:
        vector containing informatoin about which coupons are invalid.
      • getNumCoupons

        public int getNumCoupons()
        Deprecated. 
        Returns the number of coupons.
        Specified by:
        getNumCoupons in interface UseCouponIdTaskCmd
        Returns:
        the number of coupons.
      • getOrderId

        public java.lang.Long getOrderId()
        Deprecated. 
        Gets the order ID.
        Returns:
        the order ID.
      • getProcessingContext

        public CommandContext getProcessingContext()
        Deprecated. 
        Returns the processing context.
        Returns:
        the command context.
      • getRequestProperties

        public TypedProperty getRequestProperties()
        Deprecated. 
        Returns the request properties.
        Returns:
        the request properties.
      • getShopperId

        public java.lang.Long getShopperId()
        Deprecated. 
        Gets the shopperId.
        Returns:
        the shopperId.
      • insertIntoDB

        public void insertIntoDB(java.lang.Long orderId,
                                 java.util.Hashtable couponHashtable)
                          throws ECSystemException
        Deprecated. 
        Inserts the coupon related information in the database. First create the TempOrderCouponMapAccessBean for each coupon used for this order. Then, create the TempCouponItemMapAccessBean for each item for coupon, with the discount amount information.
        Parameters:
        orderId - The order for which the coupons are being applied.
        couponHashTable - It has information about the items the coupons apply to and the discount amounts for each.
        Throws:
        com.ibm.commerce.exception.ECException.
        ECSystemException
      • isValidSelection

        public boolean isValidSelection()
        Deprecated. 
        Returns true if the selection was valid.
        Specified by:
        isValidSelection in interface UseCouponIdTaskCmd
        Returns:
        boolean
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 
        First, this this command check whether the specified coupons belong to the shopper. If yes, then the CheckValidityCmd command is called to find the eCoupons that are not expired. For the not expired eCoupons, CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable coupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and CouponDSSTaskCmd command is called to check for any conflict.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • removeExistingAdjustments

        public void removeExistingAdjustments(java.lang.Long anOrderId)
                                       throws ECSystemException
        Deprecated. 
        Removes the existing adjustments for this order.
        Parameters:
        anOrderId - the order ID for which the adjustments are removed.
        Throws:
        ECSystemException
      • removeOldEntries

        public void removeOldEntries()
                              throws ECSystemException
        Deprecated. 
        It removes the old entries from the TORCPMAP and TCPITMAP tables.
        Throws:
        com.ibm.commerce.exception.ECException.
        ECSystemException
      • setCalculationUsage

        public void setCalculationUsage(java.lang.Integer newCalculationUsage)
        Deprecated. 
        Sets the calculation usage.
        Parameters:
        newCalculationUsage - the calculation code.
      • setConflicts

        public void setConflicts(java.util.Hashtable newConflicts)
        Deprecated. 
        Sets the conflicts information.
        Parameters:
        newConflicts - hashtable containing the conflict information.
      • setCouponIds

        public void setCouponIds(java.lang.Long[] newCouponIds)
        Deprecated. 
        Sets the couponIds.
        Specified by:
        setCouponIds in interface UseCouponIdTaskCmd
        Parameters:
        newCouponIds - the coupon IDs.
      • setCurrency

        public void setCurrency(java.lang.String newCurrency)
        Deprecated. 
        Sets the currency.
        Parameters:
        newCurrency - the currency to be used.
      • setErrorCode

        public void setErrorCode(java.lang.Integer newErrorCode)
        Deprecated. 
        Sets the errorcode.
        Parameters:
        newErrorCode - the error code indicating the reason for the coupons to be not applicable.
      • setInvalidCoupons

        public void setInvalidCoupons(java.util.Vector newInvalidCoupons)
        Deprecated. 
        Sets the invalidCoupons.
        Parameters:
        newInvalidCoupons - vector containing information about which coupons are invalid.
      • setNumCoupons

        public void setNumCoupons(int newNumCoupons)
        Deprecated. 
        Sets the number of coupons.
        Parameters:
        newNumCoupons - number of coupons.
      • setOrderId

        public void setOrderId(java.lang.Long newOrderId)
        Deprecated. 
        Sets the order ID.
        Specified by:
        setOrderId in interface UseCouponIdTaskCmd
        Parameters:
        newOrderId - the order ID.
      • setProcessingContext

        public void setProcessingContext(CommandContext newProcessingContext)
        Deprecated. 
        Sets the processing context.
        Parameters:
        newProcessingContext - command context to be used.
      • setRequestProperties

        public void setRequestProperties(TypedProperty newRequestProperties)
        Deprecated. 
        Sets the request properties.
        Specified by:
        setRequestProperties in interface UseCouponIdTaskCmd
        Parameters:
        newRequestProperties - the request properties.
      • setShopperId

        public void setShopperId(java.lang.Long newShopperId)
        Deprecated. 
        Sets the shopperId.
        Specified by:
        setShopperId in interface UseCouponIdTaskCmd
        Parameters:
        newShopperId - the shopper ID.
      • setValidSelection

        public void setValidSelection(boolean newValidSelection)
        Deprecated. 
        Sets the validSelect field.
        Parameters:
        newValidSelection - true if the selection is valid.
      • setKeepPrevious

        public void setKeepPrevious(boolean keepPrevious)
        Deprecated. 
        Sets the removePrevious.
        Specified by:
        setKeepPrevious in interface UseCouponIdTaskCmd
        Parameters:
        keepPrevious - The keepPrevious to set