public class SmtpConfig extends java.lang.Object implements ConfigurationObject
This configuration is needed only if reports are to be sent to the user by email.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_BODY
The default body.
|
static java.lang.String |
DEFAULT_BODY_STORAGE
The default body if there is a storage.
|
static java.lang.String |
DEFAULT_ERROR_BODY
The default body in case of error.
|
static java.lang.String |
DEFAULT_ERROR_SUBJECT
The default subject in case of error.
|
static java.lang.String |
DEFAULT_SUBJECT
The default subject.
|
| Constructor and Description |
|---|
SmtpConfig() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBody()
Returns the configured body or the default value.
|
java.lang.String |
getErrorBody() |
java.lang.String |
getErrorSubject() |
java.lang.String |
getFromAddress() |
java.lang.String |
getHost() |
java.lang.String |
getPassword() |
int |
getPort() |
ReportStorage |
getStorage() |
java.lang.String |
getSubject() |
java.lang.String |
getUsername() |
boolean |
isSsl() |
boolean |
isStarttls() |
void |
setBody(java.lang.String body)
The default email body.
|
void |
setErrorBody(java.lang.String errorBody)
The default email body in case of error.
|
void |
setErrorSubject(java.lang.String errorSubject)
The default email subject in case of error.
|
void |
setFromAddress(java.lang.String fromAddress)
The email address used as "From:" in every email.
|
void |
setHost(java.lang.String host)
The SMTP server hostname.
|
void |
setPassword(java.lang.String password)
If auth is needed, the password.
|
void |
setPort(int port)
The TCP port of the SMTP server.
|
void |
setSsl(boolean ssl)
True for enabling SSL.
|
void |
setStarttls(boolean starttls)
True to use STARTTLS.
|
void |
setStorage(ReportStorage storage)
The report storage facility to use.
|
void |
setSubject(java.lang.String subject)
The default email subject.
|
void |
setUsername(java.lang.String username)
If auth is needed, the username.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
public static final java.lang.String DEFAULT_SUBJECT
public static final java.lang.String DEFAULT_BODY
public static final java.lang.String DEFAULT_BODY_STORAGE
public static final java.lang.String DEFAULT_ERROR_SUBJECT
public static final java.lang.String DEFAULT_ERROR_BODY
public void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic java.lang.String getFromAddress()
public void setFromAddress(java.lang.String fromAddress)
fromAddress - The addresspublic java.lang.String getHost()
public void setHost(java.lang.String host)
host - The hostpublic int getPort()
public void setPort(int port)
port - The portpublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username - The usernamepublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - The passwordpublic boolean isStarttls()
public void setStarttls(boolean starttls)
starttls - Whateverpublic boolean isSsl()
public void setSsl(boolean ssl)
starttlsssl - The value@Nonnull public java.lang.String getSubject()
public void setSubject(@Nonnull
java.lang.String subject)
smtp.subject property in the request.subject - The subject@Nonnull public java.lang.String getBody()
public void setBody(java.lang.String body)
smtp.body property in the request.
If you have setup a storage, you must put a "{url}" marker where the URL to fetch the report should be put.
body - The body@Nullable public ReportStorage getStorage()
public void setStorage(ReportStorage storage)
storage - The storage to use@Nonnull public java.lang.String getErrorSubject()
public void setErrorSubject(@Nonnull
java.lang.String errorSubject)
smtp.errorSubject property in the request.errorSubject - The subject@Nonnull public java.lang.String getErrorBody()
public void setErrorBody(@Nonnull
java.lang.String errorBody)
smtp.body property in the request.
The error message can be places in the text using a "{message}" marker.
errorBody - The body