From: SunFire <nu...@jb...> - 2005-07-27 20:19:23
|
While you are working on the Mailbox design maybe you want to keep an eye down the road on features need by imap (and mybe other protocols). In addition to the more JBM internally used attributes you need to be able to attach a set of flexible (and client definded custom) flags to a folder (e.g. \Draft, \Seen, $Spam, etc.). Simplest way todo it would be to introduce a private hashmap to the mailbox and let every protocol have their own key to access their flag object in it and expose it like this: | Object getFlags(String key); | void setFlags(String key, Object flags); | NOTE: String may be prefered over Object and would certainly satisfy the needs for imap but since I have no idea if other protocols my need their own complex objects for flags... It would also be a nice feature to add an event observer type of mechanism to mailboxes. Reason for that: an IMAP connections instance has opened a mailbox and is idleing in it with NOOPs/CHECKs. A second connections instance is accessing the same mailbox and expunges a few mails (could also a user in a webfrontend, a pop3 instance, other imap client, etc). The first connection now needs to be updated that mail # 3, 5 and 8 have been deleted. So to allow a protocol instance to subscribe in some way to certain mailbox events like DELETE or ADD would make things much easier. Else you need to either do a lot of dirty overhead in the protocol implementations and/or place locks on the mailboxes much longer then actually needed (or needed at all). Cheers, Thorsten View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3886917#3886917 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3886917 |