de.saly.javamail.mock2
Class MailboxFolder

java.lang.Object
  extended by de.saly.javamail.mock2.MailboxFolder
All Implemented Interfaces:
MockMessage.FlagChangeListener

public class MailboxFolder
extends Object
implements MockMessage.FlagChangeListener


Nested Class Summary
static interface MailboxFolder.MailboxEventListener
           
 
Field Summary
protected  org.slf4j.Logger logger
           
static char SEPARATOR
           
 
Constructor Summary
protected MailboxFolder(String name, MockMailbox mb, boolean exists)
           
 
Method Summary
 javax.mail.Message add(javax.mail.internet.MimeMessage e)
           
 void addMailboxEventListener(MailboxFolder.MailboxEventListener l)
           
protected  MailboxFolder addSpecialSubFolder(String name)
           
protected  void checkExists()
           
protected  void checkFolderName(String name)
           
protected  void checkFolderName(String name, boolean checkSeparator)
           
 MailboxFolder create()
           
 void deleteFolder(boolean recurse)
           
 boolean equals(Object obj)
           
 javax.mail.Message[] expunge()
           
 javax.mail.Message[] expunge(javax.mail.Message[] msgs)
           
 javax.mail.Message[] getByFlags(javax.mail.Flags flags, boolean mustSet)
           
 javax.mail.Message getById(long id)
           
 javax.mail.Message[] getByIds(long[] id)
           
 javax.mail.Message[] getByIds(long start, long end)
           
 javax.mail.Message getByMsgNum(int msgnum)
           
 List<MailboxFolder> getChildren()
           
 String getFullName()
           
 MockMailbox getMailbox()
           
 int getMessageCount()
           
 javax.mail.Message[] getMessages()
           
 String getName()
           
 MailboxFolder getOrAddSubFolder(String name)
           
 MailboxFolder getParent()
           
 int getSizeInBytes()
           
 long getUID(javax.mail.Message msg)
           
 long getUidValidity()
           
protected  long getUniqueMessageId()
           
 int hashCode()
           
 boolean hasMessages()
           
 void invalidateUid()
           
 boolean isExists()
           
 boolean isInbox()
           
 boolean isRoot()
           
 boolean isSimulateError()
           
protected  boolean isSubscribed()
           
 void markMessageAsDeleted(javax.mail.Message e)
           
 void markMessageAsSeen(javax.mail.Message e)
           
 void onFlagChange(MockMessage msg, javax.mail.Flags flags, boolean set)
           
 void removeMailboxEventListener(MailboxFolder.MailboxEventListener l)
           
 void renameFolder(String newName)
           
 javax.mail.Message[] search(javax.mail.search.SearchTerm term, javax.mail.Message[] msgsToSearch)
           
 void setSimulateError(boolean simulateError)
           
protected  void setSubscribed(boolean subscribed)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
See Also:
Constant Field Values

logger

protected final org.slf4j.Logger logger
Constructor Detail

MailboxFolder

protected MailboxFolder(String name,
                        MockMailbox mb,
                        boolean exists)
Method Detail

add

public javax.mail.Message add(javax.mail.internet.MimeMessage e)
                       throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

addMailboxEventListener

public void addMailboxEventListener(MailboxFolder.MailboxEventListener l)

addSpecialSubFolder

protected MailboxFolder addSpecialSubFolder(String name)

checkExists

protected void checkExists()

checkFolderName

protected void checkFolderName(String name)

checkFolderName

protected void checkFolderName(String name,
                               boolean checkSeparator)

create

public MailboxFolder create()

deleteFolder

public void deleteFolder(boolean recurse)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

expunge

public javax.mail.Message[] expunge()
                             throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

expunge

public javax.mail.Message[] expunge(javax.mail.Message[] msgs)
                             throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getByFlags

public javax.mail.Message[] getByFlags(javax.mail.Flags flags,
                                       boolean mustSet)
                                throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getById

public javax.mail.Message getById(long id)

getByIds

public javax.mail.Message[] getByIds(long start,
                                     long end)

getByIds

public javax.mail.Message[] getByIds(long[] id)

getByMsgNum

public javax.mail.Message getByMsgNum(int msgnum)

getChildren

public List<MailboxFolder> getChildren()
Returns:
Unmodifieable new list copy

getFullName

public String getFullName()

getMailbox

public MockMailbox getMailbox()
Returns:
the mailbox

getMessageCount

public int getMessageCount()

getMessages

public javax.mail.Message[] getMessages()

getName

public String getName()

getOrAddSubFolder

public MailboxFolder getOrAddSubFolder(String name)
                                throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getParent

public MailboxFolder getParent()

getSizeInBytes

public int getSizeInBytes()
                   throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getUID

public long getUID(javax.mail.Message msg)

getUidValidity

public long getUidValidity()
Returns:
the uidValidity

getUniqueMessageId

protected long getUniqueMessageId()
Returns:
the uniqueMessageId

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hasMessages

public boolean hasMessages()

invalidateUid

public void invalidateUid()

isExists

public boolean isExists()
Returns:
the exists

isInbox

public boolean isInbox()

isRoot

public boolean isRoot()

isSimulateError

public boolean isSimulateError()
Returns:
the simulateError

isSubscribed

protected boolean isSubscribed()

markMessageAsDeleted

public void markMessageAsDeleted(javax.mail.Message e)
                          throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

markMessageAsSeen

public void markMessageAsSeen(javax.mail.Message e)
                       throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

onFlagChange

public void onFlagChange(MockMessage msg,
                         javax.mail.Flags flags,
                         boolean set)
Specified by:
onFlagChange in interface MockMessage.FlagChangeListener

removeMailboxEventListener

public void removeMailboxEventListener(MailboxFolder.MailboxEventListener l)

renameFolder

public void renameFolder(String newName)

search

public javax.mail.Message[] search(javax.mail.search.SearchTerm term,
                                   javax.mail.Message[] msgsToSearch)

setSimulateError

public void setSimulateError(boolean simulateError)
Parameters:
simulateError - the simulateError to set

setSubscribed

protected void setSubscribed(boolean subscribed)


Copyright © 2014. All rights reserved.