message);
}
}
Entry taskEntry = getTaskEntry();
AttributeType typeLdifFile;
AttributeType typeTemplateFile;
AttributeType typeAppend;
AttributeType typeReplaceExisting;
AttributeType typeBackendID;
AttributeType typeIncludeBranch;
AttributeType typeExcludeBranch;
AttributeType typeIncludeAttribute;
AttributeType typeExcludeAttribute;
AttributeType typeIncludeFilter;
AttributeType typeExcludeFilter;
AttributeType typeRejectFile;
AttributeType typeSkipFile;
AttributeType typeOverwrite;
AttributeType typeSkipSchemaValidation;
AttributeType typeIsCompressed;
AttributeType typeIsEncrypted;
AttributeType typeClearBackend;
AttributeType typeRandomSeed;
AttributeType typeThreadCount;
AttributeType typeTmpDirectory;
AttributeType typeDNCheckPhase2;
typeLdifFile =
getAttributeType(ATTR_IMPORT_LDIF_FILE, true);
typeTemplateFile =
getAttributeType(ATTR_IMPORT_TEMPLATE_FILE, true);
typeAppend =
getAttributeType(ATTR_IMPORT_APPEND, true);
typeReplaceExisting =
getAttributeType(ATTR_IMPORT_REPLACE_EXISTING, true);
typeBackendID =
getAttributeType(ATTR_IMPORT_BACKEND_ID, true);
typeIncludeBranch =
getAttributeType(ATTR_IMPORT_INCLUDE_BRANCH, true);
typeExcludeBranch =
getAttributeType(ATTR_IMPORT_EXCLUDE_BRANCH, true);
typeIncludeAttribute =
getAttributeType(ATTR_IMPORT_INCLUDE_ATTRIBUTE, true);
typeExcludeAttribute =
getAttributeType(ATTR_IMPORT_EXCLUDE_ATTRIBUTE, true);
typeIncludeFilter =
getAttributeType(ATTR_IMPORT_INCLUDE_FILTER, true);
typeExcludeFilter =
getAttributeType(ATTR_IMPORT_EXCLUDE_FILTER, true);
typeRejectFile =
getAttributeType(ATTR_IMPORT_REJECT_FILE, true);
typeSkipFile =
getAttributeType(ATTR_IMPORT_SKIP_FILE, true);
typeOverwrite =
getAttributeType(ATTR_IMPORT_OVERWRITE, true);
typeSkipSchemaValidation =
getAttributeType(ATTR_IMPORT_SKIP_SCHEMA_VALIDATION, true);
typeIsCompressed =
getAttributeType(ATTR_IMPORT_IS_COMPRESSED, true);
typeIsEncrypted =
getAttributeType(ATTR_IMPORT_IS_ENCRYPTED, true);
typeClearBackend =
getAttributeType(ATTR_IMPORT_CLEAR_BACKEND, true);
typeRandomSeed =
getAttributeType(ATTR_IMPORT_RANDOM_SEED, true);
typeThreadCount =
getAttributeType(ATTR_IMPORT_THREAD_COUNT, true);
typeTmpDirectory =
getAttributeType(ATTR_IMPORT_TMP_DIRECTORY, true);
typeDNCheckPhase2 =
getAttributeType(ATTR_IMPORT_SKIP_DN_VALIDATION, true);
List<Attribute> attrList;
attrList = taskEntry.getAttribute(typeLdifFile);
ArrayList<String> ldifFilestmp = TaskUtils.getMultiValueString(attrList);
ldifFiles = new ArrayList<String>(ldifFilestmp.size());
for (String s : ldifFilestmp)
{
File f = new File (s);
if (!f.isAbsolute())
{
f = new File(DirectoryServer.getInstanceRoot(), s);
try
{
s = f.getCanonicalPath();
}
catch (Exception ex)
{
s = f.getAbsolutePath();
}
ldifFiles.add(s);
}
else
{
ldifFiles.add(s);
}
}
attrList = taskEntry.getAttribute(typeTemplateFile);
templateFile = TaskUtils.getSingleValueString(attrList);
if (templateFile != null)
{
File f = new File(templateFile);
if (!f.isAbsolute())
{
templateFile = new File(DirectoryServer.getInstanceRoot(), templateFile)
.getAbsolutePath();
}
}
attrList = taskEntry.getAttribute(typeAppend);
append = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeDNCheckPhase2);
skipDNValidation = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeTmpDirectory);
tmpDirectory = TaskUtils.getSingleValueString(attrList);
attrList = taskEntry.getAttribute(typeReplaceExisting);
replaceExisting = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeBackendID);
backendID = TaskUtils.getSingleValueString(attrList);
attrList = taskEntry.getAttribute(typeIncludeBranch);
includeBranchStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeExcludeBranch);
excludeBranchStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeIncludeAttribute);
includeAttributeStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeExcludeAttribute);
excludeAttributeStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeIncludeFilter);
includeFilterStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeExcludeFilter);
excludeFilterStrings = TaskUtils.getMultiValueString(attrList);
attrList = taskEntry.getAttribute(typeRejectFile);
rejectFile = TaskUtils.getSingleValueString(attrList);
attrList = taskEntry.getAttribute(typeSkipFile);
skipFile = TaskUtils.getSingleValueString(attrList);
attrList = taskEntry.getAttribute(typeOverwrite);
overwrite = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeSkipSchemaValidation);
skipSchemaValidation = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeIsCompressed);
isCompressed = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeIsEncrypted);
isEncrypted = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeClearBackend);
clearBackend = TaskUtils.getBoolean(attrList, false);
attrList = taskEntry.getAttribute(typeRandomSeed);
randomSeed = TaskUtils.getSingleValueInteger(attrList, 0);
attrList = taskEntry.getAttribute(typeThreadCount);
threadCount = TaskUtils.getSingleValueInteger(attrList, 0);
// Make sure that either the "includeBranchStrings" argument or the
// "backendID" argument was provided.
if(includeBranchStrings.isEmpty() && backendID == null)