Package de.xima.fc.mdl.mail
Class TextMailData
- java.lang.Object
-
- de.xima.fc.mdl.mail.TextMailData
-
- All Implemented Interfaces:
IBaseMailData,Serializable
- Direct Known Subclasses:
MultipartMailData,SimpleTextMail
public class TextMailData extends Object implements IBaseMailData
Model containing basic mail properties- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.mail.Address[]bccprotected List<BodyPartData>bodyPartsprotected javax.mail.Address[]ccprotected javax.mail.Addressfromprotected Map<String,String>headersprotected javax.mail.Address[]replyprotected IMailSecurityConfigsecurityConfigprotected booleansendSeparateMailsprotected Stringsubjectprotected javax.mail.Address[]to-
Fields inherited from interface de.xima.fc.interfaces.mail.IBaseMailData
ADDRESS_SPLITTER
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextMailData(MailUser sender, String subject, javax.mail.Address[] to, javax.mail.Address[] reply, javax.mail.Address from, javax.mail.Address[] cc, javax.mail.Address[] bcc, boolean sendSeparateMails, IMailSecurityConfig securityConfig, List<BodyPartData> bodyParts, Map<String,String> headers)TextMailData(String subject, String body, String bodyMimeType, String from, String to)Deprecated.TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to)Deprecated.TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to, EMailEncrpytionType encrpytionType)Deprecated.TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to, Map<String,String> headers)Deprecated.TextMailData(String subject, String body, String bodyMimeType, String from, javax.mail.Address[] reply, String senderName, String to, EMailEncrpytionType encryptionType)Deprecated.TextMailData(String subject, String body, String bodyMimeType, javax.mail.Address from, javax.mail.Address[] reply, javax.mail.Address[] to)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected javax.mail.Address[]getAddressesByString(String addressesString)javax.mail.Address[]getBcc()StringgetBody()Deprecated.StringgetBodyMimeType()Deprecated.List<BodyPartData>getBodyParts()javax.mail.Address[]getCc()EMailEncrpytionTypegetEncryptionType()Deprecated.List<FilePartData>getFileParts()javax.mail.AddressgetFrom()Map<String,String>getHeaders()javax.mail.Address[]getReply()IMailSecurityConfiggetSecurityConfig()Gets the security configuration for this mail, which controls whether and how the mail should be encrypted and/or signed, and what to do if encryption/signing fails.MailUsergetSender()Gets the user that is sending the mail.booleangetSendSeparateMails()Flag to indicate that mails should be send separately to the to-recipient.StringgetSubject()javax.mail.Address[]getTo()voidsetBcc(String addresses)Deprecated.UseMailDataBuilder.bcc(String)orMailDataBuilder.bcc(Address[])instead.voidsetBcc(javax.mail.Address[] bcc)Deprecated.UseMailDataBuilder.bcc(Address[])orMailDataBuilder.bcc(String)instead.voidsetCc(String addresses)Deprecated.UseMailDataBuilder.cc(String)orMailDataBuilder.cc(Address[])instead.voidsetCc(javax.mail.Address[] cc)Deprecated.UseMailDataBuilder.cc(Address[])orMailDataBuilder.cc(String)instead.voidsetEncryptionType(EMailEncrpytionType encryptionType)Deprecated.voidsetSendSeparateMails(boolean sendSeparateMails)Deprecated.UseMailDataBuilder.sendSeparateMails(boolean)instead.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.mail.IBaseMailData
buildMimeMessage, buildMimeParts, getMimeMessage
-
-
-
-
Field Detail
-
subject
protected final String subject
-
to
protected final javax.mail.Address[] to
-
reply
protected final javax.mail.Address[] reply
-
from
protected final javax.mail.Address from
-
cc
protected javax.mail.Address[] cc
-
bcc
protected javax.mail.Address[] bcc
-
sendSeparateMails
protected boolean sendSeparateMails
-
securityConfig
protected IMailSecurityConfig securityConfig
-
bodyParts
protected List<BodyPartData> bodyParts
-
-
Constructor Detail
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to, Map<String,String> headers) throws Exception
Deprecated.- Throws:
Exception
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, String from, String to) throws Exception
Deprecated.- Throws:
Exception
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to) throws Exception
Deprecated.- Throws:
Exception
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, String from, String senderName, String to, EMailEncrpytionType encrpytionType) throws Exception
Deprecated.- Throws:
Exception
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, String from, javax.mail.Address[] reply, String senderName, String to, EMailEncrpytionType encryptionType) throws Exception
Deprecated.- Throws:
Exception
-
TextMailData
@Deprecated public TextMailData(String subject, String body, String bodyMimeType, javax.mail.Address from, javax.mail.Address[] reply, javax.mail.Address[] to)
Deprecated.
-
TextMailData
protected TextMailData(MailUser sender, String subject, javax.mail.Address[] to, javax.mail.Address[] reply, javax.mail.Address from, javax.mail.Address[] cc, javax.mail.Address[] bcc, boolean sendSeparateMails, IMailSecurityConfig securityConfig, List<BodyPartData> bodyParts, Map<String,String> headers)
-
-
Method Detail
-
getBody
@Deprecated public String getBody()
Deprecated.- Returns:
- the body
-
getBodyMimeType
@Deprecated public String getBodyMimeType()
Deprecated.- Returns:
- the bodyMimeType
-
getEncryptionType
@Deprecated public EMailEncrpytionType getEncryptionType()
Deprecated.
-
setEncryptionType
@Deprecated public void setEncryptionType(EMailEncrpytionType encryptionType)
Deprecated.
-
getFileParts
public List<FilePartData> getFileParts()
- Specified by:
getFilePartsin interfaceIBaseMailData
-
getSendSeparateMails
public boolean getSendSeparateMails()
Description copied from interface:IBaseMailDataFlag to indicate that mails should be send separately to the to-recipient. Cc- and Bcc-recipients will be ignored because its not clear how to handle them- Specified by:
getSendSeparateMailsin interfaceIBaseMailData- Returns:
trueif mails should be separately,falseotherwise
-
setSendSeparateMails
@Deprecated public void setSendSeparateMails(boolean sendSeparateMails)
Deprecated.UseMailDataBuilder.sendSeparateMails(boolean)instead.- Parameters:
sendSeparateMails-trueif mails should be separately,falseotherwise
-
setBcc
@Deprecated public void setBcc(String addresses) throws javax.mail.internet.AddressException
Deprecated.UseMailDataBuilder.bcc(String)orMailDataBuilder.bcc(Address[])instead.- Parameters:
addresses- The BCC addresses to set as a string.- Throws:
javax.mail.internet.AddressException- When an address is not a valid email address.
-
setBcc
@Deprecated public void setBcc(javax.mail.Address[] bcc)
Deprecated.UseMailDataBuilder.bcc(Address[])orMailDataBuilder.bcc(String)instead.- Parameters:
bcc- the bcc addresses to set
-
setCc
@Deprecated public void setCc(String addresses) throws javax.mail.internet.AddressException
Deprecated.UseMailDataBuilder.cc(String)orMailDataBuilder.cc(Address[])instead.- Parameters:
addresses- The CC addresses to set as a string.- Throws:
javax.mail.internet.AddressException- When an address is not a valid email address.
-
setCc
@Deprecated public void setCc(javax.mail.Address[] cc)
Deprecated.UseMailDataBuilder.cc(Address[])orMailDataBuilder.cc(String)instead.- Parameters:
cc- the cc addresses to set
-
getAddressesByString
protected javax.mail.Address[] getAddressesByString(String addressesString) throws javax.mail.internet.AddressException
- Throws:
javax.mail.internet.AddressException
-
getSender
public MailUser getSender()
Description copied from interface:IBaseMailDataGets the user that is sending the mail. Will be used for determining permissions when signing the mail. Note that this is not necessarily the same as the sender address returned byIBaseMailData.getFrom(), which is only used for the "From" header of the mail and may be set to an arbitrary value.Important: Currently it is okay to not implement this method and return
null, but in future versions of the mail module this method will be required to return a non-null user, and if it returnsnullan exception may be thrown when sending the mail. So it is recommended to implement this method and return the user that is sending the mail.- Specified by:
getSenderin interfaceIBaseMailData- Returns:
- the user that is sending the mail, or
nullif no user information is available
-
getSubject
public String getSubject()
- Specified by:
getSubjectin interfaceIBaseMailData
-
getTo
public javax.mail.Address[] getTo()
- Specified by:
getToin interfaceIBaseMailData- Returns:
- the to
-
getReply
public javax.mail.Address[] getReply()
- Specified by:
getReplyin interfaceIBaseMailData
-
getFrom
public javax.mail.Address getFrom()
- Specified by:
getFromin interfaceIBaseMailData
-
getCc
public javax.mail.Address[] getCc()
- Specified by:
getCcin interfaceIBaseMailData
-
getBcc
public javax.mail.Address[] getBcc()
- Specified by:
getBccin interfaceIBaseMailData
-
getSecurityConfig
public IMailSecurityConfig getSecurityConfig()
Description copied from interface:IBaseMailDataGets the security configuration for this mail, which controls whether and how the mail should be encrypted and/or signed, and what to do if encryption/signing fails.- Specified by:
getSecurityConfigin interfaceIBaseMailData- Returns:
- security configuration for this mail
-
getBodyParts
public List<BodyPartData> getBodyParts()
- Specified by:
getBodyPartsin interfaceIBaseMailData
-
getHeaders
public Map<String,String> getHeaders()
- Specified by:
getHeadersin interfaceIBaseMailData
-
-