public class TrackPaymentActionsCmdImpl extends TaskCommandImpl implements TrackPaymentActionsCmd
If the parameter transactionCompensationAction is configured as 'track', this command is called both during transaction rolling back and rolled back. When transaction rolling back, the command retrieves relative payment data from database for successful payment action and cache them in class variables. The successful payment action refers to the payment action that has been successfully executed within the current transaction. The Payment data may include edpPayInst, edpAtmPay, ppcPayInst, ppcPayment, ppcPayTran, ppcExtData, edpRelease, ppcCredit, edpRefInst. When transaction rolled back, the command restores these cached data back to database.
out-of-box just provides implementations for some basic data's retrieval and restore logic e.g edpPayInst and does not provide overall implementation. You can extend the methods retrievePaymentData() and restorePaymentData() to give implementation according to your specific usage scenarios and requirements.
Input parameters include:Modifier and Type | Field and Description |
---|---|
static java.lang.Short | QUERY_ACTION
action type -- query action
|
static java.lang.Short | RESTORE_ACTION
action type -- restore action
|
Constructor and Description |
---|
TrackPaymentActionsCmdImpl() |
Modifier and Type | Method and Description |
---|---|
ActionData | getActionData()
This method gets the action data that has been successfully executed.
|
java.lang.Short | getActionType()
This method gets the action type for this command which determines whether to retrieve or restore payment data for the payment action.
|
protected com.ibm.commerce.edp.activitylog.ActivityLoggerLocal | getActivityLoggerFacade()
This method gets the local interface of activity logger, which will store the history of payment/refund actions in database.
|
com.ibm.commerce.edp.model.AtomicPaymentData | getEDPAtmPay()
This method gets edpAtmPay data.
|
com.ibm.commerce.edp.model.PaymentInstructionData | getEDPPayInst()
This method gets edpPayInst data.
|
com.ibm.commerce.edp.refunds.RefundInstructionData | getEDPRefInst()
This method gets edpRefInst data.
|
java.util.Collection | getEDPReleases()
This method gets edpRelease data.
|
protected com.ibm.commerce.payments.plugincontroller.beans.ObjectModuleFacadeLocal | getObjectModuleFacade()
This method gets the object module facade local interface by calling ObjectModuleFacadeFactory.
|
protected com.ibm.commerce.edp.model.ObjectModelFacadeLocal | getOMF()
This method returns the reference to the object model facade.
|
java.lang.Integer | getPhase()
This method gets the phase when the payment action is executed.
|
com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData | getPPCCredit()
This method gets ppcCredit data.
|
java.util.Collection | getPPCExtDataForPayInst()
This method gets ppcExtData for ppcPayInst.
|
java.util.Collection | getPPCExtDataForPayTran()
This method gets ppcExtData for ppcPayTran.
|
com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData | getPPCPayInst()
This method gets ppcPayInst data.
|
com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData | getPPCPayment()
This method gets ppcPayment data.
|
com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData | getPPCPayTran()
This method gets ppcPayTran data.
|
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 main logic of this command.
|
void | reset()
This method resets the command fields.
|
protected com.ibm.commerce.edp.model.AtomicPaymentData | restoreEDPAtmPayData(com.ibm.commerce.edp.model.AtomicPaymentData originalEDPAtmPay, com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst)
This method restores edpAtmPayData for the payment action back to database.
|
protected void | restoreEDPPayHist(com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment)
This method restores edpPayHistData for the payment action back to database.
|
protected com.ibm.commerce.edp.model.PaymentInstructionData | restoreEDPPayInstData(com.ibm.commerce.edp.model.PaymentInstructionData originalEDPPayInst)
This method restores edpPayInstData for the payment action back to database.
|
protected void | restorePaymentData()
This method restores all cached payment data for the payment action back to database.
|
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData | restorePPCPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData originalPPCPayInst, java.util.Collection originalPPCExtData)
This method restores ppcPayInstData for the payment action back to database.
|
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData | restorePPCPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData originalPPCPayment, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst)
This method restores ppcPaymentData for the payment action back to database.
|
protected void | restorePPCPayTranData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData originalPPCPayTran, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment, java.util.Collection newExtData)
This method restores ppcPayTranData for the payment action back to database.
|
protected com.ibm.commerce.edp.model.AtomicPaymentData | retrieveEDPAtmPayData()
This method retrieves edpAtmPayData for payment action from database.
|
protected com.ibm.commerce.edp.model.PaymentInstructionData | retrieveEDPPayInstData()
This method retrieves edpPayInstData for the payment action from database.
|
protected void | retrievePaymentData()
This method retrieves all related payment data for the payment action from database.
|
protected java.util.Collection | retrievePPCExtDataForPayInst()
This method retrieves ppcExtData for ppcPayInst for the payment action from database.
|
protected java.util.Collection | retrievePPCExtDataForPayTran()
This method retrieves ppcExtData for ppcPayTran for the payment action from database.
|
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData | retrievePPCPayInstData()
This method retrieves ppcPayInstData for payment action from database.
|
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData | retrievePPCPaymentData()
This method retrieves ppcPaymentData for payment action from database.
|
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData | retrievePPCPayTranData()
This method retrieves ppcPayTranData for payment action from database.
|
void | setActionData(ActionData localActionData)
This method sets the action data that has been successfully executed.
|
void | setActionType(java.lang.Short localActionType)
This method sets the action type for this command which determines whether to retrieve or restore payment data for the payment action.
|
void | setEDPAtmPay(com.ibm.commerce.edp.model.AtomicPaymentData localEdpAtmPay)
This method sets edpAtmPay data.
|
void | setEDPPayInst(com.ibm.commerce.edp.model.PaymentInstructionData localEdpPayInst)
This method sets edpPayInst data.
|
void | setEDPRefInst(com.ibm.commerce.edp.refunds.RefundInstructionData localEdpRefInst)
This method sets edpRefInst data.
|
void | setEDPReleases(java.util.Collection localEdpReleases)
This method sets edpRelease data.
|
void | setOrderId(java.lang.Long localOrderId)
This method sets orderId data of the payment action.
|
void | setPhase(java.lang.Integer localPhase)
This method sets the phase when the payment action is executed.
|
void | setPPCCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData localPpcCredit)
This method sets ppcCredit data.
|
void | setPPCExtDataForPayInst(java.util.Collection localPPCExtData)
This method sets ppcExtData for ppcPayInst.
|
void | setPPCExtDataForPayTran(java.util.Collection localPPCExtData)
This method sets ppcExtData for ppcPayTran.
|
void | setPPCPayInst(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData localPpcPayInst)
This method sets ppcPayInst data.
|
void | setPPCPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData localPpcPayment)
This method sets ppcPayment data.
|
void | setPPCPayTran(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData localPpcPayTran)
This method sets ppcPayTran data.
|
protected void | trackPaymentData()
This method performs corresponding type of action according to current transaction status: retrieve payment data from database when transaction rolling back or restore the cached payment data back to database when transaction rolled back.
|
protected void | updateEDPAtmPayAmount(com.ibm.commerce.edp.model.AtomicPaymentData newAtmPay)
This method updates edpAtmPayData phase amount.
|
protected void | updateEDPAtmPayData(com.ibm.commerce.edp.model.AtomicPaymentData newEDPAtmPay, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment)
This method cancels the edpAtmPayData if it is to be canceled.
|
protected void | updateEDPPayInstData(com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst)
This method updates edpPayInstData with the back end pi id.
|
public static final java.lang.Short QUERY_ACTION
public static final java.lang.Short RESTORE_ACTION
public java.util.Collection getEDPReleases()
public void setEDPReleases(java.util.Collection localEdpReleases)
public com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData getPPCCredit()
public void setPPCCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData localPpcCredit)
public com.ibm.commerce.edp.refunds.RefundInstructionData getEDPRefInst()
public void setEDPRefInst(com.ibm.commerce.edp.refunds.RefundInstructionData localEdpRefInst)
public void setActionData(ActionData localActionData)
public java.lang.Short getActionType()
public void setActionType(java.lang.Short localActionType)
public ActionData getActionData()
public void setOrderId(java.lang.Long localOrderId)
public java.lang.Integer getPhase()
public void setPhase(java.lang.Integer localPhase)
public com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData getPPCPayInst()
public void setPPCPayInst(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData localPpcPayInst)
public com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData getPPCPayment()
public void setPPCPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData localPpcPayment)
public com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData getPPCPayTran()
public void setPPCPayTran(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData localPpcPayTran)
public com.ibm.commerce.edp.model.PaymentInstructionData getEDPPayInst()
public void setEDPPayInst(com.ibm.commerce.edp.model.PaymentInstructionData localEdpPayInst)
public com.ibm.commerce.edp.model.AtomicPaymentData getEDPAtmPay()
public void setEDPAtmPay(com.ibm.commerce.edp.model.AtomicPaymentData localEdpAtmPay)
public java.util.Collection getPPCExtDataForPayInst()
public void setPPCExtDataForPayInst(java.util.Collection localPPCExtData)
public java.util.Collection getPPCExtDataForPayTran()
public void setPPCExtDataForPayTran(java.util.Collection localPPCExtData)
public void performExecute() throws ECException
protected void trackPaymentData() throws ECException
protected void retrievePaymentData() throws ECException
protected void restorePaymentData() throws ECException
protected com.ibm.commerce.edp.model.PaymentInstructionData retrieveEDPPayInstData() throws ECException
protected com.ibm.commerce.edp.model.AtomicPaymentData retrieveEDPAtmPayData() throws ECException
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData retrievePPCPayInstData() throws ECException
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData retrievePPCPaymentData() throws ECException
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData retrievePPCPayTranData() throws ECException
protected void updateEDPPayInstData(com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst) throws ECException
protected java.util.Collection retrievePPCExtDataForPayInst() throws ECException
protected java.util.Collection retrievePPCExtDataForPayTran() throws ECException
protected com.ibm.commerce.edp.model.PaymentInstructionData restoreEDPPayInstData(com.ibm.commerce.edp.model.PaymentInstructionData originalEDPPayInst) throws ECException
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData restorePPCPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData originalPPCPayInst, java.util.Collection originalPPCExtData) throws ECException
protected com.ibm.commerce.edp.model.AtomicPaymentData restoreEDPAtmPayData(com.ibm.commerce.edp.model.AtomicPaymentData originalEDPAtmPay, com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst) throws ECException
protected com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData restorePPCPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData originalPPCPayment, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst) throws ECException
protected void updateEDPAtmPayData(com.ibm.commerce.edp.model.AtomicPaymentData newEDPAtmPay, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment) throws ECException
protected void restorePPCPayTranData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData originalPPCPayTran, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment, java.util.Collection newExtData) throws ECException
protected void restoreEDPPayHist(com.ibm.commerce.edp.model.PaymentInstructionData newEDPPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData newPPCPayInst, com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData newPPCPayment) throws ECException
protected void updateEDPAtmPayAmount(com.ibm.commerce.edp.model.AtomicPaymentData newAtmPay) throws InputException, J2EEException
protected final com.ibm.commerce.edp.model.ObjectModelFacadeLocal getOMF() throws J2EEException
protected final com.ibm.commerce.payments.plugincontroller.beans.ObjectModuleFacadeLocal getObjectModuleFacade() throws InternalException
protected final com.ibm.commerce.edp.activitylog.ActivityLoggerLocal getActivityLoggerFacade() throws J2EEException
public void reset()
This method resets the command fields.
After this method is invoked, and proper attributes are set, the command can be executed again.
public boolean isReadyToCallExecute()