Class AbstractMimeMessage

java.lang.Object
jakarta.mail.Message
jakarta.mail.internet.MimeMessage
org.alfresco.repo.imap.AbstractMimeMessage
All Implemented Interfaces:
jakarta.mail.internet.MimePart, jakarta.mail.Part
Direct Known Subclasses:
ContentModelMessage, ImapModelMessage, IncomingImapMessage

public abstract class AbstractMimeMessage extends jakarta.mail.internet.MimeMessage
Author:
Arseny Kovalchuk
  • Nested Class Summary

    Nested classes/interfaces inherited from class jakarta.mail.internet.MimeMessage

    jakarta.mail.internet.MimeMessage.RecipientType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected boolean
     
    protected ImapService
     
    protected boolean
     
    protected static int
     
    protected FileInfo
     
    protected ServiceRegistry
     
    protected jakarta.mail.internet.MimeMessage
     

    Fields inherited from class jakarta.mail.internet.MimeMessage

    cachedContent, content, contentStream, dh, flags, headers, modified, saved

    Fields inherited from class jakarta.mail.Message

    expunged, folder, msgnum, session

    Fields inherited from interface jakarta.mail.Part

    ATTACHMENT, INLINE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractMimeMessage(jakarta.mail.Session session)
     
    protected
    AbstractMimeMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry, boolean generateBody)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    buildMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry)
     
    abstract void
    Method must be implemented in subclasses.
    protected void
    checkParameter(Object parameter, String name)
    Method that checks mandatory parameter.
    Returns the text representing email body for ContentModel node.
    jakarta.mail.Flags
    Returns message flags.
    Returns FileInfo object representing message in Alfresco.
    void
    setFlags(jakarta.mail.Flags flags, boolean value)
    Sets message flags.
    protected void
     
    protected void
     

    Methods inherited from class jakarta.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

    Methods inherited from class jakarta.mail.Message

    addRecipient, getFolder, getMessageNumber, getSession, 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 Details

    • DEFAULT_SUFFIX

      protected static final String DEFAULT_SUFFIX
      See Also:
    • 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 jakarta.mail.internet.MimeMessage wrappedMessage
    • isMessageInSitesLibrary

      protected boolean isMessageInSitesLibrary
  • Constructor Details

    • AbstractMimeMessage

      protected AbstractMimeMessage(jakarta.mail.Session session)
    • AbstractMimeMessage

      protected AbstractMimeMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry, boolean generateBody) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
  • Method Details

    • buildMessage

      protected void buildMessage(FileInfo fileInfo, ServiceRegistry serviceRegistry) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • buildMessageInternal

      public abstract void buildMessageInternal() throws jakarta.mail.MessagingException
      Method must be implemented in subclasses. It usually should be used to generate message body.
      Throws:
      jakarta.mail.MessagingException
    • checkParameter

      protected void checkParameter(Object parameter, 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 jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • getMessageInfo

      public FileInfo getMessageInfo()
      Returns FileInfo object representing message in Alfresco.
      Returns:
      reference to the FileInfo object.
    • getFlags

      public jakarta.mail.Flags getFlags()
      Returns message flags.
      Overrides:
      getFlags in class jakarta.mail.internet.MimeMessage
      Returns:
      Flags
    • setFlags

      public void setFlags(jakarta.mail.Flags flags, boolean value) throws jakarta.mail.MessagingException
      Sets message flags.
      Overrides:
      setFlags in class jakarta.mail.internet.MimeMessage
      Parameters:
      flags - - Flags object.
      value - - flags value.
      Throws:
      jakarta.mail.MessagingException
    • getEmailBodyText

      public 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 of ImapService.EmailBodyFormat.
      Returns:
      Text representing email body for ContentModel node.
    • updateMessageID

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