if ( entry != null )
{
entry.setDn( dn );
entry = new ClonedServerEntry( entry );
// Replace the entry's DN with the provided one
Attribute entryDnAt = entry.get( ENTRY_DN_AT );
if ( entryDnAt == null )
{
entry.add( ENTRY_DN_AT, dn.getName() );
}
else
{
entryDnAt.clear();
entryDnAt.add( dn.getName() );
}
return entry;
}
try
{
rwLock.readLock().lock();
entry = master.get( id );
}
finally
{
rwLock.readLock().unlock();
}
if ( entry != null )
{
// We have to store the DN in this entry
entry.setDn( dn );
// always store original entry in the cache
addToCache( id, entry );
entry = new ClonedServerEntry( entry );
if ( !entry.containsAttribute( ENTRY_DN_AT ) )
{
entry.add( ENTRY_DN_AT, dn.getName() );
}