|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.icegreen.greenmail.store.InMemoryStore
public class InMemoryStore
A simple in-memory implementation of Store, used for testing
and development. Note: this implementation does not persist *anything* to disk.
| Field Summary |
|---|
| Fields inherited from interface com.icegreen.greenmail.imap.ImapConstants |
|---|
BAD, BYE, CAPABILITIES, HIERARCHY_DELIMITER, HIERARCHY_DELIMITER_CHAR, INBOX_NAME, NAMESPACE_PREFIX, NAMESPACE_PREFIX_CHAR, NO, OK, SP, UNTAGGED, USER_NAMESPACE, VERSION |
| Constructor Summary | |
|---|---|
InMemoryStore()
|
|
| Method Summary | |
|---|---|
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 |
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. |
Collection |
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. |
MailFolder |
setSelectable(MailFolder folder,
boolean selectable)
Tells the store to make the supplied mailbox selectable or not (able to store messages). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryStore()
| Method Detail |
|---|
public MailFolder getMailbox(String absoluteMailboxName)
Store
getMailbox in interface Storenull if not.
public MailFolder getMailbox(MailFolder parent,
String name)
Store
getMailbox in interface Storeparent - The parent mailboxname - The name of the child to lookup
null if not found.
public MailFolder createMailbox(MailFolder parent,
String mailboxName,
boolean selectable)
throws FolderException
Store
createMailbox 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
Store
deleteMailbox in interface Storefolder - A mailbox from this store.
FolderException - If the mailbox couldn't be deleted.
public void renameMailbox(MailFolder existingFolder,
String newName)
throws FolderException
Store
renameMailbox in interface StoreexistingFolder - A mailbox from this store.newName - The new name for the mailbox.
FolderException - If the mailbox couldn't be renamedpublic Collection 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)
Store
setSelectable in interface Storefolder - The mailbox to modify.selectable - Whether this mailbox should be able to store messages.
public Collection 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 delimiter
listMailboxes in interface StoresearchPattern - The pattern to match mailboxes
FolderException - If the list operation failedStore.listMailboxes(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||