public class CompositeMailListener extends Object implements MailListener
MailListener
.Constructor and Description |
---|
CompositeMailListener(MailListener mainListener,
MailListener... listeners) |
Modifier and Type | Method and Description |
---|---|
MailStatusResult |
getMailStatusResult() |
void |
onPrepareBegin(String batchId,
Map<String,Object> parameters)
Called when the preparation phase begins.
|
void |
onPrepareEnd(Map<String,Object> parameters)
Called when the preparation phase is finished.
|
void |
onPrepareFatalError(Exception exception,
Map<String,Object> parameters)
Called when the preparation phase has encounter a fatal error.
|
void |
onPrepareMessageError(ExtendedMimeMessage message,
Exception e,
Map<String,Object> parameters)
Called when a mail has failed to be prepared.
|
void |
onPrepareMessageSuccess(ExtendedMimeMessage message,
Map<String,Object> parameters)
Called when a mail has been prepared with success.
|
void |
onSendMessageError(ExtendedMimeMessage message,
Exception exception,
Map<String,Object> parameters)
Called when a mail has failed to be sent.
|
void |
onSendMessageFatalError(String uniqueMessageId,
Exception exception,
Map<String,Object> parameters)
Called when a message could not be retrieve for sending.
|
void |
onSendMessageSuccess(ExtendedMimeMessage message,
Map<String,Object> parameters)
Called when a mail has been sent successfully.
|
public CompositeMailListener(MailListener mainListener, MailListener... listeners)
mainListener
- the main listener used for getMailStatusResult()
listeners
- the other listeners to notifypublic void onPrepareBegin(String batchId, Map<String,Object> parameters)
MailListener
onPrepareBegin
in interface MailListener
batchId
- identifier of the batch being preparedparameters
- some parameters specifying addition context datapublic void onPrepareMessageSuccess(ExtendedMimeMessage message, Map<String,Object> parameters)
MailListener
onPrepareMessageSuccess
in interface MailListener
message
- the message to be sentparameters
- some parameters specifying addition context datapublic void onPrepareMessageError(ExtendedMimeMessage message, Exception e, Map<String,Object> parameters)
MailListener
onPrepareMessageError
in interface MailListener
message
- the message that was tried to be preparede
- the exception explaining why the message couldn't be sentparameters
- some parameters specifying addition context datapublic void onPrepareFatalError(Exception exception, Map<String,Object> parameters)
MailListener
onPrepareFatalError
in interface MailListener
exception
- the exception explaining why messages couldn't be preparedparameters
- some parameters specifying addition context datapublic void onPrepareEnd(Map<String,Object> parameters)
MailListener
onPrepareEnd
in interface MailListener
parameters
- some parameters specifying addition context datapublic void onSendMessageSuccess(ExtendedMimeMessage message, Map<String,Object> parameters)
MailListener
onSendMessageSuccess
in interface MailListener
message
- the message sentparameters
- some parameters specifying addition context datapublic void onSendMessageError(ExtendedMimeMessage message, Exception exception, Map<String,Object> parameters)
MailListener
onSendMessageError
in interface MailListener
message
- the message that was tried to be sentexception
- the exception explaining why the message couldn't be sentparameters
- some parameters specifying addition context datapublic void onSendMessageFatalError(String uniqueMessageId, Exception exception, Map<String,Object> parameters)
MailListener
onSendMessageFatalError
in interface MailListener
uniqueMessageId
- the unique message identifier that was tried to be load for sendingexception
- the exception explaining why the message couldn't be sentparameters
- some parameters specifying addition context datapublic MailStatusResult getMailStatusResult()
getMailStatusResult
in interface MailListener
MailStatusResult.waitTillProcessed(long)
or MailStatusResult.isProcessed()
to ensure that all mails have been processedCopyright © 2004–2022 XWiki. All rights reserved.