public class AcceptCouponFromBannerAdCmdImpl extends ControllerCommandImpl implements AcceptCouponFromBannerAdCmd
If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName
(and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of
coupons can be issued for this promotion) or number of coupons already issued from this promotion is
less then total number of coupons that can be issued, then a coupon may be issued.
Further, the customer should not have already accepted too many coupons. If the user is unregistered
and accepts the coupon from e-mail, number of coupons already
accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For
registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean.
Then an entry is created in the CouponWalletAccessBean.
The number of accepted coupons is updated for this promotion. If the
conditions are not satisfied then an error page is displayed.
defaultCommandClassName| Constructor and Description |
|---|
AcceptCouponFromBannerAdCmdImpl()
Deprecated.
AcceptCouponFromBannerAdCmdImpl constructor,calls super.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
getStoreId()
Deprecated.
Gets the store ID.
|
boolean |
isReadyToCallExecute()
Deprecated.
It always returns true.
|
void |
performExecute()
Deprecated.
If the promotion in
CouponPromotionAccessBean corresponding to the parameter promoName
(and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of
coupons can be issued for this promotion) or number of coupons already issued from this promotion is
less then total number of coupons that can be issued, then a coupon may be issued. |
void |
setStoreId(java.lang.Integer newStoreId)
Deprecated.
Sets the store ID.
|
void |
validateParameters()
Deprecated.
It extracts the parameters from request and command context and checks for their correctness.
|
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, 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, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiesfulfills, getOwnerpublic AcceptCouponFromBannerAdCmdImpl()
public java.lang.Integer getStoreId()
getStoreId in interface ECCommandgetStoreId in class AbstractECTargetableCommandpublic boolean isReadyToCallExecute()
isReadyToCallExecute in interface com.ibm.websphere.command.CommandisReadyToCallExecute in class AbstractECTargetableCommandpublic void performExecute()
throws ECException
If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName
(and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of
coupons can be issued for this promotion) or number of coupons already issued from this promotion is
less then total number of coupons that can be issued, then a coupon may be issued.
Further, the customer should not have already accepted too many coupons. If the user is unregistered
and accepts the coupon from e-mail, number of coupons already
accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For
registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean.
Then an entry is created in the CouponWalletAccessBean.
The number of accepted coupons is updated for this promotion. If the
conditions are not satisfied then an error page is displayed.
performExecute in interface ECCommandperformExecute in interface com.ibm.websphere.command.TargetableCommandperformExecute in class AbstractECTargetableCommandECException - If a problem is encountered while creating or finding an EJB.public void setStoreId(java.lang.Integer newStoreId)
newStoreId - java.lang.Integerpublic void validateParameters()
throws ECException
It takes the promoName, acceptedFromType, successURL and shopperEmailId from the request.
It takes storeId and userId from the commandContext.
It finds the promotionId for this promoName.
validateParameters in interface ECCommandvalidateParameters in class AbstractECTargetableCommandECException - If a problem is encountered while creating or finding an EJB.