public class AuditServiceImpl extends Object implements InternalAuditService
| Constructor and Description |
|---|
AuditServiceImpl(AuditDao auditDao,
PropertyManager propertyManager,
Clock clock,
AuditLogChangesetPopulator auditLogChangesetPopulator,
AuditLogProperties auditLogSystemProperties,
AuditLogEnabledChecker auditLogEnabledChecker) |
| Modifier and Type | Method and Description |
|---|---|
long |
getAuditLogSize() |
AuditLogConfiguration |
getConfiguration()
Returns current auditing configuration
|
boolean |
isEnabled() |
int |
removeEntriesOlderThan(Instant threshold)
Removes entries created before the given instant
|
int |
removeStaleEntries()
Removes stale entries basing on current configuration
|
void |
saveAudit(AuditLogChangeset changeset)
Persists an audit log changeset.
|
void |
saveAudits(Collection<AuditLogChangeset> changesets)
Persists the given audit log changesets.
|
void |
saveConfiguration(AuditLogConfiguration auditLogConfiguration)
Sets the new configuration for auditing
|
<RESULT> List<RESULT> |
searchAuditLog(AuditLogQuery<RESULT> query)
Queries the audit log.
|
boolean |
shouldAuditEvent()
Allows the caller to determine whether it should attempt to generate audit events.
|
public AuditServiceImpl(AuditDao auditDao, PropertyManager propertyManager, Clock clock, AuditLogChangesetPopulator auditLogChangesetPopulator, AuditLogProperties auditLogSystemProperties, AuditLogEnabledChecker auditLogEnabledChecker)
@Transactional public void saveAudit(AuditLogChangeset changeset)
AuditServicesaveAudit in interface AuditServicechangeset - the changeset that will be persisted@Transactional public void saveAudits(Collection<AuditLogChangeset> changesets)
InternalAuditServicesaveAudits in interface InternalAuditServicechangesets - the changesets that will be persisted@Transactional public <RESULT> List<RESULT> searchAuditLog(AuditLogQuery<RESULT> query)
AuditServiceList of AuditLogChangesets, which match the criteria specified in
the query. The results will be sorted by the timestamp, descending.searchAuditLog in interface AuditServicequery - the search querypublic boolean isEnabled()
isEnabled in interface AuditService@Transactional public int removeStaleEntries()
InternalAuditServiceremoveStaleEntries in interface InternalAuditService@Transactional public int removeEntriesOlderThan(Instant threshold)
InternalAuditServiceremoveEntriesOlderThan in interface InternalAuditService@Transactional public long getAuditLogSize()
getAuditLogSize in interface InternalAuditServicepublic void saveConfiguration(AuditLogConfiguration auditLogConfiguration)
AuditServicesaveConfiguration in interface AuditServiceauditLogConfiguration - new configurationpublic AuditLogConfiguration getConfiguration()
AuditServicegetConfiguration in interface AuditServicepublic boolean shouldAuditEvent()
AuditServiceshouldAuditEvent in interface AuditServiceCopyright © 2023 Atlassian. All rights reserved.