Class EmailService
java.lang.Object
org.pentaho.platform.plugin.services.email.EmailService
- All Implemented Interfaces:
- org.pentaho.platform.api.email.IEmailService
Manages the email connection information
- Author:
- David M. Kincade
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs an instance of this class using the default settings location as defined by PentahoSystemEmailService(File emailConfigFile) Constructs an instance of this class using the specified file location as the source of the email configuration
- 
Method SummaryModifier and TypeMethodDescriptionTODO documentprotected org.pentaho.platform.api.email.IEmailAuthenticationResponsegetOAuthToken(org.pentaho.platform.api.email.IEmailConfiguration emailConfig) booleanisValid()protected booleanvoidsendEmail(javax.mail.Session session, javax.mail.internet.MimeMessage msg) sendEmailTest(org.pentaho.platform.api.email.IEmailConfiguration emailConfig) Tests the provided email configuration by sending a test email.protected voidsendMailGraphApi(String uri, String accessToken, String message) protected voidsendMailGraphApi(org.pentaho.platform.api.email.IEmailConfiguration emailConfig, String accessToken, String message) voidsetEmailConfig(org.pentaho.platform.api.email.IEmailConfiguration emailConfiguration) protected voidsetEmailConfigFile(File emailConfigFile) Validates and sets the email configuration file to the specified value.
- 
Field Details- 
GRANT_TYPE- See Also:
 
- 
SCOPE- See Also:
 
- 
CLIENT_ID- See Also:
 
- 
CLIENT_SECRET- See Also:
 
- 
CODE- See Also:
 
- 
REDIRECT_URI- See Also:
 
- 
TEST_EMAIL_FAIL- See Also:
 
- 
TEST_EMAIL_SUCCESS- See Also:
 
 
- 
- 
Constructor Details- 
EmailServiceConstructs an instance of this class using the default settings location as defined by PentahoSystem- Throws:
- IllegalArgumentException- Indicates that the default location for the email configuration file is invalid
 
- 
EmailServiceConstructs an instance of this class using the specified file location as the source of the email configuration- Parameters:
- emailConfigFile- the file reference to the email configuration
- Throws:
- 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 Details- 
setEmailConfigpublic void setEmailConfig(org.pentaho.platform.api.email.IEmailConfiguration emailConfiguration) - Specified by:
- setEmailConfigin interface- org.pentaho.platform.api.email.IEmailService
 
- 
getEmailConfigTODO document- Specified by:
- getEmailConfigin interface- org.pentaho.platform.api.email.IEmailService
- Returns:
 
- 
sendEmailTestTests 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:
- sendEmailTestin interface- org.pentaho.platform.api.email.IEmailService
- Parameters:
- emailConfig- the email configuration to test
- Throws:
- Exception- indicates an error running the test (as in an invalid configuration)
 
- 
sendEmailpublic void sendEmail(javax.mail.Session session, javax.mail.internet.MimeMessage msg) throws org.pentaho.platform.api.email.EmailServiceException - Specified by:
- sendEmailin interface- org.pentaho.platform.api.email.IEmailService
- Throws:
- org.pentaho.platform.api.email.EmailServiceException
 
- 
setEmailConfigFileValidates and sets the email configuration file to the specified value.- Parameters:
- emailConfigFile- the email configuration file to use
- Throws:
- IllegalArgumentException- indicates that the provided value is invalid (the value is null or the parent folder does not exist)
 
- 
isValidpublic boolean isValid()- Specified by:
- isValidin interface- org.pentaho.platform.api.email.IEmailService
 
- 
isValid
- 
getOAuthTokenprotected org.pentaho.platform.api.email.IEmailAuthenticationResponse getOAuthToken(org.pentaho.platform.api.email.IEmailConfiguration emailConfig) throws IOException, org.apache.http.HttpException - Throws:
- IOException
- org.apache.http.HttpException
 
- 
sendMailGraphApiprotected void sendMailGraphApi(org.pentaho.platform.api.email.IEmailConfiguration emailConfig, String accessToken, String message) throws org.apache.http.HttpException, IOException - Throws:
- org.apache.http.HttpException
- IOException
 
- 
sendMailGraphApiprotected void sendMailGraphApi(String uri, String accessToken, String message) throws org.apache.http.HttpException, IOException - Throws:
- org.apache.http.HttpException
- IOException
 
 
-