Package org.xwiki.mail
Class MailStatus
- java.lang.Object
-
- org.xwiki.mail.MailStatus
-
public class MailStatus extends Object
Contains information about a mail (when it was sent, its status, etc).- Since:
- 6.4M3
- Version:
- $Id: 0589283b87376e488ee75b90eff2b198457afa16 $
-
-
Constructor Summary
Constructors Constructor Description MailStatus()
Default constructor used by Hibernate to load an instance from the Database.MailStatus(String batchId, ExtendedMimeMessage message, MailState state)
Constructor initializing the MailStatus with mandatory fields (message id, batch id and recipients are extracted from the passed message, the date is set as now and the state is passed).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBatchId()
Used by Hibernate to save that property to the database.Date
getDate()
Used by Hibernate to save that property to the database.String
getErrorDescription()
Used by Hibernate to save that property to the database.String
getErrorSummary()
Used by Hibernate to save that property to the database.String
getMessageId()
String
getRecipients()
Used by Hibernate to save that property to the database (hence the String).String
getState()
Note: the returned value is a String and notMailState
to allow Hibernate to save that property to the database.String
getType()
Used by Hibernate to save that property to the database.String
getWiki()
Used by Hibernate to save that property to the database.void
setBatchId(String batchId)
Used by Hibernate to load that property from the database.void
setDate(Date date)
Used by Hibernate to load that property from the database.void
setError(Exception exception)
void
setErrorDescription(String errorDescription)
Used by Hibernate to load that property from the database.void
setErrorSummary(String errorSummary)
Used by Hibernate to load that property from the database.void
setMessageId(String messageId)
void
setRecipients(String recipients)
Used by Hibernate to load that property from the database (hence the reason why it's a String).void
setState(String state)
Used by Hibernate to load that property from the database.void
setState(MailState state)
void
setType(String type)
Used by Hibernate to load that property from the database.void
setWiki(String wiki)
Used by Hibernate to load that property from the database.String
toString()
-
-
-
Constructor Detail
-
MailStatus
public MailStatus()
Default constructor used by Hibernate to load an instance from the Database.
-
MailStatus
public MailStatus(String batchId, ExtendedMimeMessage message, MailState state)
Constructor initializing the MailStatus with mandatory fields (message id, batch id and recipients are extracted from the passed message, the date is set as now and the state is passed). Also sets the Type if set in the passed message.- Parameters:
batchId
- the identifier of the batch sending the messagemessage
- the message for which to construct a statusstate
- the state of the referenced mail (ready, failed to send, success)- Since:
- 7.4.1
-
-
Method Detail
-
getMessageId
public String getMessageId()
- Returns:
- the unique message ID used for identifying the mime message matching this status. Between XWiki 7.1rc1
and 7.4, this identifier is equivalent to the message-id header, but you should not rely on this fact. Since
XWiki 7.4.1, this value is equivalent to
ExtendedMimeMessage.getUniqueMessageId()
.
-
setMessageId
public void setMessageId(String messageId)
- Parameters:
messageId
- seegetMessageId()
-
getState
public String getState()
Note: the returned value is a String and notMailState
to allow Hibernate to save that property to the database.- Returns:
- the state of the mail: ready to be sent, sent successfully, failed to be sent
- See Also:
MailState
-
setState
public void setState(MailState state)
- Parameters:
state
- seegetState()
-
setState
public void setState(String state)
Used by Hibernate to load that property from the database.- Parameters:
state
- seegetState()
-
getBatchId
public String getBatchId()
Used by Hibernate to save that property to the database.- Returns:
- the ID of the batch mail sender
-
setBatchId
public void setBatchId(String batchId)
Used by Hibernate to load that property from the database.- Parameters:
batchId
- the ID of the batch mail sender
-
getDate
public Date getDate()
Used by Hibernate to save that property to the database.- Returns:
- the date of status of mail
-
setDate
public void setDate(Date date)
Used by Hibernate to load that property from the database.- Parameters:
date
- of status of mail
-
getRecipients
public String getRecipients()
Used by Hibernate to save that property to the database (hence the String).- Returns:
- the comma-separated list of email addresses to which the mail was addressed to
-
setRecipients
public void setRecipients(String recipients)
Used by Hibernate to load that property from the database (hence the reason why it's a String).- Parameters:
recipients
- seegetRecipients()
-
getType
public String getType()
Used by Hibernate to save that property to the database.- Returns:
- the type of batch mail (Watchlist, news ...)
-
setType
public void setType(String type)
Used by Hibernate to load that property from the database.- Parameters:
type
- of batch mail (Watchlist, news ...)
-
getErrorSummary
public String getErrorSummary()
Used by Hibernate to save that property to the database.- Returns:
- the error message summary when the mail has failed to be sent
-
getErrorDescription
public String getErrorDescription()
Used by Hibernate to save that property to the database.- Returns:
- the error message description (the full stack trace for example) when the mail has failed to be sent
-
setErrorSummary
public void setErrorSummary(String errorSummary)
Used by Hibernate to load that property from the database.- Parameters:
errorSummary
- seegetErrorSummary()
-
setErrorDescription
public void setErrorDescription(String errorDescription)
Used by Hibernate to load that property from the database.- Parameters:
errorDescription
- seegetErrorDescription()
-
setError
public void setError(Exception exception)
- Parameters:
exception
- the exception that was encountered during sending mail
-
getWiki
public String getWiki()
Used by Hibernate to save that property to the database.- Returns:
- the wiki in which the message is trying to be sent (can be null, in which case it means the main wiki)
-
setWiki
public void setWiki(String wiki)
Used by Hibernate to load that property from the database.- Parameters:
wiki
- seegetWiki()
-
-