Package org.europa.together.service
Class MailClientService
- java.lang.Object
-
- org.europa.together.service.MailClientService
-
@API(status=STABLE, since="1.0") @Service @FeatureToggle(featureID="CM-0006") public final class MailClientService extends Object
Implementation of the Mail Client Service.- Since:
- 1.0
- Version:
- 1.0
- Author:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description MailClientService()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getDbConfiguration()
Get the Configuration for the E-Mail Service from the Database and return the result as Map.int
sendBulkMail(MailClient mail)
Send a bulk of composed mails to a configured list of recipients.void
sendEmail(MailClient mail)
Send an composed (single) e-mail which is configured in a MailClient.void
updateDatabaseConfiguration(Map<String,String> configurationList)
Allows to update the database configuration for the MailClient by a map of configuration entries.
mailer.host mailer.port mailer.sender mailer.user mailer.password mailer.ssl mailer.tls mailer.debug mailer.count mailer.wait
-
-
-
Method Detail
-
updateDatabaseConfiguration
@API(status=STABLE, since="1.0") @FeatureToggle(featureID="CM-0006.S001") public void updateDatabaseConfiguration(Map<String,String> configurationList)
Allows to update the database configuration for the MailClient by a map of configuration entries.
- mailer.host
- mailer.port
- mailer.sender
- mailer.user
- mailer.password
- mailer.ssl
- mailer.tls
- mailer.debug
- mailer.count
- mailer.wait
- Parameters:
configurationList
- as Map
-
getDbConfiguration
@API(status=STABLE, since="1.1") @FeatureToggle(featureID="CM-0006.S004") public Map<String,String> getDbConfiguration()
Get the Configuration for the E-Mail Service from the Database and return the result as Map.- Returns:
- mailConfiguration as Map
-
sendEmail
@API(status=STABLE, since="1.0") @FeatureToggle(featureID="CM-0006.S002") public void sendEmail(MailClient mail)
Send an composed (single) e-mail which is configured in a MailClient. An E-Mail can be configured as followed:
MailClient mailer = new MailCLientImpl(); mailer.loadConfigurationFromDatabase(); mailer.addRecipent("[email protected]"); mailer.setSubject("TEST MAIL"); mailer.setContent("This ist the testmail content."); mailer.addAttachment("Attachment.pdf");
In the case there are more recipients configured the mail will be only send to the first entry.- Parameters:
mail
- as MailClient
-
sendBulkMail
@API(status=STABLE, since="1.0") @FeatureToggle(featureID="CM-0006.S003") public int sendBulkMail(MailClient mail)
Send a bulk of composed mails to a configured list of recipients. The Bulk Mail supports a special feature, to interrupt the sending after an defined amount of mails fo a configured time (milliseconds) until the next bulk can be send. After the termination the method return th count of the send mails.- Parameters:
mail
- as MailClient- Returns:
- sendedEmails as int
-
-