Class MStorMessage

  • All Implemented Interfaces:
    Serializable, javax.mail.internet.MimePart, javax.mail.Part, Taggable

    public final class MStorMessage
    extends javax.mail.internet.MimeMessage
    implements Serializable, Taggable
    Implementation of a message for the mstor javamail provider.
    See Also:
    Serialized Form
    • Constructor Detail

      • MStorMessage

        public MStorMessage​(javax.mail.Session session)
        Parameters:
        session - the session associated with the message
      • MStorMessage

        public MStorMessage​(javax.mail.Session session,
                            InputStream in)
        Parameters:
        session - the session associated with the message
        in - an input stream to read message data from
      • MStorMessage

        public MStorMessage​(javax.mail.internet.MimeMessage m)
                     throws javax.mail.MessagingException
        Parameters:
        m - a message instance to duplicate
        Throws:
        javax.mail.MessagingException - where an unexpected error occurs duplicating the specified message
      • MStorMessage

        public MStorMessage​(javax.mail.Folder folder,
                            int msgnum)
        Parameters:
        folder - the folder associated with the message
        msgnum - the message number of the message in the specified folder
      • MStorMessage

        public MStorMessage​(javax.mail.Folder folder,
                            InputStream in,
                            int msgnum)
        Parameters:
        folder - the folder associated with the message
        in - an input stream to read message data from
        msgnum - the message number of the message in the specified folder
      • MStorMessage

        public MStorMessage​(MessageDelegate delegate)
        Parameters:
        delegate - a delegate providing implementation-specific message functionality
      • MStorMessage

        public MStorMessage​(javax.mail.Folder folder,
                            InputStream in,
                            int msgnum,
                            MessageDelegate delegate)
        Parameters:
        folder - the folder associated with the message
        in - an input stream to read message data from
        msgnum - the message number of the message in the specified folder
        delegate - a delegate providing implementation-specific message functionality
      • MStorMessage

        public MStorMessage​(javax.mail.Folder folder,
                            javax.mail.internet.InternetHeaders headers,
                            byte[] content,
                            int msgnum)
                     throws javax.mail.MessagingException
        Parameters:
        folder - the folder associated with the message
        headers - headers for the message instance
        content - message data
        msgnum - the message number of the message in the specified folder
        Throws:
        javax.mail.MessagingException - where an unexpected error occurs
    • Method Detail

      • getAllHeaderLines

        public Enumeration<String> getAllHeaderLines()
                                              throws javax.mail.MessagingException
        Specified by:
        getAllHeaderLines in interface javax.mail.internet.MimePart
        Overrides:
        getAllHeaderLines in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getAllHeaders

        public Enumeration<javax.mail.Header> getAllHeaders()
                                                     throws javax.mail.MessagingException
        Specified by:
        getAllHeaders in interface javax.mail.Part
        Overrides:
        getAllHeaders in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getHeader

        public String getHeader​(String name,
                                String delimiter)
                         throws javax.mail.MessagingException
        Specified by:
        getHeader in interface javax.mail.internet.MimePart
        Overrides:
        getHeader in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getHeader

        public String[] getHeader​(String name)
                           throws javax.mail.MessagingException
        Specified by:
        getHeader in interface javax.mail.Part
        Overrides:
        getHeader in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getMatchingHeaderLines

        public Enumeration<String> getMatchingHeaderLines​(String[] names)
                                                   throws javax.mail.MessagingException
        Specified by:
        getMatchingHeaderLines in interface javax.mail.internet.MimePart
        Overrides:
        getMatchingHeaderLines in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getMatchingHeaders

        public Enumeration<javax.mail.Header> getMatchingHeaders​(String[] names)
                                                          throws javax.mail.MessagingException
        Specified by:
        getMatchingHeaders in interface javax.mail.Part
        Overrides:
        getMatchingHeaders in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getNonMatchingHeaderLines

        public Enumeration<String> getNonMatchingHeaderLines​(String[] names)
                                                      throws javax.mail.MessagingException
        Specified by:
        getNonMatchingHeaderLines in interface javax.mail.internet.MimePart
        Overrides:
        getNonMatchingHeaderLines in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getNonMatchingHeaders

        public Enumeration<javax.mail.Header> getNonMatchingHeaders​(String[] names)
                                                             throws javax.mail.MessagingException
        Specified by:
        getNonMatchingHeaders in interface javax.mail.Part
        Overrides:
        getNonMatchingHeaders in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • getContentStream

        protected InputStream getContentStream()
                                        throws javax.mail.MessagingException
        Overrides:
        getContentStream in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • setExpunged

        protected void setExpunged​(boolean expunged)
        Overrides:
        setExpunged in class javax.mail.Message
      • getReceivedDate

        public Date getReceivedDate()
                             throws javax.mail.MessagingException
        Overrides:
        getReceivedDate in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • setFlags

        public void setFlags​(javax.mail.Flags flags,
                             boolean set)
                      throws javax.mail.MessagingException
        Overrides:
        setFlags in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • setFlag

        public void setFlag​(javax.mail.Flags.Flag flag,
                            boolean set)
                     throws javax.mail.MessagingException
        Overrides:
        setFlag in class javax.mail.Message
        Throws:
        javax.mail.MessagingException
      • setHeader

        public void setHeader​(String s,
                              String s1)
                       throws javax.mail.MessagingException
        Specified by:
        setHeader in interface javax.mail.Part
        Overrides:
        setHeader in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • addHeader

        public void addHeader​(String s,
                              String s1)
                       throws javax.mail.MessagingException
        Specified by:
        addHeader in interface javax.mail.Part
        Overrides:
        addHeader in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • removeHeader

        public void removeHeader​(String s)
                          throws javax.mail.MessagingException
        Specified by:
        removeHeader in interface javax.mail.Part
        Overrides:
        removeHeader in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • addHeaderLine

        public void addHeaderLine​(String s)
                           throws javax.mail.MessagingException
        Specified by:
        addHeaderLine in interface javax.mail.internet.MimePart
        Overrides:
        addHeaderLine in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException
      • addTag

        public void addTag​(String tag)
                    throws javax.mail.MessagingException
        Description copied from interface: Taggable
        Add the specified model to the associated tags.
        Specified by:
        addTag in interface Taggable
        Parameters:
        tag - a message model
        Throws:
        javax.mail.MessagingException - where an error occurs updating tags
      • removeTag

        public void removeTag​(String tag)
                       throws javax.mail.MessagingException
        Description copied from interface: Taggable
        Remove the specified model from the associated tags.
        Specified by:
        removeTag in interface Taggable
        Parameters:
        tag - a message model
        Throws:
        javax.mail.MessagingException - where an error occurs updating tags
      • saveChanges

        public void saveChanges()
                         throws javax.mail.MessagingException
        Attempts to save metadata after calling saveChanges in the superclass.
        Overrides:
        saveChanges in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException - where an error occurs in the delegate save
      • updateHeaders

        protected void updateHeaders()
                              throws javax.mail.MessagingException
        Attempts to update headers in metadata after updating headers in superclass.
        Overrides:
        updateHeaders in class javax.mail.internet.MimeMessage
        Throws:
        javax.mail.MessagingException - where an error occurs in the delegate update
      • getTags

        public Tags getTags()
                     throws javax.mail.MessagingException
        Returns tags associated with this message. Note that any changes made to the returned instance will not affect this message.
        Specified by:
        getTags in interface Taggable
        Returns:
        Returns the tags.
        Throws:
        javax.mail.MessagingException - where an error occurs retrieving flags
      • getUid

        protected long getUid()
        Returns the UID associated with the message.
        Returns:
        a long representation of a UID, or -1 if no UID is assigned
      • getInReplyTo

        public MStorMessage getInReplyTo()
        Returns:
        a message instance such that this message is a reply to it
      • getReferences

        public List<MStorMessage> getReferences()
        Returns:
        a list of message instances related to this message