use of org.apache.archiva.admin.model.AuditInformation in project archiva by apache.
the class AbstractRestService method triggerAuditEvent.
protected void triggerAuditEvent(String repositoryId, String filePath, String action) {
AuditEvent auditEvent = new AuditEvent(repositoryId, getPrincipal(), filePath, action);
AuditInformation auditInformation = getAuditInformation();
auditEvent.setUserId(auditInformation.getUser() == null ? "" : auditInformation.getUser().getUsername());
auditEvent.setRemoteIP(auditInformation.getRemoteAddr());
for (AuditListener auditListener : getAuditListeners()) {
auditListener.auditEvent(auditEvent);
}
}
use of org.apache.archiva.admin.model.AuditInformation in project archiva by apache.
the class AbstractRestService method getAuditInformation.
protected AuditInformation getAuditInformation() {
RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
User user = redbackRequestInformation == null ? null : redbackRequestInformation.getUser();
String remoteAddr = redbackRequestInformation == null ? null : redbackRequestInformation.getRemoteAddr();
return new AuditInformation(user, remoteAddr);
}
Aggregations