Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
Hi guys, yesterday, as I started to write the doc about the Search Operation, I faced some issue. Let me explain. When you do a simple search, you get back a cursor : SearchCursor cursor = connection.search( "ou=system", "(objectclass=*)", SearchScope.ONELEVEL ); The SearchCursor e

Re: Search result in LDAP API

2011-04-28 Thread Kiran Ayyagari
On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny wrote: > Hi guys, > > yesterday, as I started to write the doc about the Search Operation, I faced > some issue. Let me explain. > > When you do a simple search, you get back a cursor : > >        SearchCursor cursor = connection.search( "ou=syste

Re: Search result in LDAP API

2011-04-28 Thread Pierre-Arnaud Marcelot
On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: > On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny > wrote: >> Hi guys, >> >> yesterday, as I started to write the doc about the Search Operation, I faced >> some issue. Let me explain. >> >> When you do a simple search, you get back a cursor

Re: Search result in LDAP API

2011-04-28 Thread Kiran Ayyagari
On Thu, Apr 28, 2011 at 5:50 PM, Pierre-Arnaud Marcelot wrote: > > On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: > >> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny >> wrote: >>> Hi guys, >>> >>> yesterday, as I started to write the doc about the Search Operation, I faced >>> some issue.

Re: Search result in LDAP API

2011-04-28 Thread Pierre-Arnaud Marcelot
On 28 avr. 2011, at 14:31, Kiran Ayyagari wrote: > On Thu, Apr 28, 2011 at 5:50 PM, Pierre-Arnaud Marcelot > wrote: >> >> On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: >> >>> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny >>> wrote: Hi guys, yesterday, as I started to

Re: Search result in LDAP API

2011-04-28 Thread Kiran Ayyagari
On Thu, Apr 28, 2011 at 6:18 PM, Pierre-Arnaud Marcelot wrote: > > On 28 avr. 2011, at 14:31, Kiran Ayyagari wrote: > >> On Thu, Apr 28, 2011 at 5:50 PM, Pierre-Arnaud Marcelot >> wrote: >>> >>> On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: >>> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
FYI, UnboundiD SDK has another approach : http://www.unboundid.com/products/ldap-sdk/docs/javadoc/index.html OpenDS/DJ does things this way : final ConnectionEntryReader reader = connection.search("dc=example,dc=com", SearchScope.WHOLE_SUBTREE,"(uid=bjensen)","*"); while

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
On Thu, Apr 28, 2011 at 2:20 PM, Pierre-Arnaud Marcelot wrote: > > On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: > >> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny >> wrote: >>> Hi guys, >>> >>> yesterday, as I started to write the doc about the Search Operation, I faced >>> some issue.

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
On 4/28/11 3:40 PM, Stefan Seelmann wrote: On Thu, Apr 28, 2011 at 2:20 PM, Pierre-Arnaud Marcelot wrote: On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny wrote: Hi guys, yesterday, as I started to write the doc about the Search Operation

Re: Search result in LDAP API

2011-04-28 Thread Pierre-Arnaud Marcelot
On 28 avr. 2011, at 15:40, Stefan Seelmann wrote: > On Thu, Apr 28, 2011 at 2:20 PM, Pierre-Arnaud Marcelot > wrote: >> >> On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: >> >>> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny >>> wrote: Hi guys, yesterday, as I started t

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
>> b) Convenience methods:  higher-level objects (Dn, Rdn, Strings) are >> passed and returned. Examples >>    void modify(String dn, Modification... modifications) >>    void rename (Dn entryDn, Rdn newRdn) >>    Cursor  search( Dn baseDn, String filter, SearchScope scope, >> String... attributes

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lécharny
On 4/28/11 4:32 PM, Stefan Seelmann wrote: b) Convenience methods: higher-level objects (Dn, Rdn, Strings) are passed and returned. Examples void modify(String dn, Modification... modifications) void rename (Dn entryDn, Rdn newRdn) Cursorsearch( Dn baseDn, String filter, SearchSc

Re: Search result in LDAP API

2011-04-28 Thread Pierre-Arnaud Marcelot
On 28 avr. 2011, at 16:47, Emmanuel Lécharny wrote: > On 4/28/11 4:32 PM, Stefan Seelmann wrote: b) Convenience methods: higher-level objects (Dn, Rdn, Strings) are passed and returned. Examples void modify(String dn, Modification... modifications) void rename (Dn entryD

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
I like Stefan's idea a lot, but there is something a bit confusing : if a user tries to do a simple search, he will expect the LdapConnection.search() to be the method to use. Having to use LdapConnection.searchEntries() instead is a bit problematic. What about transforming the LdapConnection.

Re: Search result in LDAP API

2011-04-28 Thread Pierre-Arnaud Marcelot
On 28 avr. 2011, at 17:39, Emmanuel Lecharny wrote: > I like Stefan's idea a lot, but there is something a bit confusing : if a > user tries to do a simple search, he will expect the LdapConnection.search() > to be the method to use. Having to use LdapConnection.searchEntries() instead > is a b

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
On Thu, Apr 28, 2011 at 5:39 PM, Emmanuel Lecharny wrote: > I like Stefan's idea a lot, but there is something a bit confusing : if a > user tries to do a simple search, he will expect the LdapConnection.search() > to be the method to use. Having to use LdapConnection.searchEntries() > instead is

Re: Search result in LDAP API

2011-04-28 Thread Kiran Ayyagari
On Thu, Apr 28, 2011 at 9:30 PM, Stefan Seelmann wrote: > On Thu, Apr 28, 2011 at 5:39 PM, Emmanuel Lecharny > wrote: >> I like Stefan's idea a lot, but there is something a bit confusing : if a >> user tries to do a simple search, he will expect the LdapConnection.search() >> to be the method t

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
On 4/28/11 6:06 PM, Kiran Ayyagari wrote: On Thu, Apr 28, 2011 at 9:30 PM, Stefan Seelmann wrote: On Thu, Apr 28, 2011 at 5:39 PM, Emmanuel Lecharny wrote: I like Stefan's idea a lot, but there is something a bit confusing : if a user tries to do a simple search, he will expect the LdapConnec

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
> > This is not an easy choice. > > The problme is that the user might be puzzled to see that a > LdapConnection.search( SearchRequest ) returns a cursor but > that the LdapConnection.search( base, filter, scope, attrs... ) returns a > cursor. > > Using send( Request ) instead first makes the API l

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
On 4/28/11 6:28 PM, Stefan Seelmann wrote: This is not an easy choice. The problme is that the user might be puzzled to see that a LdapConnection.search( SearchRequest ) returns a cursor but that the LdapConnection.search( base, filter, scope, attrs... ) returns a cursor. Using send( Request )

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
On 4/28/11 6:28 PM, Stefan Seelmann wrote: This is not an easy choice. The problme is that the user might be puzzled to see that a LdapConnection.search( SearchRequest ) returns a cursor but that the LdapConnection.search( base, filter, scope, attrs... ) returns a cursor. Using send( Request )

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
On Thu, Apr 28, 2011 at 7:28 PM, Emmanuel Lecharny wrote: > On 4/28/11 6:28 PM, Stefan Seelmann wrote: >>> >>> This is not an easy choice. >>> >>> The problme is that the user might be puzzled to see that a >>> LdapConnection.search( SearchRequest ) returns a cursor >>>  but >>> that the LdapConne

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
On Thu, Apr 28, 2011 at 8:08 PM, Emmanuel Lecharny wrote: > On 4/28/11 6:28 PM, Stefan Seelmann wrote: >>> >>> This is not an easy choice. >>> >>> The problme is that the user might be puzzled to see that a >>> LdapConnection.search( SearchRequest ) returns a cursor >>>  but >>> that the LdapConne

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lécharny
On 4/28/11 8:21 PM, Stefan Seelmann wrote: On Thu, Apr 28, 2011 at 8:08 PM, Emmanuel Lecharny wrote: On 4/28/11 6:28 PM, Stefan Seelmann wrote: This is not an easy choice. The problme is that the user might be puzzled to see that a LdapConnection.search( SearchRequest ) returns a cursor but

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lécharny
On 4/28/11 8:21 PM, Stefan Seelmann wrote: On Thu, Apr 28, 2011 at 8:08 PM, Emmanuel Lecharny wrote: On 4/28/11 6:28 PM, Stefan Seelmann wrote: This is not an easy choice. The problme is that the user might be puzzled to see that a LdapConnection.search( SearchRequest ) returns a cursor but

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 2:39 PM, Kiran Ayyagari wrote: > On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny > wrote: > > Hi guys, > > > > yesterday, as I started to write the doc about the Search Operation, I > faced > > some issue. Let me explain. > > > > When you do a simple search, you get bac

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 3:20 PM, Pierre-Arnaud Marcelot wrote: > > On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: > > > On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny > wrote: > SNIP ... > This would be my preference as well (with another method to access the > IntermediateResponse too)

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 4:23 PM, Emmanuel Lecharny wrote: > FYI, UnboundiD SDK has another approach : > http://www.unboundid.com/products/ldap-sdk/docs/javadoc/index.html > > OpenDS/DJ does things this way : > > final ConnectionEntryReader reader = > connection.search("dc=example,dc

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 4:57 PM, Emmanuel Lecharny wrote: > On 4/28/11 3:40 PM, Stefan Seelmann wrote: > >> On Thu, Apr 28, 2011 at 2:20 PM, Pierre-Arnaud Marcelot >> wrote: >> >>> On 28 avr. 2011, at 13:39, Kiran Ayyagari wrote: >>> >>> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny w

Re: Search result in LDAP API

2011-04-28 Thread Emmanuel Lecharny
On 4/28/11 10:19 PM, Alex Karasulu wrote: On Thu, Apr 28, 2011 at 2:39 PM, Kiran Ayyagariwrote: On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny wrote: Hi guys, yesterday, as I started to write the doc about the Search Operation, I faced some issue. Let me explain. When you do a simple s

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 7:28 PM, Stefan Seelmann wrote: > > > > This is not an easy choice. > > > > The problme is that the user might be puzzled to see that a > > LdapConnection.search( SearchRequest ) returns a cursor > but > > that the LdapConnection.search( base, filter, scope, attrs... ) retu

Re: Search result in LDAP API

2011-04-28 Thread Stefan Seelmann
> And so that leads to the need for checks to see what kind of object we have > the cursor currently positioned under: >     isEntry() >     isReferral() >     isIntermediate() > This is probably best. I agree with Kiran that keeping around referral > objects and returning them in the end is not go

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 11:30 PM, Emmanuel Lecharny wrote: > On 4/28/11 10:19 PM, Alex Karasulu wrote: > >> On Thu, Apr 28, 2011 at 2:39 PM, Kiran Ayyagari> >wrote: >> >> On Thu, Apr 28, 2011 at 4:38 PM, Emmanuel Lecharny >>> wrote: >>> Hi guys, yesterday, as I started to write the

Re: Search result in LDAP API

2011-04-28 Thread Alex Karasulu
On Thu, Apr 28, 2011 at 11:31 PM, Stefan Seelmann wrote: > > And so that leads to the need for checks to see what kind of object we > have > > the cursor currently positioned under: > > isEntry() > > isReferral() > > isIntermediate() > > This is probably best. I agree with Kiran that k