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, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, 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, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public AcceptCouponFromBannerAdCmdImpl()
public java.lang.Integer getStoreId()
getStoreId
in interface ECCommand
getStoreId
in class AbstractECTargetableCommand
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class AbstractECTargetableCommand
public 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 ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- 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 ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
- If a problem is encountered while creating or finding an EJB.