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.
defaultCommandClassName
Constructor and Description |
---|
RedeemCouponCmdImpl()
Deprecated.
Constructor for RedeemCouponCmdImpl, calls super.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
getOrderId()
Deprecated.
Gets the order ID.
|
CommandContext |
getProcessingContext()
Deprecated.
Gets the processing context.
|
java.lang.Long |
getShopperId()
Deprecated.
Gets the shopper ID.
|
void |
insertIntoDB(java.lang.Long orderId,
java.util.Hashtable couponHashtable)
Deprecated.
Inserts the coupon related information in the database.
|
boolean |
isReadyToCallExecute()
Deprecated.
It always returns true.
|
void |
performExecute()
Deprecated.
First the temporary and permanent table are cleaned up, which stores the eCoupon discount.
|
void |
removeExistingAdjustments(java.lang.Long anOrderId)
Deprecated.
Removes the existing adjustments for the orderitems.
|
void |
removeOldEntries()
Deprecated.
Removes the existing entries from
TempOrderCouponMapAccessBean
and TempCouponItemMapAccessBean . |
void |
setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order ID.
|
void |
setProcessingContext(CommandContext newProcessingContext)
Deprecated.
Sets the processingContext.
|
void |
setShopperId(java.lang.Long newShopperId)
Deprecated.
Sets the shopper ID.
|
void |
trace(java.lang.String traceString)
Deprecated.
Trace the debug info only.
|
void |
validateParameters()
Deprecated.
This method extracts and validates the parameters.
|
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public RedeemCouponCmdImpl()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public java.lang.Long getShopperId()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
OrderCouponMapAccessBean
for each coupon used for this order. Then, create the CouponItemMapAccessBean
for each item for
coupon, with the discount amount information.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.com.ibm.commerce.exception.ECException.
ECSystemException
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class AbstractECTargetableCommand
boolean
value; true
if we can execute the
command and false
otherwise. This default implementation will return true
.public void performExecute() throws ECException
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.
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
com.ibm.commerce.exception.ECException.
ECException
public void removeExistingAdjustments(java.lang.Long anOrderId) throws ECSystemException
anOrderId
- The order for which the adjustments are to be removed.com.ibm.commerce.exception.ECException.
ECSystemException
public void removeOldEntries() throws ECSystemException
TempOrderCouponMapAccessBean
and TempCouponItemMapAccessBean
.com.ibm.commerce.exception.ECException.
ECSystemException
public void setOrderId(java.lang.Long newOrderId)
newOrderId
- the order ID.public void setProcessingContext(CommandContext newProcessingContext)
newProcessingContext
- the command context.public void setShopperId(java.lang.Long newShopperId)
newShopperId
- the shopper ID.public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
com.ibm.commerce.exception.ECException.
ECException
public void trace(java.lang.String traceString)
traceString
-