com.ibm.commerce.couponredemption.commands
Class UseCouponIdCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.couponredemption.commands.UseCouponIdCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, UseCouponIdCmd

public class UseCouponIdCmdImpl
extends ControllerCommandImpl
implements UseCouponIdCmd

This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out.

The input to this command is :

If the given set of BCIDs aren't valid for this shopper from the CPWALLET, then an error page is send to the user. If the above condition is true then, the following steps are performed. The CheckValidityCmd command is called to find the eCoupons that are not expired and for 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.


Field Summary
protected  java.lang.Long[] couponId
           
protected  java.util.Vector iResourceList
           
protected  java.lang.Long orderId
           
protected  CommandContext processingContext
           
protected  boolean selectionOK
           
protected  java.lang.Long shopperId
           
protected  java.lang.Integer storeId
           
 
Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.couponredemption.commands.UseCouponIdCmd
COPYRIGHT, defaultCommandClassName
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
UseCouponIdCmdImpl()
          UseCouponIdCmdImpl constructor call super.
 
Method Summary
 AccessVector getResources()
          Get the resourses.
 void performExecute()
          This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out.
 void validateParameters()
          ControllerCommandImpl calls checkParameter in performExecute.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

couponId

protected java.lang.Long[] couponId

iResourceList

protected java.util.Vector iResourceList

orderId

protected java.lang.Long orderId

processingContext

protected CommandContext processingContext

selectionOK

protected boolean selectionOK

shopperId

protected java.lang.Long shopperId

storeId

protected java.lang.Integer storeId
Constructor Detail

UseCouponIdCmdImpl

public UseCouponIdCmdImpl()
UseCouponIdCmdImpl constructor call super.
Method Detail

getResources

public AccessVector getResources()
                          throws ECSystemException
Get the resourses.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
com.ibm.commerce.accesscontrol.AccessVector
Throws:
ECSystemException -  

performExecute

public void performExecute()
                    throws ECException

This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out.
If the given set of BCIDs aren't valid for this shopper from the CPWALLET, then an error page is send to the user. If the above condition is true then, the following steps are performed. The CheckValidityCmd command is called to find the eCoupons that are not expired and for 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
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException -  

validateParameters

public void validateParameters()
                        throws ECException
ControllerCommandImpl calls checkParameter in performExecute. It is the responsibility of the command writers to implements this method if they want to perform server side parameter checking. They should either calls checkParameters inside their performExecute or calls super.performExecute() as the first statement in the performExecute method.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
CommandException. -