public class InMemoryStore extends Object implements Store, ImapConstants
Store, used for testing
and development. Note: this implementation does not persist *anything* to disk.BAD, BYE, HIERARCHY_DELIMITER, HIERARCHY_DELIMITER_CHAR, INBOX_NAME, MESSAGES, NAMESPACE_PREFIX, NAMESPACE_PREFIX_CHAR, NO, OK, SP, STORAGE, UNTAGGED, USER_NAMESPACE, VERSION| Constructor and Description |
|---|
InMemoryStore() |
| Modifier and Type | Method and Description |
|---|---|
MailFolder |
createMailbox(MailFolder parent,
String mailboxName,
boolean selectable)
Creates a mailbox under the supplied parent with the given name.
|
void |
deleteMailbox(MailFolder folder)
Deletes the supplied mailbox from the store.
|
Collection<MailFolder> |
getChildren(MailFolder parent) |
MailFolder |
getMailbox(MailFolder parent,
String name)
Looks up a child mailbox of the supplied parent with the name given.
|
MailFolder |
getMailbox(String absoluteMailboxName)
Retrieves a mailbox based on a fully qualified name.
|
Quota[] |
getQuota(String root,
String qualifiedRootPrefix)
Gets the quotas.
|
boolean |
isQuotaSupported()
Checks if quota capability is activated.
|
Collection<MailFolder> |
listMailboxes(String searchPattern)
Lists all of the mailboxes in the store which have a name
matching the supplied search pattern.
|
void |
renameMailbox(MailFolder existingFolder,
String newName)
Renames the mailbox with the new name.
|
void |
setQuota(Quota quota,
String qualifiedRootPrefix)
Sets the quota.
|
void |
setQuotaSupported(boolean pQuotaSupported)
Toggles quota capability.
|
MailFolder |
setSelectable(MailFolder folder,
boolean selectable)
Tells the store to make the supplied mailbox selectable or not (able to store
messages).
|
public MailFolder getMailbox(String absoluteMailboxName)
StoregetMailbox in interface StoreabsoluteMailboxName - the fully qualified name.null if not.public MailFolder getMailbox(MailFolder parent, String name)
StoregetMailbox in interface Storeparent - The parent mailboxname - The name of the child to lookupnull if not found.public MailFolder createMailbox(MailFolder parent, String mailboxName, boolean selectable) throws FolderException
StorecreateMailbox in interface Storeparent - A mailbox from this store.mailboxName - The name of the mailbox to create.selectable - If true, the mailbox will be created to store messages.FolderException - If the mailbox couldn't be created.public void deleteMailbox(MailFolder folder) throws FolderException
StoredeleteMailbox in interface Storefolder - A mailbox from this store.FolderException - If the mailbox couldn't be deleted.public void renameMailbox(MailFolder existingFolder, String newName)
StorerenameMailbox in interface StoreexistingFolder - A mailbox from this store.newName - The new name for the mailbox.public Collection<MailFolder> getChildren(MailFolder parent)
getChildren in interface Storeparent - A mailbox from this store.MailFolder instances, which
are the children of the supplied parent.public MailFolder setSelectable(MailFolder folder, boolean selectable)
StoresetSelectable in interface Storefolder - The mailbox to modify.selectable - Whether this mailbox should be able to store messages.public Collection<MailFolder> listMailboxes(String searchPattern) throws FolderException
Store
Valid wildcards are:
'*' - matches any number of characters, including the hierarchy delimiter
'%' - matches any number of characters, but not the hierarchy delimiterlistMailboxes in interface StoresearchPattern - The pattern to match mailboxesFolderException - If the list operation failedpublic Quota[] getQuota(String root, String qualifiedRootPrefix)
StoregetQuota in interface Storeroot - the quota rootqualifiedRootPrefix - the user specific prefixIMAPStore.getQuota(String)public void setQuota(Quota quota, String qualifiedRootPrefix)
StoresetQuota in interface Storequota - the quota.qualifiedRootPrefix - the user specific prefixIMAPStore.setQuota(javax.mail.Quota)public boolean isQuotaSupported()
StoreisQuotaSupported in interface Storepublic void setQuotaSupported(boolean pQuotaSupported)
StoresetQuotaSupported in interface StorepQuotaSupported - true, if supported.Copyright © 2006–2022 Icegreen Technologies. All rights reserved.