public interface MessageManager
MessageManager
should be valid for the whole MailboxSession
Modifier and Type | Interface and Description |
---|---|
static interface |
MessageManager.MetaData
Meta data about the current state of the mailbox.
|
Modifier and Type | Method and Description |
---|---|
long |
appendMessage(InputStream msgIn,
Date internalDate,
MailboxSession mailboxSession,
boolean isRecent,
javax.mail.Flags flags)
Appends a message to this mailbox.
|
Iterator<Long> |
expunge(MessageRange set,
MailboxSession mailboxSession)
Expunges messages in the given range from this mailbox.
|
long |
getMessageCount(MailboxSession mailboxSession)
|
MessageResultIterator |
getMessages(MessageRange set,
MessageResult.FetchGroup fetchGroup,
MailboxSession mailboxSession)
Gets messages in the given range.
|
MessageManager.MetaData |
getMetaData(boolean resetRecent,
MailboxSession mailboxSession,
MessageManager.MetaData.FetchGroup fetchGroup)
Gets current meta data for the mailbox.
Consolidates common calls together to allow improved performance. The meta-data returned should be immutable and represent the current state of the mailbox. |
boolean |
hasRight(MailboxACL.MailboxACLRight right,
MailboxSession session)
Tells whether the given
MailboxSession 's user has the given
MailboxACL.MailboxACLRight for this MessageManager 's mailbox. |
boolean |
isModSeqPermanent(MailboxSession session)
|
boolean |
isWriteable(MailboxSession session)
|
MailboxACL.MailboxACLRights[] |
listRigths(MailboxACL.MailboxACLEntryKey identifier,
MailboxSession session)
Computes a result suitable for the LISTRIGHTS IMAP command.
|
MailboxACL.MailboxACLRights |
myRights(MailboxSession session)
Returns the rights applicable to the user who has sent the current
request.
|
Iterator<Long> |
search(SearchQuery searchQuery,
MailboxSession mailboxSession)
Searches for messages matching the given query.
|
Map<Long,javax.mail.Flags> |
setFlags(javax.mail.Flags flags,
boolean value,
boolean replace,
MessageRange set,
MailboxSession mailboxSession)
Sets flags on messages within the given range.
|
void |
setRights(MailboxACL.MailboxACLEntryKey identifier,
MailboxACL.EditMode editMode,
MailboxACL.MailboxACLRights mailboxAclRights)
TODO setRights.
|
@Deprecated long getMessageCount(MailboxSession mailboxSession) throws MailboxException
getMetaData(boolean, MailboxSession, org.apache.james.mailbox.MessageManager.MetaData.FetchGroup)
mailboxSession
- MailboxException
@Deprecated boolean isWriteable(MailboxSession session) throws MailboxException
getMetaData(boolean, MailboxSession, org.apache.james.mailbox.MessageManager.MetaData.FetchGroup)
session
- MailboxException
boolean isModSeqPermanent(MailboxSession session)
getMetaData(boolean, MailboxSession, org.apache.james.mailbox.MessageManager.MetaData.FetchGroup)
MessageMetaData.getModSeq()
is stored in a permanent
way.session
- Iterator<Long> search(SearchQuery searchQuery, MailboxSession mailboxSession) throws MailboxException
mailboxSession
- not nullUnsupportedCriteriaException
- when any of the search parameters are not supported by this
mailboxMailboxException
- when search fails for other reasonsIterator<Long> expunge(MessageRange set, MailboxSession mailboxSession) throws MailboxException
set
- not nullmailboxSession
- not nullMailboxException
- if anything went wrongMap<Long,javax.mail.Flags> setFlags(javax.mail.Flags flags, boolean value, boolean replace, MessageRange set, MailboxSession mailboxSession) throws MailboxException
flags
- Flags to be setvalue
- true = set, false = unsetreplace
- replace all Flags with this flags, value has to be trueset
- the range of messagesmailboxSession
- not nullMailboxException
long appendMessage(InputStream msgIn, Date internalDate, MailboxSession mailboxSession, boolean isRecent, javax.mail.Flags flags) throws MailboxException
internalDate
- the time of addition to be set, not nullmailboxSession
- not nullisRecent
- true when the message should be marked recent, false otherwiseflags
- optionally set these flags on created message, or null when no
additional flags should be setMailboxException
- when message cannot be appendedMessageResultIterator getMessages(MessageRange set, MessageResult.FetchGroup fetchGroup, MailboxSession mailboxSession) throws MailboxException
MessageResultIterator.getException()
returns null
after Iterator.hasNext()
returns false
.set
- fetchGroup
- data to fetchmailboxSession
- not nullMailboxException
boolean hasRight(MailboxACL.MailboxACLRight right, MailboxSession session) throws MailboxException
MailboxSession
's user has the given
MailboxACL.MailboxACLRight
for this MessageManager
's mailbox.right
- session
- MailboxSession
's user has the given
MailboxACL.MailboxACLRight
for this MessageManager
's
mailbox; false otherwise.MailboxException
MailboxACL.MailboxACLRights myRights(MailboxSession session) throws MailboxException
session
- SimpleMailboxACL.NO_RIGHTS
if
session.getUser()
is null.UnsupportedRightException
MailboxException
MailboxACL.MailboxACLRights[] listRigths(MailboxACL.MailboxACLEntryKey identifier, MailboxSession session) throws UnsupportedRightException
identifier
.
From RFC 4314 section 3.7:
The first element of the resulting array contains the (possibly empty)
set of rights the identifier will always be granted in the mailbox.
Following this are zero or more right sets the identifier can be granted
in the mailbox. Rights mentioned in the same set are tied together. The
server MUST either grant all tied rights to the identifier in the mailbox
or grant none.
The same right MUST NOT be listed more than once in the LISTRIGHTS
command.identifier
- the identifier from the LISTRIGHTS command.session
- UnsupportedRightException
void setRights(MailboxACL.MailboxACLEntryKey identifier, MailboxACL.EditMode editMode, MailboxACL.MailboxACLRights mailboxAclRights) throws UnsupportedRightException
identifier
- editMode
- mailboxAclRights
- UnsupportedRightException
MessageManager.MetaData getMetaData(boolean resetRecent, MailboxSession mailboxSession, MessageManager.MetaData.FetchGroup fetchGroup) throws MailboxException
resetRecent
- true when recent flags should be reset, false otherwisemailboxSession
- context, not nullfetchGroup
- describes which optional data should be returnedMailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.