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)
AuditService
saveAudit
in interface AuditService
changeset
- the changeset that will be persisted@Transactional public void saveAudits(Collection<AuditLogChangeset> changesets)
InternalAuditService
saveAudits
in interface InternalAuditService
changesets
- the changesets that will be persisted@Transactional public <RESULT> List<RESULT> searchAuditLog(AuditLogQuery<RESULT> query)
AuditService
List
of AuditLogChangeset
s, which match the criteria specified in
the query. The results will be sorted by the timestamp, descending.searchAuditLog
in interface AuditService
query
- the search querypublic boolean isEnabled()
isEnabled
in interface AuditService
@Transactional public int removeStaleEntries()
InternalAuditService
removeStaleEntries
in interface InternalAuditService
@Transactional public int removeEntriesOlderThan(Instant threshold)
InternalAuditService
removeEntriesOlderThan
in interface InternalAuditService
@Transactional public long getAuditLogSize()
getAuditLogSize
in interface InternalAuditService
public void saveConfiguration(AuditLogConfiguration auditLogConfiguration)
AuditService
saveConfiguration
in interface AuditService
auditLogConfiguration
- new configurationpublic AuditLogConfiguration getConfiguration()
AuditService
getConfiguration
in interface AuditService
public boolean shouldAuditEvent()
AuditService
shouldAuditEvent
in interface AuditService
Copyright © 2020 Atlassian. All rights reserved.