Class AuditLogDao


  • public class AuditLogDao
    extends AbstractDao
    Provides a DAO for the AuditLog entity.
    See Also:
    AuditLog
    • Constructor Detail

      • AuditLogDao

        public AuditLogDao()
    • Method Detail

      • getAuditLogList

        public List<AuditLog> getAuditLogList​(String clientId,
                                              String changedBy,
                                              String message,
                                              String entityName,
                                              String entityId,
                                              Date startDate,
                                              Date endDate,
                                              String sortBy,
                                              boolean ascending,
                                              int pageSize)
        Return a list of audit log records matching the search criteria
        Parameters:
        clientId - the client OID (optional)
        changedBy - a substring of the "Changed By" attribute (optional)
        message - a substring of the audit message (optional)
        entityName - the name of the audited entity, e.g. "Form" (optional)
        entityId - the entity OID (optional)
        startDate - the lower bound of the date range to search (optional)
        endDate - the upper bound of the date range to search (optional)
        sortBy - the column to sort by (optional)
        ascending - whether to sort ascending
        pageSize - the page size to be used in the query
        Returns:
        the list of matching audit log records
      • getAuditLogList

        public List<AuditLog> getAuditLogList​(String clientId,
                                              String changedBy,
                                              String message,
                                              String entityName,
                                              String entityId,
                                              Date startDate,
                                              Date endDate,
                                              String sortBy,
                                              boolean ascending,
                                              int pageSize,
                                              int fetchLimit)
        Return a list of audit log records matching the search criteria
        Parameters:
        clientId - the client OID (optional)
        changedBy - a substring of the "Changed By" attribute (optional)
        message - a substring of the audit message (optional)
        entityName - the name of the audited entity, e.g. "Form" (optional)
        entityId - the entity OID (optional)
        startDate - the lower bound of the date range to search (optional)
        endDate - the upper bound of the date range to search (optional)
        sortBy - the column to sort by (optional)
        ascending - whether to sort ascending
        pageSize - the page size to be used in the query
        fetchLimit - the query fetch limit
        Returns:
        the list of matching audit log records
        Since:
        4.3.0
      • getAuditLogList

        public List<AuditLog> getAuditLogList​(String clientId,
                                              String changedBy,
                                              String operation,
                                              String message,
                                              String entityName,
                                              String entityId,
                                              Date startDate,
                                              Date endDate,
                                              int pageSize,
                                              int fetchLimit)
        Return a list of audit log records matching the search criteria
        Parameters:
        clientId - the client OID (optional)
        changedBy - a substring of the "Changed By" attribute (optional)
        operation - type of Operation to filter by (optional) @since 17.10.2
        message - a substring of the audit message (optional)
        entityName - the name of the audited entity, e.g. "Form" (optional)
        entityId - the entity OID (optional)
        startDate - the lower bound of the date range to search (optional)
        endDate - the upper bound of the date range to search (optional)
        pageSize - the page size to be used in the query
        fetchLimit - the query fetch limit
        Returns:
        the list of matching audit log records
        Since:
        4.3.3
      • purgeAuditLog

        public int purgeAuditLog​(int maxAgeDays,
                                 int fetchLimit,
                                 long maxTimeMs)
        Purge audit log records older than a specified number of days
        Parameters:
        maxAgeDays - The age in days above which records will be deleted. If this value is negative or equal to 0, no records will be purged.
        fetchLimit - the maximum number of records to delete (only used if > 0)
        maxTimeMs - the maximum time that can be used to purge records
        Returns:
        the number of records that were deleted
      • iterateOverFullAuditLog

        public void iterateOverFullAuditLog​(org.apache.cayenne.ResultIteratorCallback<AuditLog> op)
        Iterates over the FULL audit log, sorted ascending by audit datetime, applying provided callback.
        Parameters:
        op - an operation to be invoked on each object during iteration.
        Since:
        19.05.0