|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MailboxManager
Central MailboxManager which creates, lists, provides, renames and deletes Mailboxes
An important goal is to be JavaMail feature compatible. That means JavaMail could be used in both directions: As a backend for e.g. accessing a Maildir JavaMail store or as a frontend to access a JDBC MailboxManager through JavaMail. This should be possible by not too complicated wrapper classes. Due to the complexity of JavaMail it might be impossible to avoid some limitations.
Internally MailboxManager deals with named repositories that could have different implementations. E.g. JDBC connections to different hosts or Maildir / Mbox like stores. This repositories are identified by its names and maybe are configured in config.xml. The names of the mailboxes have to be mapped to the corresponding repository name. For user mailboxes this could be done by a "User.getRepositoryName()" property. It is imaginable that repositories lookup further properties from the user object like a path name for a file based storage method. Until Milestone 6 there is only one named repository: "default".
The only operation that requires dealing with the named repositories directly is the quota management. It is probably really difficult to implement a quota system that spans multiple repository implementations. That is why quotas are created for a specific repository. To be able to administer, repositories and theier belonging mailboxes can be listet.
Field Summary | |
---|---|
static char |
HIERARCHY_DELIMITER
|
static java.lang.String |
INBOX
|
static java.lang.String |
USER_NAMESPACE
|
Method Summary | |
---|---|
void |
copyMessages(MessageRange set,
java.lang.String from,
java.lang.String to,
MailboxSession session)
this is done by the MailboxRepository because maybe this operation could be optimized in the corresponding store. |
void |
createMailbox(java.lang.String mailboxName)
Creates a new mailbox. |
MailboxSession |
createSession()
Creates a new session. |
void |
deleteMailbox(java.lang.String mailboxName,
MailboxSession session)
|
boolean |
existsMailbox(java.lang.String mailboxName)
|
Mailbox |
getMailbox(java.lang.String mailboxName,
boolean autocreate)
Gets an session suitable for IMAP. |
boolean |
isAuthentic(java.lang.String userid,
java.lang.String passwd)
Autenticates the given user against the given password. |
ListResult[] |
list(MailboxExpression expression)
TODO: Expression requires parsing. |
void |
renameMailbox(java.lang.String from,
java.lang.String to)
Renames a mailbox. |
java.lang.String |
resolve(java.lang.String userName,
java.lang.String mailboxPath)
Resolves a path for the given user. |
void |
subscribe(java.lang.String user,
java.lang.String mailbox)
Subscribes the user to the given mailbox. |
java.util.Collection |
subscriptions(java.lang.String user)
Lists current subscriptions for the given user. |
void |
unsubscribe(java.lang.String user,
java.lang.String mailbox)
Unsubscribes the user from the given mailbox. |
Field Detail |
---|
static final char HIERARCHY_DELIMITER
static final java.lang.String USER_NAMESPACE
static final java.lang.String INBOX
Method Detail |
---|
java.lang.String resolve(java.lang.String userName, java.lang.String mailboxPath)
Resolves a path for the given user.
TODO: Think about replacing this operation TODO: More elegant to pass in the username TODO: Or switch to URLs
Mailbox getMailbox(java.lang.String mailboxName, boolean autocreate) throws MailboxManagerException
mailboxName
- the name of the mailbox, not nullautocreate
- create this mailbox if it doesn't exist
ImapMailboxSession
, not null
MailboxManagerException
- when the mailbox cannot be opened
MailboxNotFoundException
- when the given mailbox does not existvoid createMailbox(java.lang.String mailboxName) throws MailboxManagerException
mailboxName
- name, not null
MailboxManagerException
void deleteMailbox(java.lang.String mailboxName, MailboxSession session) throws MailboxManagerException
MailboxManagerException
void renameMailbox(java.lang.String from, java.lang.String to) throws MailboxManagerException
from
- original name for the mailboxto
- new name for the mailbox
MailboxManagerException
MailboxExistsException
- when the to
mailbox exists
MailboxNotFound
- when the from
mailbox does not existvoid copyMessages(MessageRange set, java.lang.String from, java.lang.String to, MailboxSession session) throws MailboxManagerException
set
- messages to copyfrom
- name of the source mailboxto
- name of the destination mailboxsession
- MailboxSession
, not null
MailboxManagerException
ListResult[] list(MailboxExpression expression) throws MailboxManagerException
expression
- MailboxExpression
used to select mailboxes to
be returned
MailboxManagerException
boolean existsMailbox(java.lang.String mailboxName) throws MailboxManagerException
MailboxManagerException
MailboxSession createSession()
MailboxSession
, not nullboolean isAuthentic(java.lang.String userid, java.lang.String passwd)
userid
- user namepasswd
- password supplied
void subscribe(java.lang.String user, java.lang.String mailbox) throws SubscriptionException
user
- the user name, not nullmailbox
- the mailbox name, not null
SubscriptionException
void unsubscribe(java.lang.String user, java.lang.String mailbox) throws SubscriptionException
user
- the user name, not nullmailbox
- the mailbox name, not null
SubscriptionException
java.util.Collection subscriptions(java.lang.String user) throws SubscriptionException
user
- the user name, not null
Collection
of mailbox names
SubscriptionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |