Skip to content

Commit

Permalink
CF-568 - Transaction Unlock Time in Output Queue Feature (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMaros authored Oct 23, 2023
1 parent 445d533 commit fecae7d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -831,4 +831,14 @@ public static class EmbeddedEmailImage {
* @param remoteOrLocalTransactionId
*/
void markTransactionAsWithdrawn(String remoteOrLocalTransactionId);

/**
* Allows to manage the unlock time of a specific transaction.
* This can be used to unlock the transaction sooner or prolong it.
* Transactions that are locked will remain in the output queue and won't be flushed until they are unlocked.
*
* @param rid Remote transaction ID
* @param serverTimeToUnlock The absolute datetime when the transaction should unlock.
*/
void unlockTransaction(String rid, Date serverTimeToUnlock);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
************************************************************************************/
package com.generalbytes.batm.server.extensions;

import java.util.Date;

/**
* Information about how a transaction should be inserted into an Output Queue.
* This is initially configured in admin per Output Queue and it can be overridden by extensions for each transaction.
Expand All @@ -32,6 +34,7 @@ public class OutputQueueInsertConfig {

private boolean secondaryManualApprovalRequired = false;
private int secondaryDelaySeconds = 0;
private Date unlockTime;

public boolean isSkipQueue() {
return skipQueue;
Expand Down Expand Up @@ -81,6 +84,14 @@ public void setSecondaryDelaySeconds(int secondaryDelaySeconds) {
this.secondaryDelaySeconds = secondaryDelaySeconds;
}

public Date getUnlockTime() {
return unlockTime;
}

public void setUnlockTime(Date unlockTime) {
this.unlockTime = unlockTime;
}

@Override
public String toString() {
return "OutputQueueInsertConfig{" +
Expand All @@ -90,6 +101,7 @@ public String toString() {
", insertIntoSecondaryQueue=" + insertIntoSecondaryQueue +
", secondaryManualApprovalRequired=" + secondaryManualApprovalRequired +
", secondaryDelaySeconds=" + secondaryDelaySeconds +
", unlockTime=" + unlockTime +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,8 @@ public boolean isGlobalServer() {
public void markTransactionAsWithdrawn(String remoteOrLocalTransactionId) {

}

@Override
public void unlockTransaction(String rid, Date serverTimeToUnlock) {
}
}

0 comments on commit fecae7d

Please sign in to comment.