{
throw new NamingException( I18n.err( I18n.ERR_313, lide.getMessage() ) );
}
RDN oldRdn = oldDn.getRdn();
RDN newRdn = newDn.getRdn();
boolean delOldRdn = true;
/*
* Attempt to use the java.naming.ldap.deleteRDN environment property
* to get an override for the deleteOldRdn option to modifyRdn.
*/
if ( null != env.get( DELETE_OLD_RDN_PROP ) )
{
String delOldRdnStr = ( String ) env.get( DELETE_OLD_RDN_PROP );
delOldRdn = !delOldRdnStr.equalsIgnoreCase( "false" ) && !delOldRdnStr.equalsIgnoreCase( "no" )
&& !delOldRdnStr.equals( "0" );
}
/*
* We need to determine if this rename operation corresponds to a simple
* RDN name change or a move operation. If the two names are the same
* except for the RDN then it is a simple modifyRdn operation. If the
* names differ in size or have a different baseDN then the operation is
* a move operation. Furthermore if the RDN in the move operation
* changes it is both an RDN change and a move operation.
*/
if ( oldParent.equals( newParent ) )
{
try
{
doRename( oldDn, newRdn, delOldRdn );
}
catch ( Exception e )
{
JndiUtils.wrap( e );
}
}
else
{
if ( newRdn.equals( oldRdn ) )
{
try
{
doMove( oldDn, newParent );
}