com.ibm.commerce.couponredemption.commands

Class CouponDSSTaskCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CouponDSSTaskCmd, 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 CouponDSSTaskCmdImpl
    extends TaskCommandImpl
    implements CouponDSSTaskCmd

    This task command is called from the CouponDSSCmd when user selects a set of eCoupons to be used on a set of items in her order.

    First the eCoupons with selection status whether SELECTED or not is checked and it shouldn't have a common item in their itemlist where the itemlist is obtained from the parameter itemFor<cpwalletIds> if specified or from TempCouponItemMapAccessBean otherwise. This is done for all non order level coupons. Also only one order level eCoupon can be selected per order.
    If the above conditions are satisfied, the selected eCoupons are moved from TempOrderCouponMapAccessBean to OrderCouponMapAccessBean and the unselected eCoupons are to deleted from TempOrderCouponMapAccessBean. Also the selected items are moved from TempCouponItemMapAccessBean to CouponItemMapAccessBean.

    See Also:
    Serialized Form
    • Constructor Detail

      • CouponDSSTaskCmdImpl

        public CouponDSSTaskCmdImpl()
        Deprecated. 
        CouponDSSCmdImpl constructor, call super.
    • Method Detail

      • computeItemAndDiscount

        public void computeItemAndDiscount()
                                    throws ECSystemException
        Deprecated. 
        Finds the items and discount on those corresponding to each cpwalletId.
        Throws:
        ECSystemException
      • getConflicts

        public java.util.Hashtable getConflicts()
        Deprecated. 
        Returns the conflict hashtable.
        Specified by:
        getConflicts in interface CouponDSSTaskCmd
        Returns:
        the hashtable of conflicts.
      • getCouponId

        public java.lang.Long[] getCouponId()
        Deprecated. 
        Gets the coupon IDs.
        Returns:
        the array of couponIds.
      • getItemsSelected

        public java.util.Hashtable getItemsSelected()
        Deprecated. 
        Gets the items that were selected for the coupons to be applied on. The key of the hashtable is the couponId and the value is array of strings representing the order item IDs.
        Returns:
        hashtable of items being used for coupons.
      • getNumCoupons

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

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

        public TypedProperty getReqProp()
        Deprecated. 
        Gets the request properties.
        Returns:
        request properties.
      • getRspProp

        public TypedProperty getRspProp()
        Deprecated. 
        Gets the response properties.
        Returns:
        response properties.
      • getUnQualifiedCoupons

        public java.util.Vector getUnQualifiedCoupons()
        Deprecated. 
        Gets the IDs of the unqualified coupons.
        Specified by:
        getUnQualifiedCoupons in interface CouponDSSTaskCmd
        Returns:
        a vector of coupon IDs that did not qualify for this order.
      • 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:
        true
      • isValidSelection

        public boolean isValidSelection()
        Deprecated. 
        Returns whether the selection is valid or not.
        Specified by:
        isValidSelection in interface CouponDSSTaskCmd
        Returns:
        true if the selection was valid.
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        First the eCoupons with selection status whether SELECTED or not is checked and it shouldn't have a common item in their itemlist where the itemlist is obtained from the parameter itemFor<cpwalletIds> if specified or from TempCouponItemMapAccessBean otherwise. This is done for all non order level coupons. Also only one order level eCoupon can be selected per order.
        If the above conditions are satisfied, the selected eCoupons are moved from TempOrderCouponMapAccessBean to OrderCouponMapAccessBean and the unselected eCoupons are to deleted from TempOrderCouponMapAccessBean. Also the selected items are moved from TempCouponItemMapAccessBean to CouponItemMapAccessBean.

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

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

        public void setCouponId(java.lang.Long[] newCouponId)
        Deprecated. 
        Sets the ecoupon IDs.
        Specified by:
        setCouponId in interface CouponDSSTaskCmd
        Parameters:
        newCouponId - the coupon IDs.
      • setItemsSelected

        public void setItemsSelected(java.util.Hashtable newItemsSelected)
        Deprecated. 
        Sets the items that were selected for the coupons to be applied on. The key of the hashtable is the couponId and the value is array of strings representing the order item IDs.
        Specified by:
        setItemsSelected in interface CouponDSSTaskCmd
        Parameters:
        newItemsSelected - hashtable of items being used for coupons.
      • setNumCoupons

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

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

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

        public void transferFromTemp()
                              throws ECSystemException
        Deprecated. 

        Transfer the entries from TempOrderCouponMapAccessBean and TempCouponItemMapAccessBean to the OrderCouponMapAcessBean and CouponItemMapAcessBean.

        Throws:
        : - com.ibm.commerce.exception.ECException.
        ECSystemException