From 328ec50e683c622586d30aeb9dee55bebdebfe0c Mon Sep 17 00:00:00 2001
From: dugan <dugan@localhost>
Date: Fri, 24 Jul 2009 22:32:43 +0000
Subject: [PATCH] Commit of new import code.

---
 opends/src/server/org/opends/server/tasks/ImportTask.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/tasks/ImportTask.java b/opends/src/server/org/opends/server/tasks/ImportTask.java
index a8aa714..56103ac 100644
--- a/opends/src/server/org/opends/server/tasks/ImportTask.java
+++ b/opends/src/server/org/opends/server/tasks/ImportTask.java
@@ -170,6 +170,8 @@
   private boolean replaceExisting = false;
   private boolean skipSchemaValidation = false;
   private boolean clearBackend = false;
+  private boolean dnCheckPhase2 = false;
+  private String tmpDirectory = null;
   private String backendID = null;
   private String rejectFile = null;
   private String skipFile = null;
@@ -241,6 +243,8 @@
     AttributeType typeIsEncrypted;
     AttributeType typeClearBackend;
     AttributeType typeRandomSeed;
+    AttributeType typeTmpDirectory;
+    AttributeType typeDNCheckPhase2;
 
     typeLdifFile =
          getAttributeType(ATTR_IMPORT_LDIF_FILE, true);
@@ -280,6 +284,10 @@
          getAttributeType(ATTR_IMPORT_CLEAR_BACKEND, true);
     typeRandomSeed =
          getAttributeType(ATTR_IMPORT_RANDOM_SEED, true);
+    typeTmpDirectory =
+         getAttributeType(ATTR_IMPORT_TMP_DIRECTORY, true);
+    typeDNCheckPhase2 =
+         getAttributeType(ATTR_IMPORT_DN_CHECK_PHASE2, true);
 
     List<Attribute> attrList;
 
@@ -323,6 +331,12 @@
     attrList = taskEntry.getAttribute(typeAppend);
     append = TaskUtils.getBoolean(attrList, false);
 
+    attrList = taskEntry.getAttribute(typeDNCheckPhase2);
+    dnCheckPhase2 = TaskUtils.getBoolean(attrList, true);
+
+    attrList = taskEntry.getAttribute(typeTmpDirectory);
+    tmpDirectory = TaskUtils.getSingleValueString(attrList);
+
     attrList = taskEntry.getAttribute(typeReplaceExisting);
     replaceExisting = TaskUtils.getBoolean(attrList, false);
 
@@ -861,6 +875,10 @@
       ArrayList<String> fileList = new ArrayList<String>(ldifFiles);
       importConfig = new LDIFImportConfig(fileList);
     }
+    if(tmpDirectory == null)
+    {
+      tmpDirectory = "import-tmp";
+    }
     importConfig.setAppendToExistingData(append);
     importConfig.setReplaceExistingEntries(replaceExisting);
     importConfig.setCompressed(isCompressed);
@@ -873,6 +891,8 @@
     importConfig.setIncludeBranches(includeBranches);
     importConfig.setIncludeFilters(includeFilters);
     importConfig.setValidateSchema(!skipSchemaValidation);
+    importConfig.setDNCheckPhase2(dnCheckPhase2);
+    importConfig.setTmpDirectory(tmpDirectory);
 
     // FIXME -- Should this be conditional?
     importConfig.setInvokeImportPlugins(true);

--
Gitblit v1.10.0