de.saly.javamail.mock2
Class IMAPMockFolder

java.lang.Object
  extended by javax.mail.Folder
      extended by com.sun.mail.imap.IMAPFolder
          extended by de.saly.javamail.mock2.IMAPMockFolder
All Implemented Interfaces:
com.sun.mail.iap.ResponseHandler, MailboxFolder.MailboxEventListener, javax.mail.UIDFolder

public class IMAPMockFolder
extends com.sun.mail.imap.IMAPFolder
implements MailboxFolder.MailboxEventListener


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.mail.imap.IMAPFolder
com.sun.mail.imap.IMAPFolder.FetchProfileItem, com.sun.mail.imap.IMAPFolder.ProtocolCommand
 
Field Summary
protected  org.slf4j.Logger logger
           
 
Fields inherited from class com.sun.mail.imap.IMAPFolder
attributes, availableFlags, exists, fullName, isNamespace, messageCache, messageCacheLock, name, permanentFlags, protocol, separator, type, uidTable, UNKNOWN_SEPARATOR
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE
 
Fields inherited from interface javax.mail.UIDFolder
LASTUID
 
Constructor Summary
protected IMAPMockFolder(IMAPMockStore store, MailboxFolder mailboxFolder)
           
 
Method Summary
protected  void abortIdle()
           
 void appendMessages(javax.mail.Message[] msgs)
           
 com.sun.mail.imap.AppendUID[] appendUIDMessages(javax.mail.Message[] msgs)
           
protected  void checkClosed()
           
protected  void checkExists()
           
protected  void checkOpened()
           
