[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Java LDAP API issues



Steven Sonntag wrote:
> 
> Rob Weltman wrote:
> 
> >
> > >   3) setOption operates only on the LDAPSearchConstraints object
> > >      that is associated with an LDAPConnection object.  Yet
> > >      there may also be an LDAPConstraints object associated
> > >      with the LDAPConnection object.  It may or may not be
> > >      the same as the LDAPSearchConstraints object.  Should
> > >      there be a setOption kind of method that operates on
> > >      the LDAPConstraints object associated with a connection?
> >
> >   LDAPSearchConstraints extends LDAPConstraints. There is only one
> > such object per connection, and it is an LDAPSearchConstraints. If
> > there was an LDAPConstraints object as well, there would be ambiguity
> > as to which object controlled operations other than search.   Also,
> > see 4 below (which renders this issue mute)
> 
> The thing that is confusing to me is that in the LDAPConnection object
> there are the following methods:
> 
> getConstraints()
> getSearchConstraints()
> setConstraints()
> setSearchConstraints()
> 
> Since, as you say, there is only one object per connection, there is
> still confusion.  If the
> application calls the setConstraints() method with an LDAPConstraints
> object, then
> there are no search constraints at all, since the added functionality of
> the LDAPSearchConstraints
> specialization is not present.  Having the four methods make it seem
> like there are two separate objects,
> or at least that is the way I read it.  Maybe all that is needed is the
> set|getConstraints which takes
> an LDAPSearchConstraints object and eliminate the other two methods.
> 
> -Steve

  In our implementation, setConstraints() just sets the properties of LDAPConstraints, leaving the search-specific properties untouched. setSearchConstraints() replaces all properties. I haven't heard any reports of confusion from the field.

Rob