public class EmailService extends Object implements IEmailService
Constructor and Description |
---|
EmailService()
Constructs an instance of this class using the default settings location as defined by PentahoSystem
|
EmailService(File emailConfigFile)
Constructs an instance of this class using the specified file location as the source of the email configuration
|
Modifier and Type | Method and Description |
---|---|
EmailConfiguration |
getEmailConfig()
TODO document
|
boolean |
isValid() |
String |
sendEmailTest(IEmailConfiguration emailConfig)
Tests the provided email configuration by sending a test email.
|
void |
setEmailConfig(IEmailConfiguration emailConfiguration) |
protected void |
setEmailConfigFile(File emailConfigFile)
Validates and sets the email configuration file to the specified value.
|
public EmailService() throws IllegalArgumentException
IllegalArgumentException
- Indicates that the default location for the email configuration file is invalidpublic EmailService(File emailConfigFile) throws IllegalArgumentException
emailConfigFile
- the file reference to the email configurationIllegalArgumentException
- indicates the argument is either null or references a location which is invalid (the parent folder of the
specified file doesn't exist)public void setEmailConfig(IEmailConfiguration emailConfiguration)
setEmailConfig
in interface IEmailService
public EmailConfiguration getEmailConfig()
getEmailConfig
in interface IEmailService
public String sendEmailTest(IEmailConfiguration emailConfig)
sendEmailTest
in interface IEmailService
emailConfig
- the email configuration to testException
- indicates an error running the test (as in an invalid configuration)protected void setEmailConfigFile(File emailConfigFile) throws IllegalArgumentException
emailConfigFile
- the email configuration file to useIllegalArgumentException
- indicates that the provided value is invalid (the value is null or the parent folder does not exist)public boolean isValid()
isValid
in interface IEmailService
Copyright © 2017 Hitachi Vantara. All rights reserved.