|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A host machine that has an IMAP4rev1 messaging server. There should be one instance of this class per instance of James. An IMAP messaging system may span more than one host.
String
parameters representing mailbox names must be the
full hierarchical name of the target, with namespace, as used by the
specified user. Examples:
'#mail.Inbox' or '#shared.finance.Q2Earnings'.
An imap Host must keep track of existing and deleted mailboxes. References: rfc 2060, rfc 2193, rfc 2221
FolderRecord
,
RecordRepository
Field Summary | |
static java.lang.String |
IMAP_HOST
|
static java.lang.String |
ROLE
|
Method Summary | |
ACLMailbox |
createMailbox(java.lang.String user,
java.lang.String mailboxName)
Returns a reference to a newly created Mailbox. |
boolean |
deleteMailbox(java.lang.String user,
java.lang.String mailboxName)
Deletes an existing MailBox. |
java.lang.String |
getDefaultNamespace(java.lang.String username)
Returns the namespace which should be used for this user unless they expicitly request another. |
ACLMailbox |
getMailbox(java.lang.String user,
java.lang.String mailboxName)
Returns a reference to an existing Mailbox. |
java.lang.String |
getMailboxStatus(java.lang.String username,
java.lang.String mailboxName,
java.util.List dataItems)
Returns a string giving the status of a mailbox on requested criteria. |
boolean |
hasLocalAccess(java.lang.String username)
Establishes if the specified user can access any mailboxes on this host. |
boolean |
isHomeServer(java.lang.String username)
Establishes whether this host is the Home Server for the specified user. |
java.util.Collection |
listMailboxes(java.lang.String username,
java.lang.String referenceName,
java.lang.String mailboxName,
boolean subscribedOnly)
Returns an iterator over an unmodifiable collection of Strings representing mailboxes on this host and their attributes. |
void |
releaseMailbox(java.lang.String user,
ACLMailbox mbox)
Releases a reference to a mailbox, allowing Host to do any housekeeping. |
boolean |
renameMailbox(java.lang.String user,
java.lang.String oldMailboxName,
java.lang.String newMailboxName)
Renames an existing MailBox. |
boolean |
subscribe(java.lang.String username,
java.lang.String mailbox)
Subscribes a user to a mailbox. |
boolean |
unsubscribe(java.lang.String username,
java.lang.String mailbox)
Unsubscribes from a given mailbox. |
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
configure |
Methods inherited from interface org.apache.avalon.framework.component.Composable |
compose |
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
contextualize |
Field Detail |
public static final java.lang.String ROLE
public static final java.lang.String IMAP_HOST
Method Detail |
public boolean isHomeServer(java.lang.String username)
username
- an email addresspublic boolean hasLocalAccess(java.lang.String username)
username
- an email addresspublic ACLMailbox getMailbox(java.lang.String user, java.lang.String mailboxName) throws AccessControlException, MailboxException
user
- email address on whose behalf the request is made.mailboxName
- String name of the target.AccessControlException
- if the user does not have at least
lookup rights.MailboxException
- if mailbox does not exist locally.public ACLMailbox createMailbox(java.lang.String user, java.lang.String mailboxName) throws AccessControlException, AuthorizationException, MailboxException
user
- email address on whose behalf the request is made.mailboxName
- String name of the targetMailboxException
- if mailbox already exists, locally or remotely,
or if mailbox cannot be created locally.AccessControlException
- if the user does not have lookup rights
for parent or any needed ancestor folder
lookup rights.AuthorizationException
- if mailbox could be created locally but
user does not have create rights.FolderRecord
public boolean deleteMailbox(java.lang.String user, java.lang.String mailboxName) throws MailboxException, AuthorizationException
user
- email address on whose behalf the request is made.mailboxName
- String name of the targetMailboxException
- if mailbox does not exist locally or is any
identities INBOX.AuthorizationException
- if mailbox exists locally but user does
not have rights to delete it.FolderRecord
public boolean renameMailbox(java.lang.String user, java.lang.String oldMailboxName, java.lang.String newMailboxName) throws MailboxException, AuthorizationException
user
- email address on whose behalf the request is made.oldMailboxName
- String name of the existing mailboxnewMailboxName
- String target new nameMailboxException
- if mailbox does not exist locally, or there
is an existing mailbox with the new name.AuthorizationException
- if user does not have rights to delete
the existing mailbox or create the new mailbox.FolderRecord
public void releaseMailbox(java.lang.String user, ACLMailbox mbox)
username
- String user who has finished with this mailboxmbox
- a non-null reference to an ACL Mailbox.public java.lang.String getDefaultNamespace(java.lang.String username)
username
- String an email addresspublic java.util.Collection listMailboxes(java.lang.String username, java.lang.String referenceName, java.lang.String mailboxName, boolean subscribedOnly) throws MailboxException, AccessControlException
The reference name must be non-empty. If the mailbox name is empty, implementations must not throw either exception but must return a single String (described below) if the reference name specifies a local mailbox accessible to the user and a one-character String containing the hierarchy delimiter of the referenced namespace, otherwise.
Each String returned should be a space seperated triple of name attributes, hierarchy delimiter and full mailbox name. The mailbox name should include the namespace and be relative to the specified user.
RFC comments: Implementations SHOULD return quickly. They SHOULD NOT go to excess trouble to calculate\Marked or \Unmarked status.
JAMES comment: By elimination, implementations should usually include \Noinferiors or \Noselect, if appropriate. Also, if the reference name and mailbox name resolve to a single local mailbox, implementations should establish all attributes.
Note that servers cannot unilaterally remove mailboxes from the subscribed list. A request with the subscribedOnly flag set that attempts to list a deleted mailbox must return that mailbox with the \Noselect attribute.
username
- String non-empty email address of requesterreferenceName
- String non-empty name, including namespace, of a
mailbox or level of mailbox hierarchy, relative to user.mailboxName
- String name of a mailbox possible including a
wildcard.subscribedOnly
- only return mailboxes currently subscribed.AccessControlException
- if the user does not have at least
lookup rights to at least one mailbox in the set requested.MailboxException
- if the referenceName is not local or if
referenceName and mailbox name resolve to a single mailbox which does
not exist locally.public boolean subscribe(java.lang.String username, java.lang.String mailbox) throws MailboxException, AccessControlException
username
- String representation of an email addressmailbox
- String representation of a mailbox name.AccessControlException
- if the mailbox exists but the user does
not have lookup rights.MailboxException
- if the mailbox does not exist locally.public boolean unsubscribe(java.lang.String username, java.lang.String mailbox) throws MailboxException, AccessControlException
username
- String representation of an email addressmailbox
- String representation of a mailbox name.public java.lang.String getMailboxStatus(java.lang.String username, java.lang.String mailboxName, java.util.List dataItems) throws MailboxException, AccessControlException
username
- String non-empty email address of requestermailboxName
- String name of a mailbox (no wildcards allowed).dataItems
- Vector of one or more Strings each of a single
status item.AccessControlException
- if the user does not have at least
lookup rights to the mailbox requested.MailboxException
- if the mailboxName does not exist locally.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |