com.ibm.commerce.couponredemption.commands

Class RedeemCouponCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, RedeemCouponCmd, 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

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

    public class RedeemCouponCmdImpl
    extends ControllerCommandImpl
    implements RedeemCouponCmd

    This command is invoked when the user asks to redeem her eCoupons before preparing order and it displays a set of eCoupons that can be applied to this order.

    First the temporary and permanent table are cleaned up, which stores the eCoupon discount. Then the eCoupons for this shopper are found out from CouponWalletAccessBean with state as USABLE. The CheckValidityCmd command is called to find the coupons that are not expired and for not expired coupons CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable eCoupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and the view command is redirected to show the applicable coupons and corresponding discounts.

    See Also:
    Serialized Form
    • Constructor Detail

      • RedeemCouponCmdImpl

        public RedeemCouponCmdImpl()
        Deprecated. 
        Constructor for RedeemCouponCmdImpl, calls super.
    • Method Detail

      • getOrderId

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

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

        public java.lang.Long getShopperId()
        Deprecated. 
        Gets the shopper ID.
        Returns:
        the shopper ID.
      • 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 OrderCouponMapAccessBean for each coupon used for this order. Then, create the CouponItemMapAccessBean 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
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Deprecated. 
        It always returns true.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        This method returns a boolean value; true if we can execute the command and false otherwise. This default implementation will return true.
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        First the temporary and permanent table are cleaned up, which stores the eCoupon discount. Then the eCoupons for this shopper are found out from CouponWalletAccessBean with state as USABLE. The CheckValidityCmd command is called to find the coupons that are not expired and for not expired coupons CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable eCoupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and the view command is redirected to show the applicable coupons and corresponding discounts.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException.
        ECException
      • removeExistingAdjustments

        public void removeExistingAdjustments(java.lang.Long anOrderId)
                                       throws ECSystemException
        Deprecated. 
        Removes the existing adjustments for the orderitems.
        Parameters:
        anOrderId - The order for which the adjustments are to be removed.
        Throws:
        com.ibm.commerce.exception.ECException.
        ECSystemException
      • removeOldEntries

        public void removeOldEntries()
                              throws ECSystemException
        Deprecated. 
        Removes the existing entries from TempOrderCouponMapAccessBean and TempCouponItemMapAccessBean.
        Throws:
        com.ibm.commerce.exception.ECException.
        ECSystemException
      • setOrderId

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

        public void setProcessingContext(CommandContext newProcessingContext)
        Deprecated. 
        Sets the processingContext.
        Parameters:
        newProcessingContext - the command context.
      • setShopperId

        public void setShopperId(java.lang.Long newShopperId)
        Deprecated. 
        Sets the shopper ID.
        Parameters:
        newShopperId - the shopper ID.
      • trace

        public void trace(java.lang.String traceString)
        Deprecated. 
        Trace the debug info only.
        Parameters:
        traceString -