public class OutgoingMailHelper extends Object
Constructor and Description |
---|
OutgoingMailHelper(Backdoor backdoor) |
Modifier and Type | Method and Description |
---|---|
void |
clearOutgoingMailQueue() |
List<javax.mail.internet.MimeMessage> |
filterMessages(Collection<javax.mail.internet.MimeMessage> messages,
java.util.function.Predicate<javax.mail.internet.MimeMessage> predicate) |
List<javax.mail.internet.MimeMessage> |
filterMessagesForRecipient(Collection<javax.mail.internet.MimeMessage> messages,
String recipient) |
Collection<javax.mail.internet.MimeMessage> |
flushMailQueueAndWait(int emailCount) |
Collection<javax.mail.internet.MimeMessage> |
flushMailQueueAndWait(long emailCount,
int waitPeriodMillis)
Waits at most
waitPeriodMillis milliseconds for mailCount mails to be present in outgoing mail
queue. |
javax.mail.internet.MimeMessage |
getMessageForAddress(Collection<javax.mail.internet.MimeMessage> messages,
String toAddress) |
String |
getPreviewUrl(javax.mail.internet.MimeMessage message) |
@Inject public OutgoingMailHelper(Backdoor backdoor)
public List<javax.mail.internet.MimeMessage> filterMessages(Collection<javax.mail.internet.MimeMessage> messages, java.util.function.Predicate<javax.mail.internet.MimeMessage> predicate)
public List<javax.mail.internet.MimeMessage> filterMessagesForRecipient(Collection<javax.mail.internet.MimeMessage> messages, String recipient)
public Collection<javax.mail.internet.MimeMessage> flushMailQueueAndWait(int emailCount)
public Collection<javax.mail.internet.MimeMessage> flushMailQueueAndWait(long emailCount, int waitPeriodMillis)
waitPeriodMillis
milliseconds for mailCount
mails to be present in outgoing mail
queue. If condition is not met within requested timeout then ConditionTimeoutException
is thrown. A check
if smtp is configured is performed prior flushing queue.emailCount
- Number of mails in queue to wait for.waitPeriodMillis
- Amount of time to wait for mails to appear in queue.public void clearOutgoingMailQueue()
public String getPreviewUrl(javax.mail.internet.MimeMessage message)
public javax.mail.internet.MimeMessage getMessageForAddress(Collection<javax.mail.internet.MimeMessage> messages, String toAddress) throws javax.mail.MessagingException
javax.mail.MessagingException
Copyright © 2002-2019 Atlassian. All Rights Reserved.