summaryrefslogtreecommitdiff
path: root/eaaf_core_utils/src
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-02-27 11:01:17 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-02-27 11:01:17 +0100
commitc02bd7c0a8b47fefa09e1eb73291f5ea14082a3a (patch)
tree6aeefe24265465f18ada524a0040e45bf589dc3d /eaaf_core_utils/src
parentb8ad797b8940d880cfdae823093d90858375398a (diff)
downloadEAAF-Components-c02bd7c0a8b47fefa09e1eb73291f5ea14082a3a.tar.gz
EAAF-Components-c02bd7c0a8b47fefa09e1eb73291f5ea14082a3a.tar.bz2
EAAF-Components-c02bd7c0a8b47fefa09e1eb73291f5ea14082a3a.zip
add new transactionId for PII related data only
Diffstat (limited to 'eaaf_core_utils/src')
-rw-r--r--eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java53
1 files changed, 50 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 d8976548..4cbcfa70 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
@@ -30,8 +30,19 @@ import at.gv.egiz.eaaf.core.api.IRequest;
public class TransactionIdUtils {
// MDC variables for logging
+ /**
+ * To correlate technical logs over one single transactions.
+ */
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";
+
+ /**
+ * Unique application identifier that is processed in this transaction.
+ */
public static final String MDC_SERVICEPROVIDER_ID = "oaId";
/**
@@ -59,34 +70,70 @@ public class TransactionIdUtils {
}
+ /**
+ * Set unique service-provider identifier for Logging purposes.
+ *
+ * @param oaUniqueId Unique application Id
+ */
public static void setServiceProviderId(final String oaUniqueId) {
org.slf4j.MDC.put(MDC_SERVICEPROVIDER_ID, oaUniqueId);
}
+ /**
+ * Remove service-provider identifier for Logging.
+ */
public static void removeServiceProviderId() {
org.slf4j.MDC.remove(MDC_SERVICEPROVIDER_ID);
}
- public static void setTransactionId(final String pendingRequestID) {
- org.slf4j.MDC.put(MDC_TRANSACTION_ID, "TID-" + pendingRequestID);
+ /**
+ * Get Id to correlate technical logs over one single transactions.
+ *
+ * @return Unique transaction Id
+ */
+ public static String getTransactionId() {
+ return org.slf4j.MDC.get(MDC_TRANSACTION_ID);
}
+ /**
+ * Set Id to correlate technical logs over one single transactions.
+ *
+ * @param transactionId Unique transaction Id
+ */
+ public static void setTransactionId(final String transactionId) {
+ org.slf4j.MDC.put(MDC_TRANSACTION_ID, transactionId);
+
+ }
+
+ /**
+ * Remove transactionId for Logging.
+ */
public static void removeTransactionId() {
org.slf4j.MDC.remove(MDC_TRANSACTION_ID);
}
+ /**
+ * Set Id to correlate technical logs over a set of transactions, like SSO.
+ *
+ * @param uniqueSessionId Unique Id
+ */
public static void setSessionId(final String uniqueSessionId) {
- org.slf4j.MDC.put(MDC_SESSION_ID, "SID-" + uniqueSessionId);
+ org.slf4j.MDC.put(MDC_SESSION_ID, uniqueSessionId);
}
+ /**
+ * Remove sessionId for Logging.
+ *
+ */
public static void removeSessionId() {
org.slf4j.MDC.remove(MDC_SESSION_ID);
}
+
}