Package org.craftercms.commons.audit
Class AuditReaper
java.lang.Object
org.craftercms.commons.audit.AuditReaper
Audit Reaper Service. this class is meant to be run periodically.
- Author:
- Carlos Ortiz.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuditService<? extends AuditModel> Audit Service implementation.protected intMaximum days to keep in the log. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidscythe()Search all logs to be deleted and send there id's to the audit service to be deleted.voidsetAuditService(AuditService<?> auditService) voidsetMaxAuditAllowedDays(int maxAuditAllowedDays)
-
Field Details
-
auditService
Audit Service implementation. -
maxAuditAllowedDays
protected int maxAuditAllowedDaysMaximum days to keep in the log.
-
-
Constructor Details
-
AuditReaper
public AuditReaper()
-
-
Method Details
-
scythe
public void scythe()Search all logs to be deleted and send there id's to the audit service to be deleted.
If maximum days is set to -1 nothing will deleted, 0 it delete all audits daily.
-
setAuditService
-
setMaxAuditAllowedDays
public void setMaxAuditAllowedDays(int maxAuditAllowedDays)
-