{
String rdnAttribute = newRdn.getUpType();
String rdnAttributeOid = globalRegistries.getOidRegistry().getOid( rdnAttribute );
if ( ! rdnAttributeOid.equals( cnAT.getOid() ) )
{
throw new LdapOperationNotSupportedException(
"Cannot allow rename with rdnAttribute set to "
+ rdnAttribute + ": cn must be used instead." ,
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
/*
* This operation has to do the following:
*
* [1] check and make sure there are no dependent schemas on the
* one being renamed - if so an exception should result
*
* [2] make non-schema object registries modify the mapping
* for their entities: non-schema object registries contain
* objects that are not SchemaObjects and hence do not carry
* their schema within the object as a property
*
* [3] make schema object registries do the same but the way
* they do them will be different since these objects will
* need to be replaced or will require a setter for the
* schema name
*/
// step [1]
String schemaName = getSchemaName( name );
Set<String> dependents = loader.listDependentSchemaNames( schemaName );
if ( ! dependents.isEmpty() )
{
throw new LdapOperationNotSupportedException(
"Cannot allow a rename on " + schemaName + " schema while it has depentents.",
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
// check if the new schema is enabled or disabled