public class SelectedMailboxImpl extends Object implements SelectedMailbox, org.apache.james.mailbox.MailboxListener
SelectedMailbox
org.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.MessageEvent
NO_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.MailboxException
public long getFirstUid()
SelectedMailbox
getFirstUid
in interface SelectedMailbox
SelectedMailbox.getFirstUid()
public long getLastUid()
SelectedMailbox
getLastUid
in interface SelectedMailbox
SelectedMailbox.getLastUid()
public void deselect()
SelectedMailbox
deselect
in interface SelectedMailbox
public boolean removeRecent(long uid)
SelectedMailbox
removeRecent
in interface SelectedMailbox
SelectedMailbox.removeRecent(long)
public boolean addRecent(long uid)
SelectedMailbox
addRecent
in interface SelectedMailbox
SelectedMailbox.addRecent(long)
public Collection<Long> getRecent()
SelectedMailbox
getRecent
in interface SelectedMailbox
SelectedMailbox.getRecent()
public int recentCount()
SelectedMailbox
recentCount
in interface SelectedMailbox
SelectedMailbox.recentCount()
public org.apache.james.mailbox.model.MailboxPath getPath()
SelectedMailbox
getPath
in interface SelectedMailbox
SelectedMailbox.getPath()
public boolean isRecent(long uid)
SelectedMailbox
isRecent
in interface SelectedMailbox
SelectedMailbox.isRecent(long)
public boolean isRecentUidRemoved()
SelectedMailbox
isRecentUidRemoved
in interface SelectedMailbox
SelectedMailbox.isRecentUidRemoved()
public void resetRecentUidRemoved()
resetRecentUidRemoved
in interface SelectedMailbox
SelectedMailbox.resetRecentUidRemoved()
public void resetEvents()
SelectedMailbox
resetEvents
in interface SelectedMailbox
SelectedMailbox.resetEvents()
public int remove(Long uid)
SelectedMailbox
remove
in interface SelectedMailbox
uid
- 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 SelectedMailbox
public 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 SelectedMailbox
public final boolean isDeletedByOtherSession()
isDeletedByOtherSession
in interface SelectedMailbox
public Collection<Long> flagUpdateUids()
Collection
of uids which have updated flagsflagUpdateUids
in interface SelectedMailbox
public Collection<Long> expungedUids()
Collection
of uids that where expungedexpungedUids
in interface SelectedMailbox
public javax.mail.Flags getApplicableFlags()
SelectedMailbox
getApplicableFlags
in interface SelectedMailbox
public boolean hasNewApplicableFlags()
hasNewApplicableFlags
in interface SelectedMailbox
public void resetNewApplicableFlags()
resetNewApplicableFlags
in interface SelectedMailbox
public void event(org.apache.james.mailbox.MailboxListener.Event event)
event
in interface org.apache.james.mailbox.MailboxListener
public int msn(long uid)
SelectedMailbox
SelectedMailbox.NO_SUCH_MESSAGE
if no
message with the given uid was foundmsn
in interface SelectedMailbox
public long uid(int msn)
SelectedMailbox
SelectedMailbox.NO_SUCH_MESSAGE
if no message with the given index was founduid
in interface SelectedMailbox
public long existsCount()
SelectedMailbox
existsCount
in interface SelectedMailbox
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.