Package com.axelor.auth.events.job
Class AuthenticationEventPurgeJob
java.lang.Object
com.axelor.auth.events.job.AuthenticationEventPurgeJob
- All Implemented Interfaces:
Job
Job to delete the
AuthenticationEvent older than the retention period.
The retention period is defined in days by the "auth.events.retention" setting (defaults to 180). A value of zero or less keeps all events.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault number of days authentication events are kept. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(JobExecutionContext context) longDeletes the authentication events created before the given date.longDeletes the authentication events older than the retention period.
-
Field Details
-
DEFAULT_RETENTION_DAYS
public static final int DEFAULT_RETENTION_DAYSDefault number of days authentication events are kept.- See Also:
-
-
Constructor Details
-
AuthenticationEventPurgeJob
public AuthenticationEventPurgeJob()
-
-
Method Details
-
execute
- Specified by:
executein interfaceJob- Throws:
JobExecutionException
-
purgeExpiredEvents
public long purgeExpiredEvents()Deletes the authentication events older than the retention period.- Returns:
- the number of deleted events
-
purgeEventsBefore
Deletes the authentication events created before the given date.Events are deleted in batches, each in its own transaction, to avoid long-running transactions and locks on large tables.
- Parameters:
date- the date before which events are deleted- Returns:
- the number of deleted events
-