Search in sources :

Example 1 with AuditService

use of com.evolveum.midpoint.audit.api.AuditService in project midpoint by Evolveum.

the class AuditServiceProxy method countObjects.

@Override
public long countObjects(String query, Map<String, Object> params) {
    long count = 0;
    for (AuditService service : services) {
        if (service.supportsRetrieval()) {
            long c = service.countObjects(query, params);
            count += c;
        }
    }
    return count;
}
Also used : AuditService(com.evolveum.midpoint.audit.api.AuditService)

Example 2 with AuditService

use of com.evolveum.midpoint.audit.api.AuditService in project midpoint by Evolveum.

the class AuditFactory method getAuditService.

public AuditService getAuditService() {
    if (auditService == null) {
        AuditServiceProxy proxy = new AuditServiceProxy();
        for (AuditServiceFactory factory : serviceFactories) {
            try {
                AuditService service = factory.getAuditService();
                //todo check this autowiring (check logs) how it's done
                applicationContext.getAutowireCapableBeanFactory().autowireBean(service);
                proxy.registerService(service);
            } catch (Exception ex) {
                LoggingUtils.logException(LOGGER, "Couldn't get audit service from factory '{}'", ex, factory);
                throw new SystemException(ex.getMessage(), ex);
            }
        }
        auditService = proxy;
    }
    return auditService;
}
Also used : SystemException(com.evolveum.midpoint.util.exception.SystemException) AuditServiceFactory(com.evolveum.midpoint.audit.api.AuditServiceFactory) AuditService(com.evolveum.midpoint.audit.api.AuditService) BeansException(org.springframework.beans.BeansException) SystemException(com.evolveum.midpoint.util.exception.SystemException)

Example 3 with AuditService

use of com.evolveum.midpoint.audit.api.AuditService in project midpoint by Evolveum.

the class AuditServiceProxy method cleanupAudit.

@Override
public void cleanupAudit(CleanupPolicyType policy, OperationResult parentResult) {
    Validate.notNull(policy, "Cleanup policy must not be null.");
    Validate.notNull(parentResult, "Operation result must not be null.");
    for (AuditService service : services) {
        service.cleanupAudit(policy, parentResult);
    }
}
Also used : AuditService(com.evolveum.midpoint.audit.api.AuditService)

Example 4 with AuditService

use of com.evolveum.midpoint.audit.api.AuditService in project midpoint by Evolveum.

the class AuditServiceProxy method audit.

@Override
public void audit(AuditEventRecord record, Task task) {
    if (services.isEmpty()) {
        LOGGER.warn("Audit event will not be recorded. No audit services registered.");
        return;
    }
    assertCorrectness(record, task);
    completeRecord(record, task);
    for (AuditService service : services) {
        service.audit(record, task);
    }
}
Also used : AuditService(com.evolveum.midpoint.audit.api.AuditService)

Aggregations

AuditService (com.evolveum.midpoint.audit.api.AuditService)4 AuditServiceFactory (com.evolveum.midpoint.audit.api.AuditServiceFactory)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 BeansException (org.springframework.beans.BeansException)1