-----Original Message----- From: Robert Burrell Donkin [mailto:[email protected]] Sent: 13 May 2009 10:39 To: James Developers List Subject: Re: MailboxManager API addition
On Wed, May 13, 2009 at 8:07 AM, Martin.Bergljung <[email protected]> wrote: > Hi, > > > > Would it be possible to add an extra method to the MailboxManager API > for logouts? > > > > I am currently firing a login event when someone has been successfully > authenticated (in the isAuthentic() method) > > and would like to fire a logout event when someone is logged out via > LogoutProcessor. > > > > public void postLogout(MailboxSession session); > > > > Maybe we could actually also have a postLogin so I do not have to mix > event firing with authentication. > > > > BTW. Is there a special reason why the authentication method is called > isAuthentic()? I think authenticate() would be more logical as > > isAuthentic() gives me the idea that a user could already have been > authenticated...maybe that is the idea i'm not very happy with the Mailbox API in this area either i've opened a JIRA to track this (https://issues.apache.org/jira/browse/IMAP-84) i think something like: MailboxSession authenticate(String user, String password, Log log) throws MailboxException +1 for this, much more clear, you authenticate and then you create the session right after that. would be an improvement with a BadCredentialsException thrown when the user and password combination is incorrect. this would allow better diagnosis when the Mailbox finds itself unable to authentic the user for other reasons. +1 createSession would need to be renamed createSystemSession and be retargeted at programmatic access which does not require authentication (for example, from a SIEVE script) Know too little about this to be able to give an opinion. i agree that that the current API lacks symmetry. so maybe 'login' rather than authenticate would be better, thence: logout(MailboxSession) throws MailboxException connectivity issues are relatively common with IMAP so full support would mean adding an additional message (SystemForceLogout, perhaps) to inform the Mailbox that the session is dead. +1 for MailboxSession login(String user, String password, Log log) throws BadCredentialsException void logout(boolean forced); About the event stuff: I want to be able to track how many users are concurrently logged in at any one time. I then keep a record so system administrators can check the utilization of the system and see that any license agreements are not broken. I have a screen in Alfresco where I can see stuff like: ======================================================================== ============================= Number of unique users logged on since installation = 3 (admin,vbergljung,mbergljung,) Maximum number of users logged on concurrently since installation = 3 (Fri Apr 24 17:00:08 BST 2009) Number of users logged on at the moment = 2 Username Login Time Session Id admin Wed May 13 10:47:51 BST 2009 29229282828282 mbergljung Wed May 13 10:47:51 BST 2009 29293939383838 ======================================================================== ============================= opinions? - robert --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
