Search in sources :

Example 1 with AuditListener

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);
    }
}
Also used : User(org.apache.archiva.redback.users.User) AuditEvent(org.apache.archiva.metadata.model.facets.AuditEvent) AuditListener(org.apache.archiva.repository.events.AuditListener)

Example 2 with AuditListener

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);
    }
}
Also used : AuditEvent(org.apache.archiva.metadata.model.facets.AuditEvent) AuditListener(org.apache.archiva.repository.events.AuditListener)

Example 3 with AuditListener

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);
    }
}
Also used : AuditEvent(org.apache.archiva.metadata.model.facets.AuditEvent) AuditListener(org.apache.archiva.repository.events.AuditListener)

Example 4 with AuditListener

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);
    }
}
Also used : AuditEvent(org.apache.archiva.metadata.model.facets.AuditEvent) AuditListener(org.apache.archiva.repository.events.AuditListener)

Example 5 with AuditListener

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);
    }
}
Also used : AuditInformation(org.apache.archiva.admin.model.AuditInformation) AuditEvent(org.apache.archiva.metadata.model.facets.AuditEvent) AuditListener(org.apache.archiva.repository.events.AuditListener)

Aggregations

AuditEvent (org.apache.archiva.metadata.model.facets.AuditEvent)5 AuditListener (org.apache.archiva.repository.events.AuditListener)5 AuditInformation (org.apache.archiva.admin.model.AuditInformation)1 User (org.apache.archiva.redback.users.User)1