* {@inheritDoc}
*/
public void rename( ServerEntry entry, RDN newRdn, boolean cascade ) throws Exception
{
String schemaName = getSchemaName( entry.getDn() );
ObjectClass oldOc = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), schemaName );
// Dependency constraints are not managed by this class
// Set<ServerEntry> dependees = dao.listObjectClassDependents( oldOc );
//
// if ( dependees != null && dependees.size() > 0 )
// {
// throw new LdapUnwillingToPerformException( "The objectClass with OID " + oldOc.getOid()
// + " cannot be deleted until all entities"
// + " using this objectClass have also been deleted. The following dependees exist: "
// + getOids( dependees ),
// ResultCodeEnum.UNWILLING_TO_PERFORM );
// }
ServerEntry targetEntry = ( ServerEntry ) entry.clone();
String newOid = ( String ) newRdn.getNormValue();
targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
// Inject the new DN
DN newDn = new DN( targetEntry.getDn() );
newDn.remove( newDn.size() - 1 );
newDn.add( newRdn );
checkOidIsUnique( newOid );
ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
if ( isSchemaEnabled( schemaName ) )
{
// Check that the entry has no descendant
if ( schemaManager.getObjectClassRegistry().hasDescendants( oldOc.getOid() ) )