code: public void rename(String dn, String newDn) throws WIMException {
          TimedDirContext ctx = iContextManager.getDirContext();
          iContextManager.checkWritePermission(ctx);
          try {
              try {
                  ctx.rename(dn, newDn);
              } catch (NamingException e) {
                  if (!ContextManager.isConnectionException(e)) {
                      throw e;
                  }
                  ctx = iContextManager.reCreateDirContext(ctx, e.toString());
                  ctx.rename(dn, newDn);
              }
          } catch (NamingException e) {
              String msg = Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)));
              throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, msg, e);
          } finally {
              iContextManager.releaseDirContext(ctx);
          }
      }
docs: Rename an entity.
  
  @param dn The distinguished name to rename.
  @param newDn The new distinguished name.
  @throws WIMException If there was an issue getting or releasing a context, or the context is on a
  fail-over server and writing to fail-over servers is prohibited, or the distinguished
  name does not exist.