Search in sources :

Example 1 with AbstractCasEvent

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;
}
Also used : AbstractCasEvent(org.apereo.cas.support.events.AbstractCasEvent) CasEvent(org.apereo.cas.support.events.dao.CasEvent) ClientInfo(org.apereo.inspektr.common.web.ClientInfo) GeoLocationRequest(org.apereo.cas.authentication.adaptive.geo.GeoLocationRequest)

Aggregations

GeoLocationRequest (org.apereo.cas.authentication.adaptive.geo.GeoLocationRequest)1 AbstractCasEvent (org.apereo.cas.support.events.AbstractCasEvent)1 CasEvent (org.apereo.cas.support.events.dao.CasEvent)1 ClientInfo (org.apereo.inspektr.common.web.ClientInfo)1