Search in sources :

Example 6 with EventDetailsKey

use of uk.gov.ida.eventemitter.EventDetailsKey in project verify-hub by alphagov.

the class AttributeQueryRequestRunnable method auditAndLogTimeoutException.

private void auditAndLogTimeoutException(SessionId sessionId, AttributeQueryContainerDto attributeQueryContainerDto, AttributeQueryTimeoutException exception, String message) {
    Map<EventDetailsKey, String> details = new HashMap<>();
    details.put(idp_entity_id, attributeQueryContainerDto.getIssuer());
    String errorId = UUID.randomUUID().toString();
    details.put(error_id, errorId);
    details.put(EventDetailsKey.message, message);
    EventSinkHubEvent hubEvent = new EventSinkHubEvent(serviceInfo, sessionId, EventSinkHubEventConstants.EventTypes.ERROR_EVENT, details);
    eventSinkProxy.logHubEvent(hubEvent);
    eventEmitter.record(hubEvent);
    LOG.warn(format(message + " It has been Audited with error id: {0}.", errorId), exception);
}
Also used : HashMap(java.util.HashMap) EventDetailsKey(uk.gov.ida.eventemitter.EventDetailsKey) EventSinkHubEvent(uk.gov.ida.hub.shared.eventsink.EventSinkHubEvent)

Aggregations

EventDetailsKey (uk.gov.ida.eventemitter.EventDetailsKey)6 HashMap (java.util.HashMap)4 EventSinkHubEvent (uk.gov.ida.hub.shared.eventsink.EventSinkHubEvent)4 EventSinkHubEvent (uk.gov.ida.hub.policy.domain.EventSinkHubEvent)2 URI (java.net.URI)1 UUID (java.util.UUID)1 Test (org.junit.jupiter.api.Test)1 ApplicationException (uk.gov.ida.exceptions.ApplicationException)1