Class EmailResource
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
-
- org.pentaho.platform.web.http.api.resources.EmailResource
-
public class EmailResource extends AbstractJaxRSResource
Configures and manage the Email configuration in the platform- Author:
- rmansoor
-
-
Field Summary
-
Fields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML
-
-
Constructor Summary
Constructors Constructor Description EmailResource()Constructs an instance of this class using the default email serviceEmailResource(org.pentaho.platform.api.email.IEmailService emailService)Constructs an instance of this class using the default email service
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsedeleteEmailConfig()Delete the stored email configuration from the platform.org.pentaho.platform.api.email.IEmailConfigurationgetEmailConfig()Retrieves the email configurationjavax.ws.rs.core.ResponseisValid()Checks whether the current email configuration is validjavax.ws.rs.core.ResponsesendEmailTest(EmailConfiguration emailConfiguration)Process the current email configurationjavax.ws.rs.core.ResponsesetEmailConfig(EmailConfiguration emailConfiguration)Stores the email configuration in the platform-
Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
-
-
-
Constructor Detail
-
EmailResource
public EmailResource() throws IllegalArgumentExceptionConstructs an instance of this class using the default email service- Throws:
IllegalArgumentException- Indicates that the default location for the email configuration file is invalid
-
EmailResource
public EmailResource(org.pentaho.platform.api.email.IEmailService emailService) throws IllegalArgumentExceptionConstructs an instance of this class using the default email service- Throws:
IllegalArgumentException- Indicates that the default location for the email configuration file is invalid
-
-
Method Detail
-
deleteEmailConfig
public javax.ws.rs.core.Response deleteEmailConfig()
Delete the stored email configuration from the platform.- Parameters:
emailConfiguration-EmailConfiguration- Returns:
-
setEmailConfig
public javax.ws.rs.core.Response setEmailConfig(EmailConfiguration emailConfiguration)
Stores the email configuration in the platform- Parameters:
emailConfiguration-EmailConfiguration- Returns:
-
getEmailConfig
public org.pentaho.platform.api.email.IEmailConfiguration getEmailConfig()
Retrieves the email configuration- Returns:
- emailConfiguration
EmailConfiguration
-
sendEmailTest
public javax.ws.rs.core.Response sendEmailTest(EmailConfiguration emailConfiguration) throws Exception
Process the current email configuration- Parameters:
emailConfiguration-EmailConfiguration- Returns:
- Throws:
Exception
-
isValid
public javax.ws.rs.core.Response isValid()
Checks whether the current email configuration is valid- Returns:
- ("true" or "false")
-
-