public class SelectedMailboxImpl extends Object implements SelectedMailbox, org.apache.james.mailbox.MailboxListener
SelectedMailboxorg.apache.james.mailbox.MailboxListener.Added, org.apache.james.mailbox.MailboxListener.Event, org.apache.james.mailbox.MailboxListener.Expunged, org.apache.james.mailbox.MailboxListener.FlagsUpdated, org.apache.james.mailbox.MailboxListener.MailboxACLUpdated, org.apache.james.mailbox.MailboxListener.MailboxAdded, org.apache.james.mailbox.MailboxListener.MailboxDeletion, org.apache.james.mailbox.MailboxListener.MailboxRenamed, org.apache.james.mailbox.MailboxListener.MessageEventNO_SUCH_MESSAGE| Constructor and Description |
|---|
SelectedMailboxImpl(org.apache.james.mailbox.MailboxManager mailboxManager,
ImapSession session,
org.apache.james.mailbox.model.MailboxPath path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addRecent(long uid)
Add a recent uid
|
void |
deselect()
Deselect the Mailbox
|
void |
event(org.apache.james.mailbox.MailboxListener.Event event) |
long |
existsCount()
Return the count of all existing uids
|
Collection<Long> |
expungedUids()
Return a unmodifiable
Collection of uids that where expunged |
Collection<Long> |
flagUpdateUids()
Return a unmodifiable
Collection of uids which have updated flags |
javax.mail.Flags |
getApplicableFlags()
Return all applicable Flags for the selected mailbox
|
long |
getFirstUid()
Return the uid of the first message in the mailbox or -1 if the mailbox
is empty
|
long |
getLastUid()
Return the uid of the last message in the mailbox or -1 if the mailbox is
empty
|
org.apache.james.mailbox.model.MailboxPath |
getPath()
Return the path of the selected Mailbox
|
Collection<Long> |
getRecent()
Return a Collection of all recent uids
|
boolean |
hasNewApplicableFlags() |
boolean |
isDeletedByOtherSession()
Is the mailbox deleted?
|
boolean |
isRecent(long uid)
Is the given uid recent ?
|
boolean |
isRecentUidRemoved()
Was the recent uid removed ?
|
boolean |
isSilentFlagChanges()
Are flag changes from current session ignored?
|
boolean |
isSizeChanged()
Has the size of the mailbox changed?
|
int |
msn(long uid)
Return the msg index of the given uid or
SelectedMailbox.NO_SUCH_MESSAGE if no
message with the given uid was found |
int |
recentCount()
Return the count of all recent uids
|
int |
remove(Long uid)
Removes the given UID.
|
boolean |
removeRecent(long uid)
Remove a recent uid
|
void |
resetEvents()
Reset all events
|
void |
resetExpungedUids() |
void |
resetNewApplicableFlags() |
void |
resetRecentUidRemoved() |
void |
setSilentFlagChanges(boolean silentFlagChanges)
Sets whether changes from current session should be ignored.
|
long |
uid(int msn)
Return the uid of the message for the given index or
SelectedMailbox.NO_SUCH_MESSAGE if no message with the given index was found |
public SelectedMailboxImpl(org.apache.james.mailbox.MailboxManager mailboxManager,
ImapSession session,
org.apache.james.mailbox.model.MailboxPath path)
throws org.apache.james.mailbox.exception.MailboxException
org.apache.james.mailbox.exception.MailboxExceptionpublic long getFirstUid()
SelectedMailboxgetFirstUid in interface SelectedMailboxSelectedMailbox.getFirstUid()public long getLastUid()
SelectedMailboxgetLastUid in interface SelectedMailboxSelectedMailbox.getLastUid()public void deselect()
SelectedMailboxdeselect in interface SelectedMailboxpublic boolean removeRecent(long uid)
SelectedMailboxremoveRecent in interface SelectedMailboxSelectedMailbox.removeRecent(long)public boolean addRecent(long uid)
SelectedMailboxaddRecent in interface SelectedMailboxSelectedMailbox.addRecent(long)public Collection<Long> getRecent()
SelectedMailboxgetRecent in interface SelectedMailboxSelectedMailbox.getRecent()public int recentCount()
SelectedMailboxrecentCount in interface SelectedMailboxSelectedMailbox.recentCount()public org.apache.james.mailbox.model.MailboxPath getPath()
SelectedMailboxgetPath in interface SelectedMailboxSelectedMailbox.getPath()public boolean isRecent(long uid)
SelectedMailboxisRecent in interface SelectedMailboxSelectedMailbox.isRecent(long)public boolean isRecentUidRemoved()
SelectedMailboxisRecentUidRemoved in interface SelectedMailboxSelectedMailbox.isRecentUidRemoved()public void resetRecentUidRemoved()
resetRecentUidRemoved in interface SelectedMailboxSelectedMailbox.resetRecentUidRemoved()public void resetEvents()
SelectedMailboxresetEvents in interface SelectedMailboxSelectedMailbox.resetEvents()public int remove(Long uid)
SelectedMailboxremove in interface SelectedMailboxuid - not nullSelectedMailbox.NO_SUCH_MESSAGE if no message with the given uid was
found being expungedSelectedMailbox.remove(java.lang.Long)public void resetExpungedUids()
resetExpungedUids in interface SelectedMailboxpublic final boolean isSilentFlagChanges()
public final void setSilentFlagChanges(boolean silentFlagChanges)
silentFlagChanges - true if any flag changes from current session should be
ignored, false otherwisepublic final boolean isSizeChanged()
isSizeChanged in interface SelectedMailboxpublic final boolean isDeletedByOtherSession()
isDeletedByOtherSession in interface SelectedMailboxpublic Collection<Long> flagUpdateUids()
Collection of uids which have updated flagsflagUpdateUids in interface SelectedMailboxpublic Collection<Long> expungedUids()
Collection of uids that where expungedexpungedUids in interface SelectedMailboxpublic javax.mail.Flags getApplicableFlags()
SelectedMailboxgetApplicableFlags in interface SelectedMailboxpublic boolean hasNewApplicableFlags()
hasNewApplicableFlags in interface SelectedMailboxpublic void resetNewApplicableFlags()
resetNewApplicableFlags in interface SelectedMailboxpublic void event(org.apache.james.mailbox.MailboxListener.Event event)
event in interface org.apache.james.mailbox.MailboxListenerpublic int msn(long uid)
SelectedMailboxSelectedMailbox.NO_SUCH_MESSAGE if no
message with the given uid was foundmsn in interface SelectedMailboxpublic long uid(int msn)
SelectedMailboxSelectedMailbox.NO_SUCH_MESSAGE if no message with the given index was founduid in interface SelectedMailboxpublic long existsCount()
SelectedMailboxexistsCount in interface SelectedMailboxCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.