diff options
-rw-r--r-- | eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java | 24 |
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 |