public class AllocatePromotionCodeCmdImpl extends TaskCommandImpl implements AllocatePromotionCodeCmd
setPromotionId()
to set the promotion from which a code should be allocated.setOwnerId()
if the code should be assigned to a particular customer.
Otherwise the code will be allocated, but will be unassigned.
performExecute
.
getAllocatedPromotionCode
to get the code that has been allocated. If no code
has been allocated, then this method will return null.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of the class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
defaultCommandClassName
Constructor and Description |
---|
AllocatePromotionCodeCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAllocatedPromotionCode()
This method gets the promotion code that has been allocated.
|
java.lang.String |
getAndAllocatePromotionCode(java.lang.Integer promoId)
This method attempts to get an unallocated code from the specified promotion.
|
java.lang.Long |
getOwnerId()
This method gets the member ID of the customer to whom the allocated promotion code
should be assigned.
|
void |
performExecute()
Performs the execution of the command.
|
void |
setBatchMode(boolean b)
The methods sets if the e-mail containing the PromotionCode tag
is being sent from an e-mail in batch mode.
|
void |
setOwnerId(java.lang.Long newOwnerId)
This method sets the member ID of the customer to whom the allocated promotion code
should be assigned.
|
void |
setPromotionId(java.lang.Integer newPromotionId)
This method sets the promotion ID of the promotion from which a promotion
code should be allocated.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
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
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public void performExecute() throws ECException
setPromotionId
,
and optionally getOwnerId
need to be called before calling
this method.performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public java.lang.String getAndAllocatePromotionCode(java.lang.Integer promoId) throws java.sql.SQLException, javax.naming.NamingException
promoId
- The ID of the promotion from which a promotion
code should be allocated.java.sql.SQLException
- if there is a problem accessing to the database.javax.naming.NamingException
- if there is a problem obtaining the data source.public java.lang.String getAllocatedPromotionCode()
getAllocatedPromotionCode
in interface AllocatePromotionCodeCmd
public void setPromotionId(java.lang.Integer newPromotionId)
setPromotionId
in interface AllocatePromotionCodeCmd
newPromotionId
- The ID of the promotion.public void setOwnerId(java.lang.Long newOwnerId)
setOwnerId
in interface AllocatePromotionCodeCmd
newOwnerId
- The ID of the owner.public java.lang.Long getOwnerId()
public void setBatchMode(boolean b)
b
- If the e-mail requesting a promotion code is being sent immediately.