Package org.xwiki.mail.script
Class ScriptMailResult
- java.lang.Object
-
- org.xwiki.mail.script.ScriptMailResult
-
- All Implemented Interfaces:
MailResult
public class ScriptMailResult extends Object implements MailResult
Implementation used by the Mail Sender Script Service. It wraps the JavaMailResult
class to add a newgetStatusResult()
method since in the Scripting API theMailListener
is passed as a hint and thus the user cannot callMailListener.getMailStatusResult()
on it.- Since:
- 6.4M3
- Version:
- $Id: a6fbf19dee354b17d2c57d7c453773c27bdcb79a $
-
-
Constructor Summary
Constructors Constructor Description ScriptMailResult(MailResult wrappedMailResult, MailStatusResult mailStatusResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getBatchId()
MailStatusResult
getStatusResult()
boolean
isProcessed()
Deprecated.since 7.1M2 useMailStatusResult.isProcessed()
instead.void
waitTillProcessed(long timeout)
Deprecated.
-
-
-
Constructor Detail
-
ScriptMailResult
public ScriptMailResult(MailResult wrappedMailResult, MailStatusResult mailStatusResult)
- Parameters:
wrappedMailResult
- theMailResult
instance to wrapmailStatusResult
- seegetStatusResult()
-
-
Method Detail
-
getStatusResult
public MailStatusResult getStatusResult()
- Returns:
- the
MailListener
'sMailStatusResult
object which is useful for script users to get the status of each mail from the batch
-
getBatchId
public String getBatchId()
- Specified by:
getBatchId
in interfaceMailResult
-
waitTillProcessed
@Deprecated(since="7.1M2") public void waitTillProcessed(long timeout)
Deprecated.useMailStatusResult.waitTillProcessed(long)
. Kept to not break script backward compatibilityWait till all messages on the sending queue have been sent (for this batch) before returning.- Parameters:
timeout
- the maximum amount of time to wait in milliseconds- Since:
- 6.4
-
isProcessed
@Deprecated public boolean isProcessed()
Deprecated.since 7.1M2 useMailStatusResult.isProcessed()
instead. Kept to not break script backward compatibility- Returns:
- true if all the mails from this batch have been processed (sent successfully or not) or false otherwise
- Since:
- 6.4RC1
-
-