List of usage examples for org.springframework.security.authentication.event AbstractAuthenticationEvent getTimestamp
public final long getTimestamp()
From source file:org.opennms.web.springframework.security.SecurityAuthenticationEventOnmsEventBuilder.java
private EventBuilder createEvent(String uei, AbstractAuthenticationEvent authEvent) { EventBuilder builder = new EventBuilder(uei, "OpenNMS.WebUI"); builder.setTime(new Date(authEvent.getTimestamp())); org.springframework.security.core.Authentication auth = authEvent.getAuthentication(); if (auth != null && auth.getName() != null) { builder.addParam("user", WebSecurityUtils.sanitizeString(auth.getName())); }//from ww w . jav a2 s. c o m if (auth != null && auth.getDetails() != null && auth.getDetails() instanceof WebAuthenticationDetails) { WebAuthenticationDetails webDetails = (WebAuthenticationDetails) auth.getDetails(); if (webDetails.getRemoteAddress() != null) { builder.addParam("ip", webDetails.getRemoteAddress()); } } return builder; }