public class AuditServiceImpl extends Object implements AuditService
AuditService.AuditCSVWriter, AuditService.AuditRecordFinder, AuditService.Validator
Constructor and Description |
---|
AuditServiceImpl(AuditManager auditManager,
AuditRecordFactory recordFactory,
AuditRecordEntityFactory recordEntityFactory,
PaginationService paginationService,
UserAccessor userAccessor,
PermissionManager permissionManager,
SettingsManager settingsManager,
com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager,
I18NBeanFactory i18NBeanFactory) |
Modifier and Type | Method and Description |
---|---|
void |
deleteRecords(Instant before)
Clean up all old audit records from before a certain time
|
AuditService.AuditCSVWriter |
exportCSV() |
AuditService.AuditRecordFinder |
getRecords(Instant startDate,
Instant endDate)
Retrieve audit records from the system via an
AuditService.AuditRecordFinder instance. |
RetentionPeriod |
getRetentionPeriod() |
RetentionPeriod |
setRetentionPeriod(RetentionPeriod retentionPeriod)
Set the configured retention period for audit records.
|
AuditRecord |
storeRecord(AuditRecord record)
Persist the given
AuditRecord . |
AuditService.Validator |
validator() |
public AuditServiceImpl(AuditManager auditManager, AuditRecordFactory recordFactory, AuditRecordEntityFactory recordEntityFactory, PaginationService paginationService, UserAccessor userAccessor, PermissionManager permissionManager, SettingsManager settingsManager, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager, I18NBeanFactory i18NBeanFactory)
public AuditRecord storeRecord(AuditRecord record) throws ServiceException
AuditService
AuditRecord
. The sysadmin field will be set based on the current user's privileges
before storing the record. Records will be validated using AuditService.Validator.validateCreate(AuditRecord)
storeRecord
in interface AuditService
record
- The record to storeServiceException
- if the record is invalidpublic AuditService.AuditRecordFinder getRecords(Instant startDate, Instant endDate)
AuditService
AuditService.AuditRecordFinder
instance.getRecords
in interface AuditService
startDate
- The earliest date to fetch records from. Null indicates no limit.endDate
- The latest date to fetch records from. Null indicates no limit.public RetentionPeriod getRetentionPeriod()
getRetentionPeriod
in interface AuditService
public RetentionPeriod setRetentionPeriod(RetentionPeriod retentionPeriod)
AuditService
setRetentionPeriod
in interface AuditService
retentionPeriod
- the period to setpublic void deleteRecords(Instant before)
AuditService
deleteRecords
in interface AuditService
public AuditService.Validator validator()
validator
in interface AuditService
public AuditService.AuditCSVWriter exportCSV()
exportCSV
in interface AuditService
Copyright © 2003–2019 Atlassian. All rights reserved.