de.saly.javamail.mock2
Class MockMessage

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by de.saly.javamail.mock2.MockMessage
All Implemented Interfaces:
Comparable<MockMessage>, javax.mail.internet.MimePart, javax.mail.Part

public class MockMessage
extends javax.mail.internet.MimeMessage
implements Comparable<MockMessage>


Nested Class Summary
static interface MockMessage.FlagChangeListener
           
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType
 
Field Summary
protected  org.slf4j.Logger logger
           
 
Fields inherited from class javax.mail.internet.MimeMessage
cachedContent, content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
protected MockMessage(javax.mail.Message source, javax.mail.Folder folder)
           
protected MockMessage(javax.mail.internet.MimeMessage source, long mockid, MailboxFolder mbf, MockMessage.FlagChangeListener flagChangeListener)
           
 
Method Summary
 void addFrom(javax.mail.Address[] addresses)
           
 void addHeader(String name, String value)
           
 void addHeaderLine(String line)
           
 void addRecipient(javax.mail.Message.RecipientType type, javax.mail.Address address)
           
 void addRecipients(javax.mail.Message.RecipientType type, javax.mail.Address[] addresses)
           
 void addRecipients(javax.mail.Message.RecipientType type, String addresses)
           
 int compareTo(MockMessage o)
           
 javax.mail.Folder getFolder()
           
 long getMockid()
           
 void removeHeader(String name)
           
 void saveChanges()
           
 void setContent(javax.mail.Multipart mp)
           
 void setContent(Object o, String type)
           
 void setContentID(String cid)
           
 void setContentLanguage(String[] languages)
           
 void setContentMD5(String md5)
           
 void setDataHandler(DataHandler content)
           
 void setDescription(String description)
           
 void setDescription(String description, String charset)
           
 void setDisposition(String disposition)
           
protected  void setExpunged(boolean expunged)
           
 void setFileName(String filename)
           
 void setFlags(javax.mail.Flags flag, boolean set)
           
 void setFrom()
           
 void setFrom(javax.mail.Address address)
           
 void setFrom(String address)
           
 void setHeader(String name, String value)
           
protected  void setMessageNumber(int msgnum)
           
 void setRecipient(javax.mail.Message.RecipientType type, javax.mail.Address address)
           
 void setRecipients(javax.mail.Message.RecipientType type, javax.mail.Address[] addresses)
           
 void setRecipients(javax.mail.Message.RecipientType type, String addresses)
           
 void setReplyTo(javax.mail.Address[] addresses)
           
 void setSender(javax.mail.Address address)
           
 void setSentDate(Date d)
           
 void setSubject(String subject)
           
 void setSubject(String subject, String charset)
           
 void setText(String text)
           
 void setText(String text, String charset)
           
 void setText(String text, String charset, String subtype)
           
 
Methods inherited from class javax.mail.internet.MimeMessage
createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, reply, reply, updateHeaders, updateMessageID, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
getMessageNumber, getSession, isExpunged, match, setFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

MockMessage

protected MockMessage(javax.mail.Message source,
                      javax.mail.Folder folder)
               throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

MockMessage

protected MockMessage(javax.mail.internet.MimeMessage source,
                      long mockid,
                      MailboxFolder mbf,
                      MockMessage.FlagChangeListener flagChangeListener)
               throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException
Method Detail

addFrom

public void addFrom(javax.mail.Address[] addresses)
             throws javax.mail.MessagingException
Overrides:
addFrom in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

addHeader

public void addHeader(String name,
                      String value)
               throws javax.mail.MessagingException
Specified by:
addHeader in interface javax.mail.Part
Overrides:
addHeader in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

addHeaderLine

public void addHeaderLine(String line)
                   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

addRecipient

public void addRecipient(javax.mail.Message.RecipientType type,
                         javax.mail.Address address)
                  throws javax.mail.MessagingException
Overrides:
addRecipient in class javax.mail.Message
Throws:
javax.mail.MessagingException

addRecipients

public void addRecipients(javax.mail.Message.RecipientType type,
                          javax.mail.Address[] addresses)
                   throws javax.mail.MessagingException
Overrides:
addRecipients in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

addRecipients

public void addRecipients(javax.mail.Message.RecipientType type,
                          String addresses)
                   throws javax.mail.MessagingException
Overrides:
addRecipients in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

compareTo

public int compareTo(MockMessage o)
Specified by:
compareTo in interface Comparable<MockMessage>

getFolder

public javax.mail.Folder getFolder()
Overrides:
getFolder in class javax.mail.Message

