directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Czurda <>
Subject Re: connection.exists(Dn) is false although entry exists
Date Wed, 01 Feb 2012 23:36:17 GMT

On 02/02/2012 12:18 AM, Alex Karasulu wrote:
> On Thu, Feb 2, 2012 at 1:14 AM, Christoph Czurda
> <>wrote:
>> On 02/01/2012 11:58 PM, Alex Karasulu wrote:
>>> On Wed, Feb 1, 2012 at 10:19 PM, Christoph Czurda
>>> <>wrote:
>>>> Hi Pierre-Arnaud,
>>>> The mistake was on my side. I used Rdn rdn = new Rdn("cn=a,ou=b"); and
>>>> passed this to a Dn constructor. I misinterpreted the description of
>>>> class Rdn where it says that any String with a '=' is treated as a full
>>>> Rdn. When I changed it, it worked as expected.
>>> Just curious can you show me the offending code? I really did not
>>> understand your description.
>>> I ask this because it might show which area of our API is weak in terms
>> of
>>> being intuitive. If the user understands the domain a good API shows
>>> exactly how it should be used by the object model and methods.
>> It was like this:
>> Dn parent = new Dn("ou=system");
>> Dn somewhereBelow = new Dn(new Rdn("cn=a,cn=b"),parent); //the problem
>> was the rdn
>> I thought that in this constructor everything before the parent is
>> simply prepended.
> So if understand correctly you thought Rdn is not a single name component
> but one that can have 1 or more name components like for example a relative
> path in the fs namespace?
Well, I was aware that a Rdn only relates to the lowest Ava of a Dn. I
mixed up the following:

>From api documentation of constructor public Dn(String... upRdns):

If the String contains a '=' symbol, the the constructor will assume
that the String arg contains afull Rdn, otherwise, it will consider that
the following arg is the value.

So I thought if this works for a Dn, it might as well work for a Rdn.
Maybe the Rdn constructor should throw an InvalidDnException if it is
passed a String containing more than one '='.
>> The interesting thing is that dn.getName() did what I
>> actually intended, ie it returns "cn=a,cn=b,ou=system".
> Odd.
> Thanks for the feedback.

View raw message