use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLogger method logRequestFromHub.
public void logRequestFromHub(SessionId sessionId, String transactionEntityId) {
Map<EventDetailsKey, String> details = new HashMap<>();
details.put(hub_event_type, RECEIVED_AUTHN_REQUEST_FROM_HUB);
details.put(transaction_entity_id, transactionEntityId);
EventSinkHubEvent eventSinkHubEvent = new EventSinkHubEvent(serviceInfo, sessionId, HUB_EVENT, details);
eventSinkProxy.logHubEvent(eventSinkHubEvent);
eventEmitter.record(eventSinkHubEvent);
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLogger method logSessionEvent.
private void logSessionEvent(SessionId sessionId, String transactionEntityId, DateTime sessionExpiryTimestamp, String requestId, String state, Map<EventDetailsKey, String> details) {
LOG.info(MessageFormat.format("Session {0} moved to state {1}", sessionId.getSessionId(), state));
details.put(session_event_type, state);
details.put(session_expiry_time, sessionExpiryTimestamp.toString());
details.put(transaction_entity_id, transactionEntityId);
details.put(request_id, requestId);
EventSinkHubEvent sessionHubEvent = new EventSinkHubEvent(serviceInfo, sessionId, SESSION_EVENT, details);
eventSinkProxy.logHubEvent(sessionHubEvent);
eventEmitter.record(sessionHubEvent);
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLogger method logSessionTimeoutEvent.
public void logSessionTimeoutEvent(SessionId sessionId, DateTime sessionExpiryTimestamp, String transactionEntityId, String requestId) {
Map<EventDetailsKey, String> details = new HashMap<>();
details.put(session_event_type, SESSION_TIMEOUT);
details.put(session_expiry_time, sessionExpiryTimestamp.toString());
details.put(transaction_entity_id, transactionEntityId);
details.put(request_id, requestId);
EventSinkHubEvent eventSinkHubEvent = new EventSinkHubEvent(serviceInfo, sessionId, SESSION_EVENT, details);
eventSinkProxy.logHubEvent(eventSinkHubEvent);
eventEmitter.record(eventSinkHubEvent);
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLogger method logErrorEvent.
private void logErrorEvent(final Map<EventDetailsKey, String> details, final SessionId sessionId) {
final EventSinkHubEvent eventSinkHubEvent = new EventSinkHubEvent(serviceInfo, sessionId, EventSinkHubEventConstants.EventTypes.ERROR_EVENT, details);
eventSinkProxy.logHubEvent(eventSinkHubEvent);
eventEmitter.record(eventSinkHubEvent);
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class AwaitingCycle3DataStateControllerTest method cycle3dataInputCancelledFromFrontEnd_shouldLogCancellation.
@Test
public void cycle3dataInputCancelledFromFrontEnd_shouldLogCancellation() throws Exception {
final String requestId = "requestId";
final SessionId sessionId = aSessionId().build();
final AwaitingCycle3DataStateController awaitingCycle3DataStateController = setUpAwaitingCycle3DataStateController(requestId, sessionId);
awaitingCycle3DataStateController.handleCancellation();
ArgumentCaptor<EventSinkHubEvent> argumentCaptor = ArgumentCaptor.forClass(EventSinkHubEvent.class);
verify(eventSinkProxy, atLeastOnce()).logHubEvent(argumentCaptor.capture());
Condition<EventSinkHubEvent> combinedConditions = AllOf.allOf(hasSessionId(sessionId), hasDetail(EventDetailsKey.session_event_type, CYCLE3_CANCEL), hasDetail(EventDetailsKey.request_id, requestId));
assertThat(argumentCaptor.getAllValues()).haveAtLeast(1, combinedConditions);
}
Aggregations