MailboxManager
(http://svn.apache.org/repos/asf/james/server/trunk/core-library/src/main/java/org/apache/james/mailboxmanager/manager/MailboxManager.java)
contains a list method returning an array of ListResult:
/**
*
* @param base
* hierarchy starting point like #mail.user1 to list mailboxes of
* user1
* @param expression
* allows the use of wildcards
* @param subscribed
* if true, only list subscribed mailboxes (needs interaction
* with the user-object)
* @throws MailboxManagerException
*/
ListResult[] list(String base, String expression, boolean
subscribed) throws MailboxManagerException;
this appears to have been added to support IMAP LIST and LSUB
AIUI MailboxAPI was intended to be protocol agnostic
1. AIUI subscription as a concept is specific to IMAP. essentially,
it's just an additional meta-data flag. IMHO adding unique methods for
each special bit of special meta-data required by a protocol will just
lead to a bloated API. it would be better to use a general concept of
mailbox meta-data. (note that IMAP requires that meta-data is retained
even after a mailbox has been deleted.)
2. the noun used (LIST) seems unintuitive unless you understand the
IMAP protocol and is inconsistent. GeneralMailbox
(http://svn.apache.org/repos/asf/james/server/trunk/core-library/src/main/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java)
uses getMessages. i'm not sure either is the best noun but at least
the API should be consistent.
3. ListResult targets IMAP LIST and LSUB. it seems unlikely that the
exact data returned will be useful to any other protocol.
4. the parameters list specifically supports the IMAP LIST and LSUB
commands. it is unlikely that this will be useful in a general API.
fetching mailbox names should be a quick process so perhaps all names
in the given namespace could be returned. alternatively, a proper
query object could be passed.
5. MailboxManager has HIERARCHY_DELIMITER as a constant but ListResult
returns this value. this suggests an inconsistent approach.
opinions?
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]