Package org.mapfish.print.config
Class SmtpConfig
java.lang.Object
org.mapfish.print.config.SmtpConfig
- All Implemented Interfaces:
ConfigurationObject
Email sending configuration.
This configuration is needed only if reports are to be sent to the user by email.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBody()Returns the configured body or the default value.getHost()intgetPort()booleanisSsl()booleanvoidThe default email body.voidsetErrorBody(String errorBody) The default email body in case of error.voidsetErrorSubject(String errorSubject) The default email subject in case of error.voidsetFromAddress(String fromAddress) The email address used as "From:" in every email.voidThe SMTP server hostname.voidsetPassword(String password) If auth is needed, the password.voidsetPort(int port) The TCP port of the SMTP server.voidsetSsl(boolean ssl) True for enabling SSL.voidsetStarttls(boolean starttls) True to use STARTTLS.voidsetStorage(ReportStorage storage) The report storage facility to use.voidsetSubject(String subject) The default email subject.voidsetUsername(String username) If auth is needed, the username.voidvalidate(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.
-
Field Details
-
DEFAULT_SUBJECT
The default subject.- See Also:
-
DEFAULT_BODY
The default body.- See Also:
-
DEFAULT_BODY_STORAGE
The default body if there is a storage.- See Also:
-
DEFAULT_ERROR_SUBJECT
The default subject in case of error.- See Also:
-
DEFAULT_ERROR_BODY
The default body in case of error.- See Also:
-
-
Constructor Details
-
SmtpConfig
public SmtpConfig()
-
-
Method Details
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Specified by:
validatein interfaceConfigurationObject- Parameters:
validationErrors- a list to add any detected errors to.configuration- the containing configuration
-
getFromAddress
-
setFromAddress
The email address used as "From:" in every email.- Parameters:
fromAddress- The address
-
getHost
-
setHost
The SMTP server hostname.- Parameters:
host- The host
-
getPort
public int getPort() -
setPort
public void setPort(int port) The TCP port of the SMTP server.- Parameters:
port- The port
-
getUsername
-
setUsername
If auth is needed, the username.- Parameters:
username- The username
-
getPassword
-
setPassword
If auth is needed, the password.- Parameters:
password- The password
-
isStarttls
public boolean isStarttls() -
setStarttls
public void setStarttls(boolean starttls) True to use STARTTLS.- Parameters:
starttls- Whatever
-
isSsl
public boolean isSsl() -
setSsl
public void setSsl(boolean ssl) True for enabling SSL.
Cannot be enabled at the same time asstarttls- Parameters:
ssl- The value
-
getSubject
-
setSubject
The default email subject.
This can be changed by thesmtp.subjectproperty in the request.- Parameters:
subject- The subject
-
getBody
Returns the configured body or the default value. -
setBody
The default email body.
This can be changed by thesmtp.bodyproperty 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.
- Parameters:
body- The body
-
getStorage
-
setStorage
The report storage facility to use.
By default, attaches the report in an email. But, for big files, this is not practical. This can be used to configure a storage.- Parameters:
storage- The storage to use
-
getErrorSubject
-
setErrorSubject
The default email subject in case of error.
This can be changed by thesmtp.errorSubjectproperty in the request.- Parameters:
errorSubject- The subject
-
getErrorBody
-
setErrorBody
The default email body in case of error.
This can be changed by thesmtp.bodyproperty in the request.The error message can be places in the text using a "{message}" marker.
- Parameters:
errorBody- The body
-