com.openexchange.mail.api
Interface IMailMessageStorageBatch

All Superinterfaces:
IMailMessageStorage

public interface IMailMessageStorageBatch
extends IMailMessageStorage

IMailMessageStorageBatch - Extends IMailMessageStorage for mail systems which support to request single header names.

Author:
Thorben Betten

Field Summary
 
Fields inherited from interface com.openexchange.mail.api.IMailMessageStorage
EMPTY_RETVAL
 
Method Summary
 void updateMessageColorLabel(java.lang.String folder, int colorLabel)
          An optional method that updates the color label of all messages located in given folder.
 void updateMessageFlags(java.lang.String folder, int flags, boolean set)
          Updates the flags of all messages located in given folder.
 
Methods inherited from interface com.openexchange.mail.api.IMailMessageStorage
appendMessages, copyMessages, deleteMessages, getAllMessages, getAttachment, getDeletedMessages, getImageAttachment, getMessage, getMessages, getNewAndModifiedMessages, getThreadSortedMessages, getUnreadMessages, moveMessages, releaseResources, saveDraft, searchMessages, updateMessageColorLabel, updateMessageFlags
 

Method Detail

updateMessageColorLabel

void updateMessageColorLabel(java.lang.String folder,
                             int colorLabel)
                             throws MailException
An optional method that updates the color label of all messages located in given folder.

If no mail could be found for a given mail ID, it is treated as a no-op.

The underlying mailing system needs to support some kind of user-definable flags to support this method. Otherwise this method should be left unchanged with an empty body.

The color labels are user flags with the common prefix "cl_" and its numeric color code appended (currently numbers 0 to 10).

Parameters:
folder - The folder full name
colorLabel - The color label to apply
Throws:
MailException - If color label cannot be updated

updateMessageFlags

void updateMessageFlags(java.lang.String folder,
                        int flags,
                        boolean set)
                        throws MailException
Updates the flags of all messages located in given folder. If parameter set is true the affected flags denoted by flags are added; otherwise removed.

If no mail could be found for a given mail ID, it is treated as a no-op.

System flags are:

If mail folder in question supports user flags (storing individual strings per message) the virtual flags can also be updated through this routine; e.g. MailMessage.FLAG_FORWARDED.

Moreover this routine checks for any spam related actions; meaning the MailMessage.FLAG_SPAM shall be enabled/disabled. Thus the SpamHandler#handleSpam(String, String[], boolean, MailAccess)/ SpamHandler#handleHam(String, String[], boolean, MailAccess) methods needs to be executed.

Parameters:
folder - The folder full name
flags - The bit pattern for the flags to alter
set - true to enable the flags; otherwise false
Throws:
MailException - If system flags cannot be updated