On Tue, Mar 31, 2009 at 12:55 AM, Emmanuel Lecharny <email@example.com>
First, let's talk about the return value. We have two cases :
Stefan Zoerner wrote:
Emmanuel Lecharny wrote:
some first thought about the bind operation. I propose 4 methods :
- bind() for an anonymous bind
- bind(String name) for an unauthenticated bind (this is a special case described in RFC 4513, par 5.1.2)
- bind(String name, String credentials)
- bind(String name, byte credentials) Those two methods are standard bind with a credential as a String or byte
We may define a few others, assuming we may want to use some controls. We also have to deal with SASL bind.
Looks good to me. What about the return value (is it void in all four cases?) and the case that authentication fails. Throws it an exception, and if so, is it derived from RuntimeException (I hope so)?
1) authentication succeeded. We will get a BindResponse
2) authentication failed. We will also have a BindResponse, but in this case, you would like to get the cause, so it's not obvious to want an exception.
So my best guest would be that it's better not to throw an exception.
One more thing : we might want to get a non-blocking mode, where the BindResponse is not returned but a listener is invoked. We discussed that option with Alex, and right now, we think it's better to have a blocking mode for simple operations, and a non-blocking mode for search.
Does it make sense ?