|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ploin.pmf.impl.MailFactory
public class MailFactory
Description: Implementation of the IMailFactory interface. This is
the main class. This class control the MailReader, MailReplacer,
MailSender and the PropertiesLoader.
| Constructor Summary | |
|---|---|
MailFactory()
|
|
| Method Summary | |
|---|---|
String |
getDirectory()
Returns the directory where the email-templates and the clients are in. |
String |
getHtmlExtension()
returns the html extension. |
String |
getHtmlMessage(TemplateConfig templateConfig)
This method tries to find a HTML template file with the given name in the templateConfig, fills it with the values from the map and returns the filled template. |
IMailReader |
getMailReader()
Returns the IMailReader |
IMailReplacer |
getMailReplacer()
Returns the IMailReplacer |
IMailSender |
getMailSender()
Returns the IMailSender |
String |
getPlainExtension()
returns the plain extension. |
String |
getPlainMessage(TemplateConfig templateConfig)
This method tries to find a plain-text template file with the given name in the templateConfig, fills it with the values from the map and returns the filled template. |
IPropertiesLoader |
getPropertiesLoader()
Returns the IPropertiesLoader |
void |
init()
Initialize the mail Factory |
boolean |
isSingleThread()
returns the variable "singleThread" |
SendingResult |
sendMail(MailConfig mailConfig,
TemplateConfig templateConfig)
This is the main method. |
SendingResult |
sendMailWithContent(MailConfig mailConfig,
TemplateConfig templateConfig,
String plainReplaced,
String htmlReplaced)
This method sends an e-mail with the given plainReplaced content and htmlReplaced content. |
void |
setDirectory(String directory)
Set teh directory where the email-templates and the clients are in. |
void |
setHtmlExtension(String extension)
Set the html extension. |
void |
setMailReader(IMailReader mailReader)
Set the IMailReader |
void |
setMailReplacer(IMailReplacer mailReplacer)
Set the IMailReplacer |
void |
setMailSender(IMailSender mailSender)
Set the IMailSender |
void |
setPlainExtension(String extension)
Set the plain extension. |
void |
setPropertiesLoader(IPropertiesLoader propertiesLoader)
Set the IPropertiesLoader |
void |
setSingleThread(boolean singleThread)
Set the singleThread |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailFactory()
| Method Detail |
|---|
public void init()
throws MailFactoryException
IMailFactory
init in interface IMailFactoryMailFactoryException
public SendingResult sendMail(MailConfig mailConfig,
TemplateConfig templateConfig)
throws MailFactoryException
IMailFactory
sendMail in interface IMailFactorymailConfig - the object containing the recipients and the clienttemplateConfig - containing client, locale, template-name and map.
MailFactoryException
public SendingResult sendMailWithContent(MailConfig mailConfig,
TemplateConfig templateConfig,
String plainReplaced,
String htmlReplaced)
throws MailFactoryException
IMailFactory
sendMailWithContent in interface IMailFactorymailConfig - the mailConfig objecttemplateConfig - containing client, locale, template-name and map.plainReplaced - the plain text content to be send in the email.htmlReplaced - the HTML content to be send in the email.
MailFactoryException
public String getPlainMessage(TemplateConfig templateConfig)
throws MailFactoryException
IMailFactory
getPlainMessage in interface IMailFactorytemplateConfig - containing client, locale, template-name and map.
MailFactoryException
public String getHtmlMessage(TemplateConfig templateConfig)
throws MailFactoryException
IMailFactory
getHtmlMessage in interface IMailFactorytemplateConfig - containing client, locale, template-name and map.
MailFactoryExceptionpublic IMailReader getMailReader()
IMailFactory
getMailReader in interface IMailFactorypublic void setMailReader(IMailReader mailReader)
IMailFactory
setMailReader in interface IMailFactorypublic IMailReplacer getMailReplacer()
IMailFactory
getMailReplacer in interface IMailFactorypublic void setMailReplacer(IMailReplacer mailReplacer)
IMailFactory
setMailReplacer in interface IMailFactorypublic IMailSender getMailSender()
IMailFactory
getMailSender in interface IMailFactorypublic void setMailSender(IMailSender mailSender)
IMailFactory
setMailSender in interface IMailFactorypublic IPropertiesLoader getPropertiesLoader()
IMailFactory
getPropertiesLoader in interface IMailFactorypublic void setPropertiesLoader(IPropertiesLoader propertiesLoader)
IMailFactory
setPropertiesLoader in interface IMailFactorypublic String getDirectory()
IMailFactory
getDirectory in interface IMailFactorypublic void setDirectory(String directory)
IMailFactory
setDirectory in interface IMailFactorypublic String getHtmlExtension()
IMailFactory
getHtmlExtension in interface IMailFactorypublic String getPlainExtension()
IMailFactory
getPlainExtension in interface IMailFactorypublic void setHtmlExtension(String extension)
IMailFactory
setHtmlExtension in interface IMailFactorypublic void setPlainExtension(String extension)
IMailFactory
setPlainExtension in interface IMailFactorypublic boolean isSingleThread()
IMailFactory
isSingleThread in interface IMailFactorypublic void setSingleThread(boolean singleThread)
IMailFactory
setSingleThread in interface IMailFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||