Package org.alfresco.repo.imap
Class AbstractMimeMessage
- java.lang.Object
-
- javax.mail.Message
-
- javax.mail.internet.MimeMessage
-
- org.alfresco.repo.imap.AbstractMimeMessage
-
- All Implemented Interfaces:
javax.mail.internet.MimePart,javax.mail.Part
- Direct Known Subclasses:
ContentModelMessage,ImapModelMessage,IncomingImapMessage
public abstract class AbstractMimeMessage extends javax.mail.internet.MimeMessage- Author:
- Arseny Kovalchuk
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDEFAULT_SUFFIXprotected booleangenerateBodyprotected ImapServiceimapServiceprotected booleanisMessageInSitesLibraryprotected static intMAX_RETRIESprotected FileInfomessageFileInfoprotected ServiceRegistryserviceRegistryprotected javax.mail.internet.MimeMessagewrappedMessage
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMimeMessage(javax.mail.Session session)protectedAbstractMimeMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry, boolean generateBody)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbuildMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry)abstract voidbuildMessageInternal()Method must be implemented in subclasses.protected voidcheckParameter(java.lang.Object parameter, java.lang.String name)Method that checks mandatory parameter.java.lang.StringgetEmailBodyText(ImapService.EmailBodyFormat type)Returns the text representing email body for ContentModel node.javax.mail.FlagsgetFlags()Returns message flags.FileInfogetMessageInfo()ReturnsFileInfoobject representing message in Alfresco.voidsetFlags(javax.mail.Flags flags, boolean value)Sets message flags.protected voidsetMessageHeaders()protected voidupdateMessageID()-
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, writeTo, writeTo
-
-
-
-
Field Detail
-
DEFAULT_SUFFIX
protected static final java.lang.String DEFAULT_SUFFIX
- See Also:
- Constant Field Values
-
MAX_RETRIES
protected static int MAX_RETRIES
-
generateBody
protected boolean generateBody
-
serviceRegistry
protected ServiceRegistry serviceRegistry
-
imapService
protected ImapService imapService
-
messageFileInfo
protected FileInfo messageFileInfo
-
wrappedMessage
protected javax.mail.internet.MimeMessage wrappedMessage
-
isMessageInSitesLibrary
protected boolean isMessageInSitesLibrary
-
-
Constructor Detail
-
AbstractMimeMessage
protected AbstractMimeMessage(javax.mail.Session session)
-
AbstractMimeMessage
protected AbstractMimeMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry, boolean generateBody) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
-
Method Detail
-
buildMessage
protected void buildMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
buildMessageInternal
public abstract void buildMessageInternal() throws javax.mail.MessagingExceptionMethod must be implemented in subclasses. It usually should be used to generate message body.- Throws:
javax.mail.MessagingException
-
checkParameter
protected void checkParameter(java.lang.Object parameter, java.lang.String name)Method that checks mandatory parameter.- Parameters:
parameter- The parameter instance to check.name- The name of the parameter.
-
setMessageHeaders
protected void setMessageHeaders() throws javax.mail.MessagingException- Throws:
javax.mail.MessagingException
-
getMessageInfo
public FileInfo getMessageInfo()
ReturnsFileInfoobject representing message in Alfresco.- Returns:
- reference to the
FileInfoobject.
-
getFlags
public javax.mail.Flags getFlags()
Returns message flags.- Overrides:
getFlagsin classjavax.mail.internet.MimeMessage- Returns:
Flags
-
setFlags
public void setFlags(javax.mail.Flags flags, boolean value) throws javax.mail.MessagingExceptionSets message flags.- Overrides:
setFlagsin classjavax.mail.internet.MimeMessage- Parameters:
flags- -Flagsobject.value- - flags value.- Throws:
javax.mail.MessagingException
-
getEmailBodyText
public java.lang.String getEmailBodyText(ImapService.EmailBodyFormat type)
Returns the text representing email body for ContentModel node.- Parameters:
type- The type of the returned body. May be the one ofImapService.EmailBodyFormat.- Returns:
- Text representing email body for ContentModel node.
-
updateMessageID
protected void updateMessageID() throws javax.mail.MessagingException- Overrides:
updateMessageIDin classjavax.mail.internet.MimeMessage- Throws:
javax.mail.MessagingException
-
-