public Operation newMove( LdapDN oldName, LdapDN newParentName, String newRdn, boolean deleteOldRn ) throws NamingException
public Operation newMove( LdapDN oldName, LdapDN newParentName ) throws NamingException
    public Operation newMove( LdapDN oldName, LdapDN newParentName, String newRdn, boolean deleteOldRn )        throws NamingException    {        if ( !deleteOldRn )        {            throw new OperationNotSupportedException( "deleteOldRn must be true." );        }        // Prepare to create composite operations        CSN csn = newCSN();        CompositeOperation result = new CompositeOperation( csn );        // Retrieve all subtree including the base entry        SearchControls ctrl = new SearchControls();        ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );        NamingEnumeration e = nexus.search( oldName, environment, new PresenceNode( Constants.OBJECT_CLASS_OID ), ctrl );        while ( e.hasMore() )        {            SearchResult sr = ( SearchResult ) e.next();            // Get the name of the old entry            LdapDN oldEntryName = new LdapDN( sr.getName() );            // Delete the old entry            result.add( new ReplaceAttributeOperation( csn, oldEntryName, new BasicAttribute( Constants.ENTRY_DELETED,                "true" ) ) );            // Get the old entry attributes and replace RDN if required            Attributes entry = sr.getAttributes();            if ( oldEntryName.size() == oldName.size() )            {                entry.remove( NamespaceTools.getRdnAttribute( oldName.get( oldName.size() - 1 ) ) );                entry.put( NamespaceTools.getRdnAttribute( newRdn ), NamespaceTools.getRdnValue( newRdn ) );            }            // Calculate new name from newParentName, oldEntryName, and newRdn.            LdapDN newEntryName = ( LdapDN ) newParentName.clone();            newEntryName.add( newRdn );            for ( int i = oldEntryName.size() - newEntryName.size(); i > 0; i-- )            {                newEntryName.add( oldEntryName.get( oldEntryName.size() - i ) );            }            // Add the new entry            result.add( newAdd( csn, new LdapDN( newEntryName.getUpName() ), entry ) );            // Add default operations to the old entry.            // Please note that newAdd() already added default operations            // to the new entry.             addDefaultOperations( result, csn, oldEntryName );        }        return result;    }