Package com.avoka.fc.core.dao
Class EmailQueueDao
java.lang.Object
com.avoka.core.dao.BaseDao
com.avoka.fc.core.dao.AbstractDao
com.avoka.fc.core.dao.EmailQueueDao
Provides a DAO for the EmailQueue entity.
- See Also:
-
Field Summary
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetEmailQueueList
(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 criteriagetEmailQueueList
(String keyword, String emailStatus, String portalId, Date startDate, Date endDate, int pageSize) Return a list of email queue items matching the specified search criteriagetEmailQueueListForFloodDetection
(String fromAddress, String toAddress, String subject) Return a list of email queue items matching the specified search criteria to protect against email floodingReturn the list of email queue items that need to be sent, sorted descending by prioritygetObjectForPK
(Object object) Return the email queue item with the specified OIDboolean
Check the if user has exceeded the email send thresholdvoid
markReceiptEmailsAsReady
(Submission submission) Mark all user receipt emails related to this submission as ready (only if they are currently not ready)int
purgeEmailQueue
(int maxAgeDays, int fetchLimit, long maxTimeMs) Purge email queue.void
resetEmailStatus
(EmailQueue emailQueueItem) Reset an email queue item to status ready.Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
Constructor Details
-
EmailQueueDao
public EmailQueueDao()
-
-
Method Details
-
getObjectForPK
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 keywordemailStatus
- 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 keywordemailStatus
- 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
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 addresstoAddress
- to addresssubject
- email subject- Returns:
- the list of matching email queue items
- Since:
- 22.4.0
-
resetEmailStatus
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 daysfetchLimit
- 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
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
-