Package com.avoka.fc.core.service.impl
Class EmailQueueServiceImpl
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.impl.EmailQueueServiceImpl
-
- All Implemented Interfaces:
IEmailQueueService
public class EmailQueueServiceImpl extends CayenneService implements IEmailQueueService
Provides an email queue service implementation.- See Also:
EmailQueue
-
-
Constructor Summary
Constructors Constructor Description EmailQueueServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmailQueue
cloneEmailQueue(Long emailQueueId)
Clone an email queue item.boolean
process(EmailQueue emailQueueItem)
Create an email and attempts to send the email.void
validateEmailQueueList(List<EmailQueue> emailList)
Validates that the emails do not reach the threshold (i.e.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Method Detail
-
process
public boolean process(EmailQueue emailQueueItem)
Create an email and attempts to send the email. Note that this method contains database transactions. The method change the email queue status for the EmailQueue item to COMPLETE state after sent the email.- Specified by:
process
in interfaceIEmailQueueService
- Parameters:
emailQueueItem
- the email queue item to send- Returns:
- true if the email is sent successfully
- See Also:
IEmailQueueService.process(com.avoka.fc.core.entity.EmailQueue)
-
cloneEmailQueue
public EmailQueue cloneEmailQueue(Long emailQueueId)
Clone an email queue item. This item status will be set to be Cloned.- Specified by:
cloneEmailQueue
in interfaceIEmailQueueService
- Parameters:
emailQueueId
- the email queue id- Returns:
- the cloned email queue
-
validateEmailQueueList
public void validateEmailQueueList(List<EmailQueue> emailList)
Validates that the emails do not reach the threshold (i.e. flooding an address) where the to, from & subject are the same. This validation will be done on the email queue items that need to be sent in the one call of Email Queue job processing.- Specified by:
validateEmailQueueList
in interfaceIEmailQueueService
- Parameters:
emailList
- of email queue items to validate
-
-