protected  void checkWriteMode()
           
 void close(boolean expunge)
           
 void copyMessages(javax.mail.Message[] msgs, javax.mail.Folder folder)
           
 com.sun.mail.imap.AppendUID[] copyUIDMessages(javax.mail.Message[] msgs, javax.mail.Folder folder)
           
 boolean create(int type)
           
 boolean delete(boolean recurse)
           
 Object doCommand(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
           
 Object doCommandIgnoreFailure(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
           
 Object doOptionalCommand(String err, com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
           
protected  Object doProtocolCommand(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
           
 boolean exists()
           
 javax.mail.Message[] expunge()
           
 javax.mail.Message[] expunge(javax.mail.Message[] msgs)
           
 void fetch(javax.mail.Message[] msgs, javax.mail.FetchProfile fp)
           
 void folderCreated(MailboxFolder mf)
           
 void folderDeleted(MailboxFolder mf)
           
 void folderRenamed(String from, MailboxFolder to)
           
 void forceClose()
           
 String[] getAttributes()
           
 int getDeletedMessageCount()
           
 javax.mail.Folder getFolder(String name)
           
 String getFullName()
           
 long getHighestModSeq()
           
 javax.mail.Message getMessage(int msgnum)
           
 javax.mail.Message getMessageByUID(long uid)
           
 int getMessageCount()
           
 javax.mail.Message[] getMessages(int low, int high)
           
 javax.mail.Message[] getMessagesByUID(long[] uids)
           
 javax.mail.Message[] getMessagesByUID(long start, long end)
           
 javax.mail.Message[] getMessagesByUIDChangedSince(long start, long end, long modseq)
           
 String getName()
           
 int getNewMessageCount()
           
 javax.mail.Folder getParent()
           
 javax.mail.Flags getPermanentFlags()
           
 javax.mail.Quota[] getQuota()
           
 char getSeparator()
           
 javax.mail.Message[] getSortedMessages(com.sun.mail.imap.SortTerm[] term)
           
 javax.mail.Message[] getSortedMessages(com.sun.mail.imap.SortTerm[] term, javax.mail.search.SearchTerm sterm)
           
 int getType()
           
 long getUID(javax.mail.Message message)
           
 long getUIDNext()
           
 long getUIDValidity()
           
 int getUnreadMessageCount()
           
 void handleResponse(com.sun.mail.iap.Response r)
           
 boolean hasNewMessages()
           
 Map<String,String> id(Map<String,String> clientParams)
           
 void idle(boolean once)
           
 boolean isOpen()
           
 boolean isSubscribed()
           
 javax.mail.Folder[] list(String pattern)
           
 javax.mail.Folder[] listSubscribed(String pattern)
           
 void messageAdded(MailboxFolder mf, MockMessage msg)
           
 void messageChanged(MailboxFolder mf, MockMessage msg, boolean headerChanged, boolean flagsChanged)
           
 void messageExpunged(MailboxFolder mf, MockMessage msg, boolean removed)
           
 void open(int mode)
           
 List<javax.mail.event.MailEvent> open(int mode, com.sun.mail.imap.ResyncData rd)
           
 boolean renameTo(javax.mail.Folder f)
           
 javax.mail.Message[] search(javax.mail.search.SearchTerm term)
           
 javax.mail.Message[] search(javax.mail.search.SearchTerm term, javax.mail.Message[] msgs)
           
 void setFlags(javax.mail.Message[] msgs, javax.mail.Flags flag, boolean value)
           
 void setQuota(javax.mail.Quota quota)
           
 void setSubscribed(boolean subscribe)
           
 void uidInvalidated()
           
 
Methods inherited from class com.sun.mail.imap.IMAPFolder
addACL, addMessageCountListener, addMessages, addRights, checkRange, getACL, getEnvelopeCommand, getMessageBySeqNumber, getProtocol, getStatusItem, getStoreProtocol, idle, keepConnectionAlive, listRights, myRights, newIMAPMessage, releaseProtocol, releaseStoreProtocol, removeACL, removeRights, setFlags, setFlags, throwClosedException
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, finalize, getMessages, getMessages, getMode, getStore, getURLName, list, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

IMAPMockFolder

protected IMAPMockFolder(IMAPMockStore store,
                         MailboxFolder mailboxFolder)
Method Detail

abortIdle

protected void abortIdle()

appendMessages

public void appendMessages(javax.mail.Message[] msgs)
                    throws javax.mail.MessagingException
Overrides:
appendMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

appendUIDMessages

public com.sun.mail.imap.AppendUID[] appendUIDMessages(javax.mail.Message[] msgs)
                                                throws javax.mail.MessagingException
Overrides:
appendUIDMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

checkClosed

protected void checkClosed()
Overrides:
checkClosed in class com.sun.mail.imap.IMAPFolder

checkExists

protected void checkExists()
                    throws javax.mail.MessagingException
Overrides:
checkExists in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

checkOpened

protected void checkOpened()
                    throws javax.mail.FolderClosedException
Overrides:
checkOpened in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.FolderClosedException

checkWriteMode

protected void checkWriteMode()

close

public void close(boolean expunge)
           throws javax.mail.MessagingException
Overrides:
close in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

copyMessages

public void copyMessages(javax.mail.Message[] msgs,
                         javax.mail.Folder folder)
                  throws javax.mail.MessagingException
Overrides:
copyMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

copyUIDMessages

public com.sun.mail.imap.AppendUID[] copyUIDMessages(javax.mail.Message[] msgs,
                                                     javax.mail.Folder folder)
                                              throws javax.mail.MessagingException
Overrides:
copyUIDMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

create

public boolean create(int type)
               throws javax.mail.MessagingException
Overrides:
create in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

delete

public boolean delete(boolean recurse)
               throws javax.mail.MessagingException
Overrides:
delete in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

doCommand

public Object doCommand(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
                 throws javax.mail.MessagingException
Overrides:
doCommand in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

doCommandIgnoreFailure

public Object doCommandIgnoreFailure(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
                              throws javax.mail.MessagingException
Overrides:
doCommandIgnoreFailure in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

doOptionalCommand

public Object doOptionalCommand(String err,
                                com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
                         throws javax.mail.MessagingException
Overrides:
doOptionalCommand in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

doProtocolCommand

protected Object doProtocolCommand(com.sun.mail.imap.IMAPFolder.ProtocolCommand cmd)
                            throws com.sun.mail.iap.ProtocolException
Overrides:
doProtocolCommand in class com.sun.mail.imap.IMAPFolder
Throws:
com.sun.mail.iap.ProtocolException

exists

public boolean exists()
               throws javax.mail.MessagingException
Overrides:
exists in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

expunge

public javax.mail.Message[] expunge()
                             throws javax.mail.MessagingException
Overrides:
expunge in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

expunge

public javax.mail.Message[] expunge(javax.mail.Message[] msgs)
                             throws javax.mail.MessagingException
Overrides:
expunge in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

fetch

public void fetch(javax.mail.Message[] msgs,
                  javax.mail.FetchProfile fp)
           throws javax.mail.MessagingException
Overrides:
fetch in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

folderCreated

public void folderCreated(MailboxFolder mf)
Specified by:
folderCreated in interface MailboxFolder.MailboxEventListener

folderDeleted

public void folderDeleted(MailboxFolder mf)
Specified by:
folderDeleted in interface MailboxFolder.MailboxEventListener

folderRenamed

public void folderRenamed(String from,
                          MailboxFolder to)
Specified by:
folderRenamed in interface MailboxFolder.MailboxEventListener

forceClose

public void forceClose()
                throws javax.mail.MessagingException
Overrides:
forceClose in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getAttributes

public String[] getAttributes()
                       throws javax.mail.MessagingException
Overrides:
getAttributes in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getDeletedMessageCount

public int getDeletedMessageCount()
                           throws javax.mail.MessagingException
Overrides:
getDeletedMessageCount in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getFolder

public javax.mail.Folder getFolder(String name)
                            throws javax.mail.MessagingException
Overrides:
getFolder in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getFullName

public String getFullName()
Overrides:
getFullName in class com.sun.mail.imap.IMAPFolder

getHighestModSeq

public long getHighestModSeq()
                      throws javax.mail.MessagingException
Overrides:
getHighestModSeq in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessage

public javax.mail.Message getMessage(int msgnum)
                              throws javax.mail.MessagingException
Overrides:
getMessage in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessageByUID

public javax.mail.Message getMessageByUID(long uid)
                                   throws javax.mail.MessagingException
Specified by:
getMessageByUID in interface javax.mail.UIDFolder
Overrides:
getMessageByUID in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessageCount

public int getMessageCount()
                    throws javax.mail.MessagingException
Overrides:
getMessageCount in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessages

public javax.mail.Message[] getMessages(int low,
                                        int high)
                                 throws javax.mail.MessagingException
Overrides:
getMessages in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long start,
                                             long end)
                                      throws javax.mail.MessagingException
Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
Overrides:
getMessagesByUID in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long[] uids)
                                      throws javax.mail.MessagingException
Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
Overrides:
getMessagesByUID in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getMessagesByUIDChangedSince

public javax.mail.Message[] getMessagesByUIDChangedSince(long start,
                                                         long end,
                                                         long modseq)
                                                  throws javax.mail.MessagingException
Overrides:
getMessagesByUIDChangedSince in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getName

public String getName()
Overrides:
getName in class com.sun.mail.imap.IMAPFolder

getNewMessageCount

public int getNewMessageCount()
                       throws javax.mail.MessagingException
Overrides:
getNewMessageCount in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getParent

public javax.mail.Folder getParent()
                            throws javax.mail.MessagingException
Overrides:
getParent in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getPermanentFlags

public javax.mail.Flags getPermanentFlags()
Overrides:
getPermanentFlags in class com.sun.mail.imap.IMAPFolder

getQuota

public javax.mail.Quota[] getQuota()
                            throws javax.mail.MessagingException
Overrides:
getQuota in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getSeparator

public char getSeparator()
                  throws javax.mail.MessagingException
Overrides:
getSeparator in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getSortedMessages

public javax.mail.Message[] getSortedMessages(com.sun.mail.imap.SortTerm[] term)
                                       throws javax.mail.MessagingException
Overrides:
getSortedMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getSortedMessages

public javax.mail.Message[] getSortedMessages(com.sun.mail.imap.SortTerm[] term,
                                              javax.mail.search.SearchTerm sterm)
                                       throws javax.mail.MessagingException
Overrides:
getSortedMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getType

public int getType()
            throws javax.mail.MessagingException
Overrides:
getType in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getUID

public long getUID(javax.mail.Message message)
            throws javax.mail.MessagingException
Specified by:
getUID in interface javax.mail.UIDFolder
Overrides:
getUID in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getUIDNext

public long getUIDNext()
                throws javax.mail.MessagingException
Overrides:
getUIDNext in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getUIDValidity

public long getUIDValidity()
                    throws javax.mail.MessagingException
Specified by:
getUIDValidity in interface javax.mail.UIDFolder
Overrides:
getUIDValidity in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

getUnreadMessageCount

public int getUnreadMessageCount()
                          throws javax.mail.MessagingException
Overrides:
getUnreadMessageCount in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

handleResponse

public void handleResponse(com.sun.mail.iap.Response r)
Specified by:
handleResponse in interface com.sun.mail.iap.ResponseHandler
Overrides:
handleResponse in class com.sun.mail.imap.IMAPFolder

hasNewMessages

public boolean hasNewMessages()
                       throws javax.mail.MessagingException
Overrides:
hasNewMessages in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

id

public Map<String,String> id(Map<String,String> clientParams)
                      throws javax.mail.MessagingException
Overrides:
id in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

idle

public void idle(boolean once)
          throws javax.mail.MessagingException
Overrides:
idle in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

isOpen

public boolean isOpen()
Overrides:
isOpen in class com.sun.mail.imap.IMAPFolder

isSubscribed

public boolean isSubscribed()
Overrides:
isSubscribed in class com.sun.mail.imap.IMAPFolder

list

public javax.mail.Folder[] list(String pattern)
                         throws javax.mail.MessagingException
Overrides:
list in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

listSubscribed

public javax.mail.Folder[] listSubscribed(String pattern)
                                   throws javax.mail.MessagingException
Overrides:
listSubscribed in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

messageAdded

public void messageAdded(MailboxFolder mf,
                         MockMessage msg)
Specified by:
messageAdded in interface MailboxFolder.MailboxEventListener

messageChanged

public void messageChanged(MailboxFolder mf,
                           MockMessage msg,
                           boolean headerChanged,
                           boolean flagsChanged)
Specified by:
messageChanged in interface MailboxFolder.MailboxEventListener

messageExpunged

public void messageExpunged(MailboxFolder mf,
                            MockMessage msg,
                            boolean removed)
Specified by:
messageExpunged in interface MailboxFolder.MailboxEventListener

open

public void open(int mode)
          throws javax.mail.MessagingException
Overrides:
open in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

open

public List<javax.mail.event.MailEvent> open(int mode,
                                             com.sun.mail.imap.ResyncData rd)
                                      throws javax.mail.MessagingException
Overrides:
open in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

renameTo

public boolean renameTo(javax.mail.Folder f)
                 throws javax.mail.MessagingException
Overrides:
renameTo in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

search

public javax.mail.Message[] search(javax.mail.search.SearchTerm term)
                            throws javax.mail.MessagingException
Overrides:
search in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

search

public javax.mail.Message[] search(javax.mail.search.SearchTerm term,
                                   javax.mail.Message[] msgs)
                            throws javax.mail.MessagingException
Overrides:
search in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

setFlags

public void setFlags(javax.mail.Message[] msgs,
                     javax.mail.Flags flag,
                     boolean value)
              throws javax.mail.MessagingException
Overrides:
setFlags in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

setQuota

public void setQuota(javax.mail.Quota quota)
              throws javax.mail.MessagingException
Overrides:
setQuota in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

setSubscribed

public void setSubscribed(boolean subscribe)
                   throws javax.mail.MessagingException
Overrides:
setSubscribed in class com.sun.mail.imap.IMAPFolder
Throws:
javax.mail.MessagingException

uidInvalidated

public void uidInvalidated()
Specified by:
uidInvalidated in interface MailboxFolder.MailboxEventListener


Copyright © 2014. All rights reserved.