if (fileList != null && fileList.size() > 0) {
values = new ArrayList<ByteString>(fileList.size());
for (String file : fileList) {
values.add(ByteString.valueOf(file));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_LDIF_FILE, values));
}
}
String templateFileValue = templateFile.getValue();
if (templateFileValue != null)
{
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(templateFileValue));
attributes.add(new LDAPAttribute(ATTR_IMPORT_TEMPLATE_FILE, values));
}
String randomSeedValue = randomSeed.getValue();
if (randomSeedValue != null)
{
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(randomSeedValue));
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
//
if (append.getValue() != null &&
!append.getValue().equals(append.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(append.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_APPEND, values));
}
if (replaceExisting.getValue() != null &&
!replaceExisting.getValue().equals(
replaceExisting.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(replaceExisting.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_REPLACE_EXISTING, values));
}
if (backendID.getValue() != null &&
!backendID.getValue().equals(
backendID.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(backendID.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_BACKEND_ID, values));
}
List<String> includeAttributes = includeAttributeStrings.getValues();
if (includeAttributes != null && includeAttributes.size() > 0) {
values = new ArrayList<ByteString>(includeAttributes.size());
for (String includeAttribute : includeAttributes) {
values.add(ByteString.valueOf(includeAttribute));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_INCLUDE_ATTRIBUTE, values));
}
List<String> excludeAttributes = excludeAttributeStrings.getValues();
if (excludeAttributes != null && excludeAttributes.size() > 0) {
values = new ArrayList<ByteString>(excludeAttributes.size());
for (String excludeAttribute : excludeAttributes) {
values.add(ByteString.valueOf(excludeAttribute));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_EXCLUDE_ATTRIBUTE, values));
}
List<String> includeFilters = includeFilterStrings.getValues();
if (includeFilters != null && includeFilters.size() > 0) {
values = new ArrayList<ByteString>(includeFilters.size());
for (String includeFilter : includeFilters) {
values.add(ByteString.valueOf(includeFilter));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_INCLUDE_FILTER, values));
}
List<String> excludeFilters = excludeFilterStrings.getValues();
if (excludeFilters != null && excludeFilters.size() > 0) {
values = new ArrayList<ByteString>(excludeFilters.size());
for (String excludeFilter : excludeFilters) {
values.add(ByteString.valueOf(excludeFilter));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_EXCLUDE_FILTER, values));
}
List<String> includeBranches = includeBranchStrings.getValues();
if (includeBranches != null && includeBranches.size() > 0) {
values = new ArrayList<ByteString>(includeBranches.size());
for (String includeBranche : includeBranches) {
values.add(ByteString.valueOf(includeBranche));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_INCLUDE_BRANCH, values));
}
List<String> excludeBranches = excludeBranchStrings.getValues();
if (excludeBranches != null && excludeBranches.size() > 0) {
values = new ArrayList<ByteString>(excludeBranches.size());
for (String excludeBranch : excludeBranches) {
values.add(ByteString.valueOf(excludeBranch));
}
attributes.add(new LDAPAttribute(ATTR_IMPORT_EXCLUDE_BRANCH, values));
}
if (rejectFile.getValue() != null &&
!rejectFile.getValue().equals(
rejectFile.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(rejectFile.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_REJECT_FILE, values));
}
if (skipFile.getValue() != null &&
!skipFile.getValue().equals(
skipFile.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(skipFile.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_SKIP_FILE, values));
}
if (overwrite.getValue() != null &&
!overwrite.getValue().equals(
overwrite.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(overwrite.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_OVERWRITE, values));
}
if (skipSchemaValidation.getValue() != null &&
!skipSchemaValidation.getValue().equals(
skipSchemaValidation.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(skipSchemaValidation.getValue()));
attributes.add(
new LDAPAttribute(ATTR_IMPORT_SKIP_SCHEMA_VALIDATION, values));
}
if (tmpDirectory.getValue() != null &&
!tmpDirectory.getValue().equals(
tmpDirectory.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(tmpDirectory.getValue()));
attributes.add(new LDAPAttribute(ATTR_IMPORT_TMP_DIRECTORY, values));
}
if (skipDNValidation.getValue() != null &&
!skipDNValidation.getValue().equals(
skipDNValidation.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(skipDNValidation.getValue()));
attributes.add(
new LDAPAttribute(ATTR_IMPORT_SKIP_DN_VALIDATION, values));
}
if (isCompressed.getValue() != null &&
!isCompressed.getValue().equals(
isCompressed.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(isCompressed.getValue()));
attributes.add(
new LDAPAttribute(ATTR_IMPORT_IS_COMPRESSED, values));
}
if (isEncrypted.getValue() != null &&
!isEncrypted.getValue().equals(
isEncrypted.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(isEncrypted.getValue()));
attributes.add(
new LDAPAttribute(ATTR_IMPORT_IS_ENCRYPTED, values));
}
if (clearBackend.getValue() != null &&
!clearBackend.getValue().equals(
clearBackend.getDefaultValue())) {
values = new ArrayList<ByteString>(1);
values.add(ByteString.valueOf(clearBackend.getValue()));
attributes.add(
new LDAPAttribute(ATTR_IMPORT_CLEAR_BACKEND, values));
}
}