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;
}
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;
}
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);
}
}
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);
}
}
Aggregations