public abstract class AbstractImapFolder extends Object implements com.icegreen.greenmail.store.MailFolder
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractImapFolder.CommandCallback<T> |
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
protected static int |
MAX_RETRIES |
protected ServiceRegistry |
serviceRegistry |
Constructor and Description |
---|
AbstractImapFolder(ServiceRegistry serviceRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(com.icegreen.greenmail.store.FolderListener listener)
Adds
FolderListener to the folder. |
long |
appendMessage(MimeMessage message,
Flags flags,
Date internalDate)
Appends message to the folder.
|
protected abstract long |
appendMessageInternal(MimeMessage message,
Flags flags,
Date internalDate) |
protected void |
checkParameter(Object parameter,
String name)
Method that checks mandatory parameter.
|
long |
copyMessage(long uid,
com.icegreen.greenmail.store.MailFolder toFolder)
Copies message with the given UID to the specified
MailFolder . |
protected abstract long |
copyMessageInternal(long uid,
com.icegreen.greenmail.store.MailFolder toFolder) |
void |
deleteAllMessages()
Marks all messages in the folder as deleted using
Flags.Flag.DELETED flag. |
protected abstract void |
deleteAllMessagesInternal() |
void |
expunge()
Deletes messages marked with
Flags.Flag.DELETED . |
void |
expunge(long uid)
Deletes messages marked with
Flags.Flag.DELETED . |
protected abstract void |
expungeInternal() |
protected abstract void |
expungeInternal(long uid) |
com.icegreen.greenmail.store.SimpleStoredMessage |
getMessage(long uid)
Returns message by its UID.
|
protected abstract com.icegreen.greenmail.store.SimpleStoredMessage |
getMessageInternal(long uid) |
List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessages()
Returns list of all messages in the folder.
|
List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessages(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
Returns list of messages by filter.
|
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessagesInternal() |
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter) |
List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getNonDeletedMessages()
Returns the list of messages that have no
Flags.Flag.DELETED flag set for current user. |
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getNonDeletedMessagesInternal() |
protected abstract boolean |
isReadOnly() |
protected void |
notifyFlagUpdate(int msn,
Flags flags,
Long uidNotification,
com.icegreen.greenmail.store.FolderListener silentListener) |
void |
removeListener(com.icegreen.greenmail.store.FolderListener listener)
Removes
FolderListener from the folder. |
void |
replaceFlags(Flags flags,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Replaces flags for the message with the given UID.
|
protected abstract void |
replaceFlagsInternal(Flags flags,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid) |
long[] |
search(SearchTerm searchTerm)
Searches the mailbox for messages that match the given searching criteria
|
protected abstract long[] |
searchInternal(SearchTerm searchTerm) |
void |
setFlags(Flags flags,
boolean value,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Sets flags for the message with the given UID.
|
protected abstract void |
setFlagsInternal(Flags flags,
boolean value,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid) |
void |
signalDeletion()
Method is called before the deletion of the folder.
|
void |
store(MimeMessage message)
Not supported.
|
void |
store(com.icegreen.greenmail.mail.MovingMessage mail)
Not supported.
|
protected org.apache.commons.logging.Log logger
protected ServiceRegistry serviceRegistry
protected static int MAX_RETRIES
public AbstractImapFolder(ServiceRegistry serviceRegistry)
protected void checkParameter(Object parameter, String name)
parameter
- The parameter instance to check.name
- The name of the parameter.public long appendMessage(MimeMessage message, Flags flags, Date internalDate) throws com.icegreen.greenmail.store.FolderException
appendMessage
in interface com.icegreen.greenmail.store.MailFolder
message
- - message.flags
- - message flags.internalDate
- - not used. Current date used instead.com.icegreen.greenmail.store.FolderException
public long copyMessage(long uid, com.icegreen.greenmail.store.MailFolder toFolder) throws com.icegreen.greenmail.store.FolderException
MailFolder
.copyMessage
in interface com.icegreen.greenmail.store.MailFolder
uid
- - UID of the messagetoFolder
- - reference to the destination folder.com.icegreen.greenmail.store.FolderException
public void deleteAllMessages() throws com.icegreen.greenmail.store.FolderException
Flags.Flag.DELETED
flag.deleteAllMessages
in interface com.icegreen.greenmail.store.MailFolder
com.icegreen.greenmail.store.FolderException
public void expunge() throws com.icegreen.greenmail.store.FolderException
Flags.Flag.DELETED
. Note that this message deletes all messages with this flag.expunge
in interface com.icegreen.greenmail.store.MailFolder
com.icegreen.greenmail.store.FolderException
public void expunge(long uid) throws com.icegreen.greenmail.store.FolderException
Flags.Flag.DELETED
. Note that this message deletes the messages with current uidexpunge
in interface com.icegreen.greenmail.store.MailFolder
com.icegreen.greenmail.store.FolderException
public com.icegreen.greenmail.store.SimpleStoredMessage getMessage(long uid)
getMessage
in interface com.icegreen.greenmail.store.MailFolder
uid
- - UID of the message.public List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessages()
getMessages
in interface com.icegreen.greenmail.store.MailFolder
SimpleStoredMessage
objects.public List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessages(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
getMessages
in interface com.icegreen.greenmail.store.MailFolder
msgRangeFilter
- - MsgRangeFilter
object representing filter.public List<com.icegreen.greenmail.store.SimpleStoredMessage> getNonDeletedMessages()
Flags.Flag.DELETED
flag set for current user.getNonDeletedMessages
in interface com.icegreen.greenmail.store.MailFolder
public void replaceFlags(Flags flags, long uid, com.icegreen.greenmail.store.FolderListener silentListener, boolean addUid) throws com.icegreen.greenmail.store.FolderException
addUid
is set to
true
FolderListener
objects defined for this folder will be notified.
silentListener
can be provided - this listener wouldn't be notified.replaceFlags
in interface com.icegreen.greenmail.store.MailFolder
flags
- - new flags.uid
- - message UID.silentListener
- - listener that shouldn't be notified.addUid
- - defines whether or not listeners be notified.com.icegreen.greenmail.store.FolderException
public long[] search(SearchTerm searchTerm)
search
in interface com.icegreen.greenmail.store.MailFolder
searchTerm
- - search term that contains search criteria.public void setFlags(Flags flags, boolean value, long uid, com.icegreen.greenmail.store.FolderListener silentListener, boolean addUid) throws com.icegreen.greenmail.store.FolderException
addUid
is set to true
FolderListener
objects defined for this folder will be notified.
silentListener
can be provided - this listener wouldn't be notified.setFlags
in interface com.icegreen.greenmail.store.MailFolder
flags
- - new flags.value
- - flags value.uid
- - message UID.silentListener
- - listener that shouldn't be notified.addUid
- - defines whether or not listeners be notified.com.icegreen.greenmail.store.FolderException
public void store(com.icegreen.greenmail.mail.MovingMessage mail) throws Exception
MailFolder.store(MovingMessage)
.store
in interface com.icegreen.greenmail.store.MailFolder
Exception
public void store(MimeMessage message) throws Exception
MailFolder.store(MimeMessage)
.store
in interface com.icegreen.greenmail.store.MailFolder
Exception
public void addListener(com.icegreen.greenmail.store.FolderListener listener)
FolderListener
to the folder.addListener
in interface com.icegreen.greenmail.store.MailFolder
listener
- - new listener.public void removeListener(com.icegreen.greenmail.store.FolderListener listener)
FolderListener
from the folder.removeListener
in interface com.icegreen.greenmail.store.MailFolder
listener
- - Listener to remove.public void signalDeletion()
FolderListener
objects with
FolderListener.mailboxDeleted()
method calls.signalDeletion
in interface com.icegreen.greenmail.store.MailFolder
protected void notifyFlagUpdate(int msn, Flags flags, Long uidNotification, com.icegreen.greenmail.store.FolderListener silentListener)
protected abstract boolean isReadOnly()
protected abstract long appendMessageInternal(MimeMessage message, Flags flags, Date internalDate) throws Exception
Exception
protected abstract long copyMessageInternal(long uid, com.icegreen.greenmail.store.MailFolder toFolder) throws Exception
Exception
protected abstract void deleteAllMessagesInternal() throws Exception
Exception
protected abstract void expungeInternal(long uid) throws Exception
Exception
protected abstract com.icegreen.greenmail.store.SimpleStoredMessage getMessageInternal(long uid) throws Exception
Exception
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessagesInternal()
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
protected abstract List<com.icegreen.greenmail.store.SimpleStoredMessage> getNonDeletedMessagesInternal()
protected abstract void replaceFlagsInternal(Flags flags, long uid, com.icegreen.greenmail.store.FolderListener silentListener, boolean addUid) throws Exception
Exception
protected abstract long[] searchInternal(SearchTerm searchTerm)
Copyright © 2005–2017 Alfresco Software. All rights reserved.