public class AuditServiceImpl extends Object implements InternalAuditService
Modifier and Type | Field and Description |
---|---|
protected AuditDao |
auditDao |
protected Clock |
clock |
protected boolean |
IS_ENABLED |
protected PropertyManager |
propertyManager |
Constructor and Description |
---|
AuditServiceImpl(AuditDao auditDao,
PropertyManager propertyManager,
Clock clock,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
long |
getAuditLogSize() |
AuditLogConfiguration |
getConfiguration()
Returns current auditing configuration
|
boolean |
isEnabled() |
int |
removeStaleEntries()
Removes stale entries basing on current configuration
|
void |
saveAudit(AuditLogChangeset changeset)
Persists an audit log changeset and all of its entries.
|
void |
saveConfiguration(AuditLogConfiguration auditLogConfiguration)
Sets the new configuration for auditing
|
List<AuditLogChangeset> |
searchAuditLog(EntityQuery<AuditLogChangeset> query)
Queries the audit log.
|
protected final AuditDao auditDao
protected final PropertyManager propertyManager
protected final Clock clock
protected final boolean IS_ENABLED
public AuditServiceImpl(AuditDao auditDao, PropertyManager propertyManager, Clock clock, com.atlassian.event.api.EventPublisher eventPublisher)
@Transactional public void saveAudit(AuditLogChangeset changeset)
AuditService
saveAudit
in interface AuditService
changeset
- the changeset that will be persisted@Transactional public List<AuditLogChangeset> searchAuditLog(EntityQuery<AuditLogChangeset> query)
AuditService
List
of AuditLogChangeset
s, which match the criteria specified in
the query. The results will be sorted according to the column and order specified in the query.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 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
Copyright © 2017 Atlassian. All rights reserved.