diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IExtensionContext.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IExtensionContext.java index 3cfa69391..648d14360 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IExtensionContext.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IExtensionContext.java @@ -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); } diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/OutputQueueInsertConfig.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/OutputQueueInsertConfig.java index 7586f457d..7fefbb31b 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/OutputQueueInsertConfig.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/OutputQueueInsertConfig.java @@ -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. @@ -32,6 +34,7 @@ public class OutputQueueInsertConfig { private boolean secondaryManualApprovalRequired = false; private int secondaryDelaySeconds = 0; + private Date unlockTime; public boolean isSkipQueue() { return skipQueue; @@ -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{" + @@ -90,6 +101,7 @@ public String toString() { ", insertIntoSecondaryQueue=" + insertIntoSecondaryQueue + ", secondaryManualApprovalRequired=" + secondaryManualApprovalRequired + ", secondaryDelaySeconds=" + secondaryDelaySeconds + + ", unlockTime=" + unlockTime + '}'; } } diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/TestExtensionContext.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/TestExtensionContext.java index 0673499b7..3b0c6cd60 100644 --- a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/TestExtensionContext.java +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/TestExtensionContext.java @@ -481,4 +481,8 @@ public boolean isGlobalServer() { public void markTransactionAsWithdrawn(String remoteOrLocalTransactionId) { } + + @Override + public void unlockTransaction(String rid, Date serverTimeToUnlock) { + } }