Class JakartaMailClient

java.lang.Object
org.europa.together.application.JakartaMailClient
All Implemented Interfaces:
MailClient

@Repository public class JakartaMailClient extends Object implements MailClient
Implementation of a simple SMTP Mailer.
  • Constructor Details

    • JakartaMailClient

      public JakartaMailClient()
      Constructor.
  • Method Details

    • getDebugActiveConfiguration

      public Map<String,String> getDebugActiveConfiguration()
      Description copied from interface: MailClient
      Get the full active configuration of the mail client for debugging.
      Specified by:
      getDebugActiveConfiguration in interface MailClient
      Returns:
      configuration as Map
    • clearConfiguration

      public void clearConfiguration()
      Description copied from interface: MailClient
      Clean (reset) the mailer configuration.
      Specified by:
      clearConfiguration in interface MailClient
    • loadConfigurationFromProperties

      public boolean loadConfigurationFromProperties(String resource) throws IOException
      Description copied from interface: MailClient
      Load the e-mail configuration from a given property file.
      Specified by:
      loadConfigurationFromProperties in interface MailClient
      Parameters:
      resource - as String return true on success
      Returns:
      true on success
      Throws:
      IOException
    • loadConfigurationFromDatabase

      public boolean loadConfigurationFromDatabase()
      Description copied from interface: MailClient
      Load the e-mail configuration from the database.
      Specified by:
      loadConfigurationFromDatabase in interface MailClient
      Returns:
      true on success
    • getBulkMailLimiter

      public int getBulkMailLimiter()
      Description copied from interface: MailClient
      Get the limitation of the maximum amount of sending e-mails until a time interrupt will be processed.
      Specified by:
      getBulkMailLimiter in interface MailClient
      Returns:
      limitOfBulkMails as int
    • getWaitTime

      public long getWaitTime()
      Description copied from interface: MailClient
      Get the configured wait time in milliseconds until the next mail bulk can be send.
      Specified by:
      getWaitTime in interface MailClient
      Returns:
      waitTime as long
    • composeMail

      public void composeMail(Mail email) throws jakarta.mail.MessagingException
      Description copied from interface: MailClient
      Compose a full e-mail, ready to send.
      Specified by:
      composeMail in interface MailClient
      Parameters:
      email - as Mail
      Throws:
      jakarta.mail.MessagingException
    • getSession

      public jakarta.mail.Session getSession() throws jakarta.mail.NoSuchProviderException
      Description copied from interface: MailClient
      Get the configured session to connect the SMTP server.
      Specified by:
      getSession in interface MailClient
      Returns:
      session as Session
      Throws:
      jakarta.mail.NoSuchProviderException
    • getMailObject

      public Mail getMailObject()
      Description copied from interface: MailClient
      Get the composing Mail Object.
      Specified by:
      getMailObject in interface MailClient
      Returns:
      email as Mail
    • getMimeMessage

      public jakarta.mail.internet.MimeMessage getMimeMessage()
      Description copied from interface: MailClient
      Get the MimeMessage ready for sending.
      Specified by:
      getMimeMessage in interface MailClient
      Returns:
      message as MimeMessage