public class ReservePaymentCmdImpl extends AEDPStoreTaskCmdImpl implements ReservePaymentCmd
ReservePaymentCmd
task command.
commandContext |
The command context. |
orderId |
A Long that indicates the id of the current order. |
reservationAmount |
A BigDecimal that indicates the total reservation amount. |
releases |
A HashMap that represents the list of the current releases and release amounts. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM Copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
ReservePaymentCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection |
getReleaseIds()
Obtains the list of release ids to be reserved.
|
java.util.HashMap |
getReleases()
This method gets the list of releases to be processed in this request.
|
java.math.BigDecimal |
getReservationAmount()
This method gets the total amount to be reserved.
|
boolean |
isReadyToCallExecute()
This method is called by the Command Framework to check if all basic mandatory parameters
have been set for this command.
|
void |
performExecute()
This method executes the business logic of the command.
|
void |
processFG()
This method executes the foreground tasks.
|
void |
reset()
Resets the command fields.
|
void |
setReleases(java.util.HashMap paramReleases)
This method sets the releases to be reserved.
|
void |
setReservationAmount(java.math.BigDecimal paramReservationAmount)
This method sets the total order amount.
|
void |
validateInsideProcessFG()
This method validates all parameters for this reverse payment business event.
|
getCurrency, getOrderAmount, getPaymentInstructions, setCurrency, setOrderAmount, setPaymentInstructions
getErrorMessageMap, getStoreId, insertActionListToActionDetailHash, insertActionListToEditActionDetailHash, isBgJobInWorking, isProcessBGExecutableInFG, setBgJobStatusInDb, setErrorMessageMap, setStoreId, toString
getEdpException, getEDPOrderId, getEDPResults, getLanguageId, getLocale, getOrderChannel, getOrderId, getStatus, isIdempotent, isProcessBGTasksRequired, resetServices, setBGProcessFinished, setEdpException, setEDPOrderId, setEDPResults, setOrderChannel, setOrderId, setProcessBGTasksRequired, setStatus
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getUser, getUserId, 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, wait, wait, wait
getCurrency, getEDPResults, getLanguageId, getLocale, getOrderChannel, getOrderId, setEDPResults, setOrderId
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 boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class AbstractECTargetableCommand
public void setReleases(java.util.HashMap paramReleases)
setReleases
in interface ReservePaymentCmd
paramReleases
- the list of release IDs(Long) and their amounts(BigDecimal) to be reservedpublic java.util.HashMap getReleases()
public void setReservationAmount(java.math.BigDecimal paramReservationAmount)
setReservationAmount
in interface ReservePaymentCmd
paramReservationAmount
- the total amount to be reservedpublic java.math.BigDecimal getReservationAmount()
public void performExecute() throws ECException
It firstly checks the backend job status. If the status is working ,sets the priority of event as HIGH then the ECEvent will process the event immediately. After this, if the BG status is still on working ,throw ECApplicationException.
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- in case of a failurepublic void reset()
Resets the command fields.
After this method is invoked, and proper attributes are set, the command can be executed again.
reset
in interface com.ibm.websphere.command.Command
reset
in class AEDPPaymentTaskCmdImpl
public java.util.Collection getReleaseIds()
public void processFG() throws EDPException, ECException
This method executes the foreground tasks.
1. It checks if any unresolved failures in background.
2. It updates atomic payments with freshly acquired data from backend.
3. It calculates the amount to process in current phase, and decides what payment actions should be executed from the payment rule configurations.
EDPException
- in case of an errorECException
- in case of an errorpublic void validateInsideProcessFG() throws EDPException
validateInsideProcessFG
in class AEDPStoreTaskCmdImpl
EDPException
- if some parameter is invalid