Class AuditServiceImpl

java.lang.Object
com.atlassian.crowd.manager.audit.AuditServiceImpl
All Implemented Interfaces:
AuditService, InternalAuditService

public class AuditServiceImpl extends Object implements InternalAuditService
  • Constructor Details

  • Method Details

    • saveAudit

      @Transactional public void saveAudit(AuditLogChangeset changeset)
      Description copied from interface: AuditService
      Persists an audit log changeset. The timestamp will be set to the current time. Will not do anything when audit log is disabled.
      Specified by:
      saveAudit in interface AuditService
      Parameters:
      changeset - the changeset that will be persisted
    • saveAudits

      @Transactional public void saveAudits(Collection<AuditLogChangeset> changesets)
      Description copied from interface: InternalAuditService
      Persists the given audit log changesets. Their timestamps will be set to the current time. Will not do anything when audit log is disabled.
      Specified by:
      saveAudits in interface InternalAuditService
      Parameters:
      changesets - the changesets that will be persisted
    • searchAuditLog

      @Transactional public <RESULT> List<RESULT> searchAuditLog(AuditLogQuery<RESULT> query)
      Description copied from interface: AuditService
      Queries the audit log. Returns a List of AuditLogChangesets, which match the criteria specified in the query. The results will be sorted by the timestamp, descending.
      Specified by:
      searchAuditLog in interface AuditService
      Parameters:
      query - the search query
      Returns:
      List of AuditLogEntry matching the query
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface AuditService
      Returns:
      true if the audit log is enabled, false otherwise. A disabled audit log will not persist any new entries.
    • removeStaleEntries

      @Transactional public int removeStaleEntries()
      Description copied from interface: InternalAuditService
      Removes stale entries basing on current configuration
      Specified by:
      removeStaleEntries in interface InternalAuditService
      Returns:
      number of removed entries
    • removeEntriesOlderThan

      @Transactional public int removeEntriesOlderThan(Instant threshold)
      Description copied from interface: InternalAuditService
      Removes entries created before the given instant
      Specified by:
      removeEntriesOlderThan in interface InternalAuditService
      Returns:
      number of removed entries
    • getAuditLogSize

      @Transactional public long getAuditLogSize()
      Specified by:
      getAuditLogSize in interface InternalAuditService
      Returns:
      the amount of changesets in the audit log
    • saveConfiguration

      public void saveConfiguration(AuditLogConfiguration auditLogConfiguration)
      Description copied from interface: AuditService
      Sets the new configuration for auditing
      Specified by:
      saveConfiguration in interface AuditService
      Parameters:
      auditLogConfiguration - new configuration
    • getConfiguration

      public AuditLogConfiguration getConfiguration()
      Description copied from interface: AuditService
      Returns current auditing configuration
      Specified by:
      getConfiguration in interface AuditService
      Returns:
      current configuration
    • shouldAuditEvent

      public boolean shouldAuditEvent()
      Description copied from interface: AuditService
      Allows the caller to determine whether it should attempt to generate audit events. Auditing might be disabled globally, or it might be disabled during specific operations or states (for example during synchronizations).
      Specified by:
      shouldAuditEvent in interface AuditService
      Returns:
      true if calling saveAudit() will persist the event, false otherwise