mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
16.06.2008 52b6aaf991fb07716ef61313236be500c4c584be
opends/src/server/org/opends/server/tools/BackUpDB.java
@@ -327,6 +327,7 @@
                backUpAll.getLongIdentifier(),
                backendID.getLongIdentifier());
        err.println(wrapText(message, MAX_LINE_WIDTH));
        err.println(argParser.getUsage());
        return 1;
      }
    }
@@ -336,8 +337,44 @@
              backUpAll.getLongIdentifier(),
              backendID.getLongIdentifier());
      err.println(wrapText(message, MAX_LINE_WIDTH));
      err.println(argParser.getUsage());
      return 1;
    }
    else
    {
      // Check that the backendID has not been expressed twice.
      HashSet<String> backendIDLowerCase = new HashSet<String>();
      HashSet<String> repeatedBackendIds = new HashSet<String>();
      StringBuilder repeatedBackends = new StringBuilder();
      for (String id : backendID.getValues())
      {
        String lId = id.toLowerCase();
        if (backendIDLowerCase.contains(lId))
        {
          if (!repeatedBackendIds.contains(lId))
          {
            repeatedBackendIds.add(lId);
            if (repeatedBackends.length() > 0)
            {
              repeatedBackends.append(", ");
            }
            repeatedBackends.append(id);
          }
        }
        else
        {
          backendIDLowerCase.add(lId);
        }
      }
      if (repeatedBackends.length() > 0)
      {
        Message message = ERR_BACKUPDB_REPEATED_BACKEND_ID.get(
            repeatedBackends.toString());
        err.println(wrapText(message, MAX_LINE_WIDTH));
        err.println(argParser.getUsage());
        return 1;
      }
    }
    // If the incremental base ID was specified, then make sure it is an
    // incremental backup.
@@ -350,6 +387,7 @@
                        incrementalBaseID.getLongIdentifier(),
                        incremental.getLongIdentifier());
        err.println(wrapText(message, MAX_LINE_WIDTH));
        err.println(argParser.getUsage());
        return 1;
      }
    }
@@ -364,6 +402,7 @@
                      encrypt.getLongIdentifier(),
                      signHash.getLongIdentifier());
      err.println(wrapText(message, MAX_LINE_WIDTH));
      err.println(argParser.getUsage());
      return 1;
    }
@@ -375,6 +414,7 @@
              signHash.getLongIdentifier(),
              hash.getLongIdentifier());
      err.println(wrapText(message, MAX_LINE_WIDTH));
      err.println(argParser.getUsage());
      return 1;
    }