org.alfresco.repo.imap
Class AbstractMimeMessage

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by 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


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType
 
Field Summary
protected  boolean generateBody
           
protected  ImapService imapService
           
protected  boolean isMessageInSitesLibrary
           
protected static int MAX_RETRIES
           
protected  FileInfo messageFileInfo
           
protected  ServiceRegistry serviceRegistry
           
protected  javax.mail.internet.MimeMessage wrappedMessage
           
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
protected AbstractMimeMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry, boolean generateBody)
           
protected AbstractMimeMessage(javax.mail.Session session)
           
 
Method Summary
protected  void buildMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry)
           
abstract  void buildMessageInternal()
          Method must be implemented in subclasses.
protected  void checkParameter(java.lang.Object parameter, java.lang.String name)
          Method that checks mandatory parameter.
 java.lang.String getEmailBodyText(ImapService.EmailBodyFormat type)
          Returns the text representing email body for ContentModel node.
 javax.mail.Flags getFlags()
          Returns message flags.
 FileInfo getMessageInfo()
          Returns FileInfo object representing message in Alfresco.
 void setFlags(javax.mail.Flags flags, boolean value)
          Sets message flags.
protected  void setMessageHeaders()
           
protected  void updateMessageID()
           
 
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, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.MessagingException
Method 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:
The - parameter instance to check.
The - name of the parameter.

setMessageHeaders

protected void setMessageHeaders()
                          throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getMessageInfo

public FileInfo getMessageInfo()
Returns FileInfo object representing message in Alfresco.

Returns:
reference to the FileInfo object.

getFlags

public javax.mail.Flags getFlags()
Returns message flags.

Overrides:
getFlags in class javax.mail.internet.MimeMessage
Returns:
Flags

setFlags

public void setFlags(javax.mail.Flags flags,
                     boolean value)
              throws javax.mail.MessagingException
Sets message flags.

Overrides:
setFlags in class javax.mail.internet.MimeMessage
Parameters:
flags - - Flags object.
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:
nodeRef - NodeRef of the target content.
type - The type of the returned body. May be the one of ImapService.EmailBodyFormat.
Returns:
Text representing email body for ContentModel node.

updateMessageID

protected void updateMessageID()
                        throws javax.mail.MessagingException
Overrides:
updateMessageID in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.