Class MailClientService

java.lang.Object
org.europa.together.service.MailClientService

@API(status=STABLE, since="1.0") @Service public final class MailClientService extends Object
Service implementation for the JakartaMailClient.
Since:
1.0
Version:
1.0
Author:
elmar.dott@gmail.com
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the active configuration for the e-mail service and return the result as Map.
    int
    Send a bulk of composed mails to a configured list of recipients.
    void
    Send an composed (single) e-mail which is configured in a Mail data class.
    void
    updateConfiguration(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MailClientService

      @API(status=STABLE, since="1.0") public MailClientService()
      Constructor.
  • Method Details

    • updateConfiguration

      @API(status=STABLE, since="3.0") public void updateConfiguration(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
    • loadConfiguration

      @API(status=STABLE, since="3.0") public Map<String,String> loadConfiguration()
      Get the active configuration for the e-mail service and return the result as Map.
      Returns:
      mailConfiguration as Map
    • sendEmail

      @API(status=STABLE, since="1.0") public void sendEmail(Mail mail) throws jakarta.mail.MessagingException
      Send an composed (single) e-mail which is configured in a Mail data class. An e-mail can be configured as followed:
      Mail mail = new Mail(); mail.setSubject(subject); mail.setMessage(content); mail.addRecipent(mailAdress);
      In the case there are more recipients configured the mail will be only send to the first entry.
      Parameters:
      mail - as MailClient
      Throws:
      jakarta.mail.MessagingException - case of error
    • sendBulkMail

      @API(status=STABLE, since="1.0") public int sendBulkMail(Mail mail) throws jakarta.mail.MessagingException
      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. This two parameters are also part of thw whole configuration and will not set seperatly.
      - wait time: default = -1 (unlimited)
      - bulk mail limiter: default = -1 (unlimited)
      Parameters:
      mail - as MailClient
      Returns:
      sendedEmails as int
      Throws:
      jakarta.mail.MessagingException - case of error