use of org.apache.archiva.repository.events.AuditListener in project archiva by apache.
the class AbstractRepositoryAdmin method triggerAuditEvent.
protected void triggerAuditEvent(String repositoryId, String resource, String action, AuditInformation auditInformation) {
User user = auditInformation == null ? null : auditInformation.getUser();
AuditEvent event = new AuditEvent(repositoryId, user == null ? "null" : user.getUsername(), resource, action);
event.setRemoteIP(auditInformation == null ? "null" : auditInformation.getRemoteAddr());
for (AuditListener listener : getAuditListeners()) {
listener.auditEvent(event);
}
}
use of org.apache.archiva.repository.events.AuditListener in project archiva by apache.
the class ArchivaDavResource method triggerAuditEvent.
private void triggerAuditEvent(String remoteIP, String repositoryId, String resource, String action) {
AuditEvent event = new AuditEvent(repositoryId, principal, resource, action);
event.setRemoteIP(remoteIP);
for (AuditListener listener : auditListeners) {
listener.auditEvent(event);
}
}
use of org.apache.archiva.repository.events.AuditListener in project archiva by apache.
the class ArchivaDavResource method triggerAuditEvent.
private void triggerAuditEvent(DavResource member, String action) throws DavException {
String path = logicalResource + "/" + member.getDisplayName();
ArchivaDavResource resource = checkDavResourceIsArchivaDavResource(member);
AuditEvent auditEvent = new AuditEvent(locator.getRepositoryId(), resource.principal, path, action);
auditEvent.setRemoteIP(resource.remoteAddr);
for (AuditListener listener : auditListeners) {
listener.auditEvent(auditEvent);
}
}
use of org.apache.archiva.repository.events.AuditListener in project archiva by apache.
the class ArchivaDavResourceFactory method triggerAuditEvent.
// TODO: remove?
private void triggerAuditEvent(String remoteIP, String repositoryId, String resource, String action, String principal) {
AuditEvent event = new AuditEvent(repositoryId, principal, resource, action);
event.setRemoteIP(remoteIP);
for (AuditListener listener : auditListeners) {
listener.auditEvent(event);
}
}
use of org.apache.archiva.repository.events.AuditListener 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);
}
}
Aggregations