Class EventLogDao


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

      • EventLogDao

        public EventLogDao()
    • Method Detail

      • getEventLogList

        public List<EventLog> getEventLogList​(String eventId,
                                              String type,
                                              String messageFilter,
                                              String message,
                                              String submissionId,
                                              Date startDate,
                                              Date endDate,
                                              String sortBy,
                                              boolean ascending,
                                              int pageSize)
        Return a list of event log records matching the specified search criteria.
        Parameters:
        eventId - the OID of the event (optional)
        type - the event type (optional)
        messageFilter - the message filter
        message - a substring of the event message (optional)
        submissionId - the OID of the submission associated with the event (optional)
        startDate - the lower bound on the event time (optional)
        endDate - the upper bound on the event time (optional)
        sortBy - the attribute to sort by (optional, defaults to event time if not set)
        ascending - whether to sort in ascending order (applies only if sortBy is set)
        pageSize - the page size to use in the query
        Returns:
        the list of matching event log records
      • getEventLogList

        public List<EventLog> getEventLogList​(String eventId,
                                              String type,
                                              String messageFilter,
                                              String message,
                                              String submissionId,
                                              String submissionFilter,
                                              Date startDate,
                                              Date endDate,
                                              String sortBy,
                                              boolean ascending,
                                              int pageSize,
                                              int fetchLimit)
        Return a list of event log records matching the specified search criteria.
        Parameters:
        eventId - the OID of the event (optional)
        type - the event type (optional)
        messageFilter - the message filter
        message - a substring of the event message (optional)
        submissionId - the OID of the submission associated with the event (optional)
        submissionFilter - include submissions filters [ "" | "Include" | "Exclude" ]
        startDate - the lower bound on the event time (optional)
        endDate - the upper bound on the event time (optional)
        sortBy - the attribute to sort by (optional, defaults to event time if not set)
        ascending - whether to sort in ascending order (applies only if sortBy is set)
        pageSize - the page size to use in the query
        fetchLimit - the query fetch limit
        Returns:
        the list of matching event log records
        Since:
        4.3.0
      • getEventLogList

        public List<EventLog> getEventLogList​(Long clientId,
                                              String eventId,
                                              String type,
                                              String messageFilter,
                                              String message,
                                              String submissionId,
                                              String submissionFilter,
                                              Date startDate,
                                              Date endDate,
                                              String sortBy,
                                              boolean ascending,
                                              int pageSize,
                                              int fetchLimit)
        Return a list of event log records matching the specified search criteria.
        Parameters:
        clientId - the OID of the client (optional)
        eventId - the OID of the event (optional)
        type - the event type (optional)
        messageFilter - the message filter
        message - a substring of the event message (optional)
        submissionId - the OID of the submission associated with the event (optional)
        submissionFilter - include submissions filters [ "" | "Include" | "Exclude" ]
        startDate - the lower bound on the event time (optional)
        endDate - the upper bound on the event time (optional)
        sortBy - the attribute to sort by (optional, defaults to event time if not set)
        ascending - whether to sort in ascending order (applies only if sortBy is set)
        pageSize - the page size to use in the query
        fetchLimit - the query fetch limit
        Returns:
        the list of matching event log records
        Since:
        19.11.3
      • purgeEventLog

        public int purgeEventLog​(int maxAgeDays,
                                 int fetchLimit,
                                 long maxTimeMs)
        Delete event 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
      • getSubmissionEvents

        public List<EventLog> getSubmissionEvents​(Object submissionId)
        Return the list of event log entries associated with a submission (note: the query uses the generic fetch limit and is thus used in lieu of submission.getEvents() for performance reasons)
        Parameters:
        submissionId - the OID of a valid submission
        Returns:
        the list of event log entries for the submission
      • hasLoggedRecentEvent

        public boolean hasLoggedRecentEvent​(String type,
                                            String message,
                                            int periodMins)
        Return true if an event of the given type and message has been logged with the specified period.
        Parameters:
        type - the event type
        message - the event message
        periodMins - the period in minutes
        Returns:
        true if an event of the given type and message has been logged with the specified period
        Since:
        4.1.3