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, setViewInputPropertiesaccessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiesexecuteFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCachegetCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputPropertiesexecuteFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCachegetCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputPropertiesaccessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwnercheckIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiesfulfills, getOwnerpublic 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.ECSystemExceptionpublic boolean isReadyToCallExecute()
isReadyToCallExecute in interface com.ibm.websphere.command.CommandisReadyToCallExecute in class AbstractECTargetableCommandboolean 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 ECCommandperformExecute in interface com.ibm.websphere.command.TargetableCommandperformExecute in class AbstractECTargetableCommandcom.ibm.commerce.exception.ECException.ECExceptionpublic void removeExistingAdjustments(java.lang.Long anOrderId)
throws ECSystemException
anOrderId - The order for which the adjustments are to be removed.com.ibm.commerce.exception.ECException.ECSystemExceptionpublic void removeOldEntries()
throws ECSystemException
TempOrderCouponMapAccessBean
and TempCouponItemMapAccessBean.com.ibm.commerce.exception.ECException.ECSystemExceptionpublic 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 ECCommandvalidateParameters in class AbstractECTargetableCommandcom.ibm.commerce.exception.ECException.ECExceptionpublic void trace(java.lang.String traceString)
traceString -