getMockid

public long getMockid()
Returns:
the mockid

removeHeader

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

saveChanges

public void saveChanges()
                 throws javax.mail.MessagingException
Overrides:
saveChanges in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setContent

public void setContent(javax.mail.Multipart mp)
                throws javax.mail.MessagingException
Specified by:
setContent in interface javax.mail.Part
Overrides:
setContent in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setContent

public void setContent(Object o,
                       String type)
                throws javax.mail.MessagingException
Specified by:
setContent in interface javax.mail.Part
Overrides:
setContent in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setContentID

public void setContentID(String cid)
                  throws javax.mail.MessagingException
Overrides:
setContentID in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setContentLanguage

public void setContentLanguage(String[] languages)
                        throws javax.mail.MessagingException
Specified by:
setContentLanguage in interface javax.mail.internet.MimePart
Overrides:
setContentLanguage in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setContentMD5

public void setContentMD5(String md5)
                   throws javax.mail.MessagingException
Specified by:
setContentMD5 in interface javax.mail.internet.MimePart
Overrides:
setContentMD5 in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setDataHandler

public void setDataHandler(DataHandler content)
                    throws javax.mail.MessagingException
Specified by:
setDataHandler in interface javax.mail.Part
Overrides:
setDataHandler in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setDescription

public void setDescription(String description)
                    throws javax.mail.MessagingException
Specified by:
setDescription in interface javax.mail.Part
Overrides:
setDescription in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setDescription

public void setDescription(String description,
                           String charset)
                    throws javax.mail.MessagingException
Overrides:
setDescription in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setDisposition

public void setDisposition(String disposition)
                    throws javax.mail.MessagingException
Specified by:
setDisposition in interface javax.mail.Part
Overrides:
setDisposition in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setExpunged

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

setFileName

public void setFileName(String filename)
                 throws javax.mail.MessagingException
Specified by:
setFileName in interface javax.mail.Part
Overrides:
setFileName in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setFlags

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

setFrom

public void setFrom()
             throws javax.mail.MessagingException
Overrides:
setFrom in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setFrom

public void setFrom(javax.mail.Address address)
             throws javax.mail.MessagingException
Overrides:
setFrom in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setFrom

public void setFrom(String address)
             throws javax.mail.MessagingException
Overrides:
setFrom in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setHeader

public void setHeader(String name,
                      String value)
               throws javax.mail.MessagingException
Specified by:
setHeader in interface javax.mail.Part
Overrides:
setHeader in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setMessageNumber

protected void setMessageNumber(int msgnum)
Overrides:
setMessageNumber in class javax.mail.Message

setRecipient

public void setRecipient(javax.mail.Message.RecipientType type,
                         javax.mail.Address address)
                  throws javax.mail.MessagingException
Overrides:
setRecipient in class javax.mail.Message
Throws:
javax.mail.MessagingException

setRecipients

public void setRecipients(javax.mail.Message.RecipientType type,
                          javax.mail.Address[] addresses)
                   throws javax.mail.MessagingException
Overrides:
setRecipients in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setRecipients

public void setRecipients(javax.mail.Message.RecipientType type,
                          String addresses)
                   throws javax.mail.MessagingException
Overrides:
setRecipients in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setReplyTo

public void setReplyTo(javax.mail.Address[] addresses)
                throws javax.mail.MessagingException
Overrides:
setReplyTo in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setSender

public void setSender(javax.mail.Address address)
               throws javax.mail.MessagingException
Overrides:
setSender in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setSentDate

public void setSentDate(Date d)
                 throws javax.mail.MessagingException
Overrides:
setSentDate in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setSubject

public void setSubject(String subject)
                throws javax.mail.MessagingException
Overrides:
setSubject in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setSubject

public void setSubject(String subject,
                       String charset)
                throws javax.mail.MessagingException
Overrides:
setSubject in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setText

public void setText(String text)
             throws javax.mail.MessagingException
Specified by:
setText in interface javax.mail.internet.MimePart
Specified by:
setText in interface javax.mail.Part
Overrides:
setText in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setText

public void setText(String text,
                    String charset)
             throws javax.mail.MessagingException
Specified by:
setText in interface javax.mail.internet.MimePart
Overrides:
setText in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

setText

public void setText(String text,
                    String charset,
                    String subtype)
             throws javax.mail.MessagingException
Specified by:
setText in interface javax.mail.internet.MimePart
Overrides:
setText in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException


Copyright © 2014. All rights reserved.