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

Re: Java LDAP API issues



Steven Sonntag wrote:

> Rob Weltman wrote:
>
> > 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
>
> Just to clarify if I understand it correctly
>
> I am/was confused because I was seeing in my minds eye setConstraints implemented
> as storing the object somewhere internal to the class, and the same for setSearchConstraints.
>
> You must be seeing an implementation where a single LDAPSearchConstraints objecct
> exists internally, and the search constraints fields are copied on setConstraints() to the
> internal object, and the search constraints fields are copied on setSearchConstraints().
>
> However getConstraints and getSearchConstraints return a reference to the single internal object.
>

  That is absolutely correct!

Rob

>
> --
> ------------------------
> Steve Sonntag
> Novell, Inc., the leading provider of Net services software