com.ibm.commerce.couponredemption.commands

Class ApplyCouponUsageCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ApplyCouponUsageCmd, ApplyCalculationUsageCmd, CalculationCmd, 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 ApplyCouponUsageCmdImpl
    extends CalculationCmdImpl
    implements ApplyCouponUsageCmd

    This task command is called from OrderPrepare command to incorporate the eCoupon discount onto the Adjustments in ORDERS and ORDERITEMS table. The command is invoked when user asks to redeem the eCoupons before preparing order.

    The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean. They are removed from OrderCouponMapAccessBean and CouponItemMapAccessBean. The eCoupons are checked for expiry by calling CheckValidityTaskCmd command. The eCoupons that are not expired are checked for applicability by calling CheckApplicabilityTaskCmd command. The CalculateDiscountAmountCmd task command is called on the applicable coupons to find the discount amount to be incorporated in the currect order.

    See Also:
    Serialized Form
    • Constructor Detail

      • ApplyCouponUsageCmdImpl

        public ApplyCouponUsageCmdImpl()
        Deprecated. 
        Constructor for ApplyCouponUsageCmdImpl call super.
    • Method Detail

      • getAppliedItems

        public java.util.Set getAppliedItems()
        Deprecated. 
        Gets the applied items.
        Specified by:
        getAppliedItems in interface ApplyCalculationUsageCmd
        Returns:
        The set of applied items.
      • getOrderId

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

        public CommandContext getProcessingContext()
        Deprecated. 
        Gets the processing context.
        Returns:
        com.ibm.commerce.command.CommandContext
      • insertIntoDB

        public void insertIntoDB(java.lang.Long orderId,
                                 java.util.Hashtable couponHashtable)
                          throws ECSystemException
        Deprecated. 
        It inserts data into database.
        Parameters:
        couponHashTable - java.util.Hashtable
        Throws:
        ECSystemException
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean. They are removed from OrderCouponMapAccessBean and CouponItemMapAccessBean. The eCoupons are checked for expiry by calling CheckValidityTaskCmd command. The eCoupons that are not expired are checked for applicability by calling CheckApplicabilityTaskCmd command. The CalculateDiscountAmountCmd task command is called on the applicable coupons to find the discount amount to be incorporated in the currect order.

        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
      • removeOldEntries

        public void removeOldEntries()
                              throws ECSystemException
        Deprecated. 
        It removes the old entries.
        Throws:
        : - com.ibm.commerce.exception.ECException.
        ECSystemException
      • reset

        public void reset()
        Deprecated. 
        Sets the various variables to their default values (null).
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class CalculationCmdImpl
        See Also:
        Command.reset()
      • setOrderId

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

        public void setProcessingContext(CommandContext newProcessingContext)
        Deprecated. 
        Sets the processing context.
        Parameters:
        newProcessingContext - com.ibm.commerce.command.CommandContext
      • setTaxCategoryIds

        public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
        Deprecated. 
        Sets the tax category..
        Specified by:
        setTaxCategoryIds in interface ApplyCalculationUsageCmd
        Parameters:
        anTaxCategoryIds - an Integer.