code: public void renameEntry(Name oldDN, Name newDN) throws NamingException
     {
  
        Name rdn = newDN.getSuffix(newDN.size() - 1);
  
        Name oldRdn = oldDN.getSuffix(oldDN.size() - 1);
  
        if (!oldRdn.toString().equals(rdn.toString()))
  
           ctx.rename(oldDN, rdn);
  
     }
docs: ------------------------------------------------