Class EmailService

  • All Implemented Interfaces:

    public class EmailService
    extends Object
    Manages the email connection information
    David M. Kincade
    • Constructor Detail

      • EmailService

        public EmailService()
                     throws IllegalArgumentException
        Constructs an instance of this class using the default settings location as defined by PentahoSystem
        IllegalArgumentException - Indicates that the default location for the email configuration file is invalid
      • EmailService

        public EmailService​(File emailConfigFile)
                     throws IllegalArgumentException
        Constructs an instance of this class using the specified file location as the source of the email configuration
        emailConfigFile - the file reference to the email configuration
        IllegalArgumentException - indicates the argument is either null or references a location which is invalid (the parent folder of the specified file doesn't exist)
    • Method Detail

      • setEmailConfig

        public void setEmailConfig​( emailConfiguration)
        Specified by:
        setEmailConfig in interface
      • getEmailConfig

        public EmailConfiguration getEmailConfig()
        TODO document
        Specified by:
        getEmailConfig in interface
      • sendEmailTest

        public String sendEmailTest​( emailConfig)
        Tests the provided email configuration by sending a test email. This will just indicate that the server configuration is correct and a test email was successfully sent. It does not test the destination address.
        Specified by:
        sendEmailTest in interface
        emailConfig - the email configuration to test
        Exception - indicates an error running the test (as in an invalid configuration)
      • setEmailConfigFile

        protected void setEmailConfigFile​(File emailConfigFile)
                                   throws IllegalArgumentException
        Validates and sets the email configuration file to the specified value.
        emailConfigFile - the email configuration file to use
        IllegalArgumentException - indicates that the provided value is invalid (the value is null or the parent folder does not exist)
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface