use of org.apereo.cas.support.events.AbstractCasEvent in project cas by apereo.
the class DefaultCasEventListener method prepareCasEvent.
private CasEvent prepareCasEvent(final AbstractCasEvent event) {
final CasEvent dto = new CasEvent();
dto.setType(event.getClass().getCanonicalName());
dto.putTimestamp(event.getTimestamp());
dto.putCreationTime(DateTimeUtils.zonedDateTimeOf(event.getTimestamp()));
final ClientInfo clientInfo = ClientInfoHolder.getClientInfo();
dto.putClientIpAddress(clientInfo.getClientIpAddress());
dto.putServerIpAddress(clientInfo.getServerIpAddress());
dto.putAgent(WebUtils.getHttpServletRequestUserAgent());
final GeoLocationRequest location = WebUtils.getHttpServletRequestGeoLocation();
dto.putGeoLocation(location);
return dto;
}
Aggregations