use of org.apereo.inspektr.audit.AuditActionContext in project cas by apereo.
the class InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter method recordThrottle.
@Override
protected void recordThrottle(final HttpServletRequest request) {
if (this.dataSource != null && this.jdbcTemplate != null) {
super.recordThrottle(request);
final String userToUse = constructUsername(request, getUsernameParameter());
final ClientInfo clientInfo = ClientInfoHolder.getClientInfo();
final AuditPointRuntimeInfo auditPointRuntimeInfo = new AuditPointRuntimeInfo() {
private static final long serialVersionUID = 1L;
@Override
public String asString() {
return String.format("%s.recordThrottle()", this.getClass().getName());
}
};
final AuditActionContext context = new AuditActionContext(userToUse, userToUse, INSPEKTR_ACTION, this.applicationCode, DateTimeUtils.dateOf(ZonedDateTime.now(ZoneOffset.UTC)), clientInfo.getClientIpAddress(), clientInfo.getServerIpAddress(), auditPointRuntimeInfo);
this.auditTrailManager.record(context);
} else {
LOGGER.warn("No data source is defined for [{}]. Ignoring audit record-keeping", this.getName());
}
}
Aggregations