Class EmailQueueDao


public class EmailQueueDao extends AbstractDao
Provides a DAO for the EmailQueue entity.
See Also:
  • Constructor Details

    • EmailQueueDao

      public EmailQueueDao()
  • Method Details

    • getObjectForPK

      public EmailQueue getObjectForPK(Object object)
      Return the email queue item with the specified OID
      Parameters:
      object - the OID
      Returns:
      the matching email queue item, or null if not found
    • getEmailQueueList

      public List<EmailQueue> getEmailQueueList(String keyword, String emailStatus, String portalId, Date startDate, Date endDate, int pageSize)
      Return a list of email queue items matching the specified search criteria
      Parameters:
      keyword - a search keyword
      emailStatus - the status (optional)
      portalId - the OID of the portal associated with the email queue item (optional)
      startDate - the lower bound on the creation date (optional)
      endDate - the upper bound on the creation date (optional)
      pageSize - the page size to use in the query
      Returns:
      the list of matching email queue items
    • getEmailQueueList

      public List<EmailQueue> getEmailQueueList(Long clientId, String keyword, String emailStatus, String portalId, Date startDate, Date endDate, int pageSize)
      Return a list of email queue items matching the specified search criteria
      Parameters:
      clientId - client id (optional)
      keyword - a search keyword
      emailStatus - the status (optional)
      portalId - the OID of the portal associated with the email queue item (optional)
      startDate - the lower bound on the creation date (optional)
      endDate - the upper bound on the creation date (optional)
      pageSize - the page size to use in the query
      Returns:
      the list of matching email queue items
      Since:
      19.11.3
    • getEmailsToSend

      public List<EmailQueue> getEmailsToSend()
      Return the list of email queue items that need to be sent, sorted descending by priority
      Returns:
      the list of email queue items
    • getEmailQueueListForFloodDetection

      public List<EmailQueue> getEmailQueueListForFloodDetection(String fromAddress, String toAddress, String subject)
      Return a list of email queue items matching the specified search criteria to protect against email flooding
      Parameters:
      fromAddress - from address
      toAddress - to address
      subject - email subject
      Returns:
      the list of matching email queue items
      Since:
      22.4.0
    • resetEmailStatus

      public void resetEmailStatus(EmailQueue emailQueueItem)
      Reset an email queue item to status ready. Also set the number of delivery attempts to 0 so that automatic delivery can recommence.
      Parameters:
      emailQueueItem - the non-null email queue item
    • purgeEmailQueue

      public int purgeEmailQueue(int maxAgeDays, int fetchLimit, long maxTimeMs)
      Purge email queue.
      Parameters:
      maxAgeDays - the max email queue age days
      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
    • markReceiptEmailsAsReady

      public void markReceiptEmailsAsReady(Submission submission)
      Mark all user receipt emails related to this submission as ready (only if they are currently not ready)
      Parameters:
      submission - the submission (required)
    • hasUserExceededEmailSendThreshold

      public boolean hasUserExceededEmailSendThreshold()
      Check the if user has exceeded the email send threshold
      Returns:
      if the user has exceeded the email send threshold
      Since:
      23.4.0