public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
ServerEntry entry, boolean cascade ) throws Exception
{
checkNewParent( newParentName );
Schema oldSchema = getSchema( oriChildName );
AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
Set<ServerEntry> dependees = dao.listAttributeTypeDependents( oldAt );
if ( dependees != null && dependees.size() > 0 )
{
throw new LdapOperationNotSupportedException( "The attributeType with OID " + oldAt.getOid()
+ " cannot be deleted until all entities"
+ " using this attributeType have also been deleted. The following dependees exist: "
+ getOids( dependees ),
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema newSchema = getSchema( newParentName );
ServerEntry targetEntry = ( ServerEntry ) entry.clone();
String newOid = ( String ) newRn.getValue();
targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
checkOidIsUnique( newOid );
AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, newSchema.getSchemaName() );
if ( ! oldSchema.isDisabled() )
{
attributeTypeRegistry.unregister( oldAt.getOid() );
}
unregisterOids( oldAt.getOid() );
if ( ! newSchema.isDisabled() )
{
attributeTypeRegistry.register( at );
}
else
{