summaryrefslogtreecommitdiff
path: root/eaaf_core_utils/src/main
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-03-10 13:58:02 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-03-10 13:58:02 +0100
commit56f6da9375ca0467d0087893516325c0f5608ea6 (patch)
treecf3fc5816558c10f32fb3ae6c45bec80b8e8fa23 /eaaf_core_utils/src/main
parent90705b721d49c61e6d7a698fd66aa951470e9dc0 (diff)
downloadEAAF-Components-56f6da9375ca0467d0087893516325c0f5608ea6.tar.gz
EAAF-Components-56f6da9375ca0467d0087893516325c0f5608ea6.tar.bz2
EAAF-Components-56f6da9375ca0467d0087893516325c0f5608ea6.zip
rename MDC variables for Session- and TransactionIds
Diffstat (limited to 'eaaf_core_utils/src/main')
-rw-r--r--eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
index 5a26eea3..4c1601c0 100644
--- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
+++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
@@ -19,6 +19,8 @@
package at.gv.egiz.eaaf.core.impl.utils;
+import java.util.UUID;
+
import at.gv.egiz.eaaf.core.api.IRequest;
/**
@@ -32,17 +34,17 @@ public class TransactionIdUtils {
/**
* To correlate technical logs over one single transactions.
*/
- public static final String MDC_TRANSACTION_ID = "transactionid";
+ public static final String MDC_TRANSACTION_ID = "transactionId";
/**
* To correlate technical logs over a set of transactions, like SSO.
*/
- public static final String MDC_SESSION_ID = "sessionid";
+ public static final String MDC_SESSION_ID = "sessionId";
/**
* Unique application identifier that is processed in this transaction.
*/
- public static final String MDC_SERVICEPROVIDER_ID = "oaid";
+ public static final String MDC_SERVICEPROVIDER_ID = "oaId";
/**
* Unique application identifier that is processed in this transaction.
@@ -104,6 +106,14 @@ public class TransactionIdUtils {
}
/**
+ * Set new random transactionId as an UUID.
+ */
+ public static void setTransactionId() {
+ org.slf4j.MDC.put(MDC_TRANSACTION_ID, UUID.randomUUID().toString());
+
+ }
+
+ /**
* Set Id to correlate technical logs over one single transactions.
*
* @param transactionId Unique transaction Id
@@ -122,6 +132,14 @@ public class TransactionIdUtils {
}
/**
+ * Set a new random SessionId as UUID.
+ */
+ public static void setSessionId() {
+ org.slf4j.MDC.put(MDC_SESSION_ID, UUID.randomUUID().toString());
+
+ }
+
+ /**
* Set Id to correlate technical logs over a set of transactions, like SSO.
*
* @param uniqueSessionId Unique Id