Search in sources :

Example 1 with DefaultMailResult

use of org.xwiki.mail.internal.DefaultMailResult in project xwiki-platform by xwiki.

the class MailStorageScriptService method resendAsynchronously.

/**
 * Resend the serialized MimeMessage asynchronously.
 *
 * @param batchId the name of the directory that contains serialized MimeMessage
 * @param uniqueMessageId the unique id of the serialized MimeMessage
 * @return the result and status of the send batch; null if an error occurred when getting the message from the
 *         store
 * @since 9.3RC1
 */
@Unstable
public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) {
    try {
        MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId);
        ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult);
        return scriptMailResult;
    } catch (MailStoreException e) {
        // Save the exception for reporting through the script services's getLastError() API
        setError(e);
        return null;
    }
}
Also used : MailStoreException(org.xwiki.mail.MailStoreException) MailStatusResult(org.xwiki.mail.MailStatusResult) DefaultMailResult(org.xwiki.mail.internal.DefaultMailResult) Unstable(org.xwiki.stability.Unstable)

Aggregations

MailStatusResult (org.xwiki.mail.MailStatusResult)1 MailStoreException (org.xwiki.mail.MailStoreException)1 DefaultMailResult (org.xwiki.mail.internal.DefaultMailResult)1 Unstable (org.xwiki.stability.Unstable)1