use of com.infiniteautomation.mango.spring.service.AuditEventService in project ma-core-public by infiniteautomation.
the class PublisherAuditTest method getAuditEvents.
protected List<AuditEventInstanceVO> getAuditEvents(String typeName, int objectId) {
Audit auditTable = Audit.AUDIT;
Condition conditions = DSL.and(auditTable.typeName.eq(typeName), auditTable.objectId.eq(objectId));
ConditionSortLimit c = new ConditionSortLimit(conditions, Collections.singletonList(auditTable.id.asc()), null, null);
List<AuditEventInstanceVO> events = new ArrayList<>();
AuditEventService service = Common.getBean(AuditEventService.class);
// Since these are raised in the background processing thread they may have not yet fired
int retries = 4;
while (retries > 0) {
events.clear();
service.customizedQuery(c, events::add);
if (events.size() == 3) {
break;
}
retries--;
try {
Thread.sleep(500);
} catch (InterruptedException ignored) {
}
}
return events;
}
Aggregations