[ https://issues.apache.org/jira/browse/MAILBOX-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Charles updated MAILBOX-46: -------------------------------- Summary: Simplify Mailbox implemetations wiring (was: Simplify Mailbox API) > Simplify Mailbox implemetations wiring > -------------------------------------- > > Key: MAILBOX-46 > URL: https://issues.apache.org/jira/browse/MAILBOX-46 > Project: James Mailbox > Issue Type: Improvement > Components: api > Reporter: Eric Charles > Assignee: Norman Maurer > Fix For: 0.3 > > > From http://www.mail-archive.com/server-dev@james.apache.org/msg31051.html, > there is room for discussion on mailbox API. > Stefano says: > "How do I create a maildir folder right now? I think we can't expect > direct mailbox users if we don't provide a simpler interface for it > (or maybe I simply haven't found it). > Here is the code I find in a test: > ---- > MaildirStore store = new MaildirStore(MAILDIR_HOME + "/%domain/%user"); > MaildirMailboxSessionMapperFactory mf = new > MaildirMailboxSessionMapperFactory(store); > MaildirMailboxManager manager = new MaildirMailboxManager(mf, null, store); > manager.init(); > String user = "test@localhost"; > MailboxSession session = manager.createSystemSession(user, new > SimpleLog("Test")); > manager.createMailbox(new MailboxPath(MailboxConstants.USER_NAMESPACE, > user, "Trash"), session); > ----- > I find it a bit "complex" for an average user that is simply looking > for a "maildir" library. > At least it should be easy to reduce it a bit like this: > ------- > MaildirMailboxManager manager = new > MaildirMailboxManager("myfolder/%domain/%user"); // internally create > MaildirStore and MaildirMailboxSessionMapperFactory appropriately and > maybe also init() it! > String user = "test@localhost"; > MailboxSession session = manager.createSystemSession(user); // no > logger parameter, then use a slf4j > manager.createMailbox("Trash", session); // this can create the > MailboxPath using "Trash" as a user folder, so getting the user from > the session and the namespace from MailboxConstants.USER_NAMESPACE. > ------- > And maybe it should be even simpler: I try to think why I would need > maildir and probably I don't expect to deal with sessions and users, > but only with path and messages (but maybe I'm missing the goal of the > mailbox library). > If this is possible then I don't see why an user should care about spring. > Just my 2 cents: of course you better know what's in there, so if you > still think having spring config in mailbox then go ahead. > " -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org