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

dugan
18.06.2009 7c8329a904420b71e3bf9a5297c447d2f1c7f281
opends/src/server/org/opends/server/tools/ImportLDIF.java
@@ -362,8 +362,10 @@
      threadCount = new IntegerArgument("threadCount", null, "threadCount",
              false, true,
              false, false, true,
              INFO_LDIFIMPORT_THREAD_COUNT_PLACEHOLDER.get(),
              0, null,
              true, 1, false, Integer.MAX_VALUE,
              INFO_LDIFIMPORT_DESCRIPTION_THREAD_COUNT.get());
      argParser.addArgument(threadCount);
@@ -547,6 +549,13 @@
      attributes.add(new LDAPAttribute(ATTR_IMPORT_RANDOM_SEED, values));
    }
    if (threadCount.getValue() != null) {
      values = new ArrayList<ByteString>(1);
      values.add(ByteString.valueOf(threadCount.getValue()));
      attributes.add(new LDAPAttribute(ATTR_IMPORT_THREAD_COUNT, values));
    }
    //
    // Optional attributes
    //
@@ -680,16 +689,6 @@
    }
    if (threadCount.getValue() != null &&
            !threadCount.getValue().equals(
                    threadCount.getDefaultValue())) {
      values = new ArrayList<ByteString>(1);
      values.add(ByteString.valueOf(threadCount.getValue()));
      attributes.add(new LDAPAttribute(ATTR_IMPORT_THREAD_COUNT, values));
    }
    if (isCompressed.getValue() != null &&
            !isCompressed.getValue().equals(
                    isCompressed.getDefaultValue())) {
@@ -1335,39 +1334,34 @@
      importConfig = new LDIFImportConfig(tf);
    }
    int tc = -1;
    if(threadCount.isPresent())
    {
      // Create the LDIF import configuration to use when reading the LDIF.
      importConfig.setAppendToExistingData(append.isPresent());
      importConfig.setReplaceExistingEntries(replaceExisting.isPresent());
      importConfig.setCompressed(isCompressed.isPresent());
      importConfig.setClearBackend(clearBackend.isPresent());
      importConfig.setEncrypted(isEncrypted.isPresent());
      importConfig.setExcludeAttributes(excludeAttributes);
      importConfig.setExcludeBranches(excludeBranches);
      importConfig.setExcludeFilters(excludeFilters);
      importConfig.setIncludeAttributes(includeAttributes);
      importConfig.setIncludeBranches(includeBranches);
      importConfig.setIncludeFilters(includeFilters);
      importConfig.setValidateSchema(!skipSchemaValidation.isPresent());
      importConfig.setSkipDNValidation(skipDNValidation.isPresent());
      importConfig.setTmpDirectory(tmpDirectory.getValue());
      try
      {
        tc = threadCount.getIntValue();
          importConfig.setThreadCount(threadCount.getIntValue());
      }
      catch(Exception e)
      {
        Message msg = ERR_LDIFIMPORT_CANNOT_PARSE_THREAD_COUNT.get(
            threadCount.getValue(), e.getMessage());
        logError(msg);
        return 1;
          Message msg = ERR_LDIFIMPORT_CANNOT_PARSE_THREAD_COUNT.get(
                  threadCount.getValue(), e.getMessage());
          logError(msg);
          return 1;
      }
    }
    // Create the LDIF import configuration to use when reading the LDIF.
    importConfig.setAppendToExistingData(append.isPresent());
    importConfig.setReplaceExistingEntries(replaceExisting.isPresent());
    importConfig.setCompressed(isCompressed.isPresent());
    importConfig.setClearBackend(clearBackend.isPresent());
    importConfig.setEncrypted(isEncrypted.isPresent());
    importConfig.setExcludeAttributes(excludeAttributes);
    importConfig.setExcludeBranches(excludeBranches);
    importConfig.setExcludeFilters(excludeFilters);
    importConfig.setIncludeAttributes(includeAttributes);
    importConfig.setIncludeBranches(includeBranches);
    importConfig.setIncludeFilters(includeFilters);
    importConfig.setValidateSchema(!skipSchemaValidation.isPresent());
    importConfig.setSkipDNValidation(skipDNValidation.isPresent());
    importConfig.setTmpDirectory(tmpDirectory.getValue());
    importConfig.setThreadCount(tc);
    importConfig.setBufferSize(LDIF_BUFFER_SIZE);
    importConfig.setExcludeAllUserAttributes(