summaryrefslogtreecommitdiff
path: root/eaaf_core_api
diff options
context:
space:
mode:
authorThomas <>2024-06-11 14:43:12 +0200
committerThomas <>2024-06-11 14:43:12 +0200
commit4fcb0654e81a0e3abf400dbbbd8d2bedbbf5864d (patch)
treee0120b397d1166481b636461820df7d4be654a05 /eaaf_core_api
parent25fcb34c1f7f8b2483217061425fe35a0cabeb76 (diff)
downloadEAAF-Components-4fcb0654e81a0e3abf400dbbbd8d2bedbbf5864d.tar.gz
EAAF-Components-4fcb0654e81a0e3abf400dbbbd8d2bedbbf5864d.tar.bz2
EAAF-Components-4fcb0654e81a0e3abf400dbbbd8d2bedbbf5864d.zip
feat(core): add method parameter to define custom max. age for pendingRequestId
Diffstat (limited to 'eaaf_core_api')
-rw-r--r--eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequestStorage.java12
-rw-r--r--eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/utils/IPendingRequestIdGenerationStrategy.java18
2 files changed, 27 insertions, 3 deletions
diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequestStorage.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequestStorage.java
index 93ce5695..fa9e2252 100644
--- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequestStorage.java
+++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequestStorage.java
@@ -42,6 +42,18 @@ public interface IRequestStorage {
IRequest getPendingRequest(String pendingReqID) throws PendingReqIdValidationException;
/**
+ * Get a pending-request from storage.
+ *
+ * @param pendingReqID Id of the pending request
+ * @param maxPendingRequestIdAge Maximum token life-time in seconds. In case of
+ * < 0, default value will be used
+ * @return Pending Request Object
+ * @throws PendingReqIdValidationException if the pendingRequestId was invalid
+ */
+ IRequest getPendingRequest(String pendingReqID, int maxPendingRequestIdAge)
+ throws PendingReqIdValidationException;
+
+ /**
* Store a pending-request in storage.
*
* @param pendingRequest Pending-Request object to store
diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/utils/IPendingRequestIdGenerationStrategy.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/utils/IPendingRequestIdGenerationStrategy.java
index d5dc8aca..ddf3b291 100644
--- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/utils/IPendingRequestIdGenerationStrategy.java
+++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/utils/IPendingRequestIdGenerationStrategy.java
@@ -1,10 +1,9 @@
package at.gv.egiz.eaaf.core.api.utils;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.PendingReqIdValidationException;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
public interface IPendingRequestIdGenerationStrategy {
@@ -28,6 +27,19 @@ public interface IPendingRequestIdGenerationStrategy {
String validateAndGetPendingRequestId(@Nullable String pendingReqId) throws PendingReqIdValidationException;
/**
+ * Validate a pendingRequestId according to implemented strategy.
+ *
+ * @param pendingReqId pending-request Id that should be validated
+ * @param maxTokenAge Maximum token life-time in seconds. In case of < 0,
+ * default value will be used
+ * @return internalPendingRequestId
+ * @throws PendingReqIdValidationException In case of a token validation error
+ */
+ @Nonnull
+ String validateAndGetPendingRequestId(@Nullable String pendingReqId, @Nonnull int maxTokenAge)
+ throws PendingReqIdValidationException;
+
+ /**
* Get the internal pendingReqId without any validation.
*
* @param externalPendingReqId pending-request Id that should be validated