directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <>
Subject Re: How the Dn of Child entries are updating when Parent Moved
Date Tue, 17 May 2011 12:29:58 GMT
On 5/17/11 2:18 PM, Rajesh Akkineni wrote:
> On Tue, 17 May 2011 16:07:24 +0530, Emmanuel Lécharny 
> <> wrote:
>> On 5/17/11 12:30 PM, Prasanna Kumar G wrote:
>>> Hi,
>>>       I am trying to understand ApacheDS code. I am not 
>>> understanding the
>>> Moving of Entry(Renaming the Dn). When Renaming Dn of an Entry, 
>>> where are
>>> you updating the child entries.
>> We don't. We store RDNs, not DNs.
> But that RDN also not being used as the DN which is constructed in 
> ServerEntrySerializer is not valid, and it isbeing overwritten in 
> AbstractStore.lookup

ServerEntrySerializer :

     public Object deserialize( byte[] bytes ) throws IOException
         ObjectInputStream in = new ObjectInputStream( new 
ByteArrayInputStream( bytes ) );

             Entry entry = new DefaultEntry( schemaManager );

             // Read the Dn, if any
             byte hasDn = in.readByte();

             if ( hasDn == 1 )
                 Rdn rdn = new Rdn( schemaManager );
                 rdn.readExternal( in ); <============== Here we read 
the RDN.

The AbstractStore.lookup method just rebuild the full DN, using the 
serialized RDN and the position in the tree of this entry.

> So why to save the RDN at all?
Because it *is* the entry's only name. If we don't save it, we have no 
way to reconstruct the entry.
> Why I am asking is, is there any other purpose for saving RDN?

I suggest you step through the server code in debug mode, you'll see how 
it works. Keep in mind it's a huge piece of code, so don't expect to 
understand it inside out in a few days...

Emmanuel Lécharny

View raw message