diff options
author | Thomas <> | 2023-03-23 17:24:53 +0100 |
---|---|---|
committer | Thomas <> | 2023-06-05 17:05:35 +0200 |
commit | d39f2b7b7b4e2fea2a5402c63c10d3ce83097129 (patch) | |
tree | 969204495c98ac53b6e43e6bc98b5b1184eef52d /modules | |
parent | af37413f909cd9a65c260d04e7921003336ed143 (diff) | |
download | National_eIDAS_Gateway-d39f2b7b7b4e2fea2a5402c63c10d3ce83097129.tar.gz National_eIDAS_Gateway-d39f2b7b7b4e2fea2a5402c63c10d3ce83097129.tar.bz2 National_eIDAS_Gateway-d39f2b7b7b4e2fea2a5402c63c10d3ce83097129.zip |
chore(core): update statistic logger as requested by the BM.I
Diffstat (limited to 'modules')
-rw-r--r-- | modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java b/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java index 22cace10..fd2be89b 100644 --- a/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java +++ b/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java @@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory; import at.asitplus.eidas.specific.core.MsEidasNodeConstants; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.IStatusMessenger; +import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.api.logging.IStatisticLogger; import at.gv.egiz.eaaf.core.exceptions.EaafException; @@ -50,6 +51,8 @@ public class StatisticLogger implements IStatisticLogger { protocolRequest.getSpEntityId(), protocolRequest.getRawData(MsEidasNodeConstants.DATA_REQUESTERID), protocolRequest.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier(), + extractSpCountryCode(protocolRequest.getServiceProviderConfiguration() + .getAreaSpecificTargetIdentifier()), authData.getCiticenCountryCode(), extractMatchingState(protocolRequest.getRawData(MsEidasNodeConstants.DATA_MATCHING_STATE)), STATUS_SUCCESS, @@ -72,6 +75,7 @@ public class StatisticLogger implements IStatisticLogger { StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, + StringUtils.EMPTY, STATUS_ERROR, errorId, throwable.getMessage())); @@ -91,6 +95,8 @@ public class StatisticLogger implements IStatisticLogger { errorRequest.getSpEntityId(), errorRequest.getRawData(MsEidasNodeConstants.DATA_REQUESTERID), errorRequest.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier(), + extractSpCountryCode(errorRequest.getServiceProviderConfiguration() + .getAreaSpecificTargetIdentifier()), StringUtils.EMPTY, extractMatchingState(errorRequest.getRawData(MsEidasNodeConstants.DATA_MATCHING_STATE)), STATUS_ERROR, @@ -104,6 +110,7 @@ public class StatisticLogger implements IStatisticLogger { StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, + StringUtils.EMPTY, STATUS_ERROR, errorId, throwable.getMessage())); @@ -117,13 +124,23 @@ public class StatisticLogger implements IStatisticLogger { } + private String extractSpCountryCode(String target) { + if (target.startsWith(EaafConstants.URN_PREFIX_EIDAS)) { + return target.split("\\+")[2]; + + } else { + return "AT"; + + } + } + private String extractMatchingState(Object state) { return state != null ? state.toString() : MsEidasNodeConstants.MatchingStates.NO_REQUIRED.toString(); } private String buildLogMessage(String transId, String entityId, Object requesterId, String target, - String cc, String matchingState, + String spCountry, String cc, String matchingState, String status, String errorCode, String errorMsg) { String logMsg = StringUtils.EMPTY; @@ -140,6 +157,7 @@ public class StatisticLogger implements IStatisticLogger { } logMsg += target + ","; + logMsg += spCountry + ","; logMsg += cc + ","; logMsg += matchingState + ","; |