Search in sources :

Example 6 with FilterArgument

use of com.unboundid.util.args.FilterArgument in project ldapsdk by pingidentity.

the class TransformLDIF method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    // Add arguments pertaining to the source and target LDIF files.
    sourceLDIF = new FileArgument('l', "sourceLDIF", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_SOURCE_LDIF.get(), true, true, true, false);
    sourceLDIF.addLongIdentifier("inputLDIF", true);
    sourceLDIF.addLongIdentifier("source-ldif", true);
    sourceLDIF.addLongIdentifier("input-ldif", true);
    sourceLDIF.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(sourceLDIF);
    sourceFromStandardInput = new BooleanArgument(null, "sourceFromStandardInput", 1, INFO_TRANSFORM_LDIF_ARG_DESC_SOURCE_STD_IN.get());
    sourceFromStandardInput.addLongIdentifier("source-from-standard-input", true);
    sourceFromStandardInput.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(sourceFromStandardInput);
    parser.addRequiredArgumentSet(sourceLDIF, sourceFromStandardInput);
    parser.addExclusiveArgumentSet(sourceLDIF, sourceFromStandardInput);
    targetLDIF = new FileArgument('o', "targetLDIF", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_TARGET_LDIF.get(), false, true, true, false);
    targetLDIF.addLongIdentifier("outputLDIF", true);
    targetLDIF.addLongIdentifier("target-ldif", true);
    targetLDIF.addLongIdentifier("output-ldif", true);
    targetLDIF.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(targetLDIF);
    targetToStandardOutput = new BooleanArgument(null, "targetToStandardOutput", 1, INFO_TRANSFORM_LDIF_ARG_DESC_TARGET_STD_OUT.get());
    targetToStandardOutput.addLongIdentifier("target-to-standard-output", true);
    targetToStandardOutput.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(targetToStandardOutput);
    parser.addExclusiveArgumentSet(targetLDIF, targetToStandardOutput);
    sourceContainsChangeRecords = new BooleanArgument(null, "sourceContainsChangeRecords", INFO_TRANSFORM_LDIF_ARG_DESC_SOURCE_CONTAINS_CHANGE_RECORDS.get());
    sourceContainsChangeRecords.addLongIdentifier("source-contains-change-records", true);
    sourceContainsChangeRecords.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(sourceContainsChangeRecords);
    appendToTargetLDIF = new BooleanArgument(null, "appendToTargetLDIF", INFO_TRANSFORM_LDIF_ARG_DESC_APPEND_TO_TARGET.get());
    appendToTargetLDIF.addLongIdentifier("append-to-target-ldif", true);
    appendToTargetLDIF.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(appendToTargetLDIF);
    parser.addExclusiveArgumentSet(targetToStandardOutput, appendToTargetLDIF);
    wrapColumn = new IntegerArgument(null, "wrapColumn", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_WRAP_COLUMN.get(), 5, Integer.MAX_VALUE);
    wrapColumn.addLongIdentifier("wrap-column", true);
    wrapColumn.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(wrapColumn);
    sourceCompressed = new BooleanArgument('C', "sourceCompressed", INFO_TRANSFORM_LDIF_ARG_DESC_SOURCE_COMPRESSED.get());
    sourceCompressed.addLongIdentifier("inputCompressed", true);
    sourceCompressed.addLongIdentifier("source-compressed", true);
    sourceCompressed.addLongIdentifier("input-compressed", true);
    sourceCompressed.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(sourceCompressed);
    compressTarget = new BooleanArgument('c', "compressTarget", INFO_TRANSFORM_LDIF_ARG_DESC_COMPRESS_TARGET.get());
    compressTarget.addLongIdentifier("compressOutput", true);
    compressTarget.addLongIdentifier("compress", true);
    compressTarget.addLongIdentifier("compress-target", true);
    compressTarget.addLongIdentifier("compress-output", true);
    compressTarget.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(compressTarget);
    encryptTarget = new BooleanArgument(null, "encryptTarget", INFO_TRANSFORM_LDIF_ARG_DESC_ENCRYPT_TARGET.get());
    encryptTarget.addLongIdentifier("encryptOutput", true);
    encryptTarget.addLongIdentifier("encrypt", true);
    encryptTarget.addLongIdentifier("encrypt-target", true);
    encryptTarget.addLongIdentifier("encrypt-output", true);
    encryptTarget.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(encryptTarget);
    encryptionPassphraseFile = new FileArgument(null, "encryptionPassphraseFile", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_ENCRYPTION_PW_FILE.get(), true, true, true, false);
    encryptionPassphraseFile.addLongIdentifier("encryptionPasswordFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-passphrase-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-password-file", true);
    encryptionPassphraseFile.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_LDIF.get());
    parser.addArgument(encryptionPassphraseFile);
    // Add arguments pertaining to attribute scrambling.
    scrambleAttribute = new StringArgument('a', "scrambleAttribute", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_SCRAMBLE_ATTR.get());
    scrambleAttribute.addLongIdentifier("attributeName", true);
    scrambleAttribute.addLongIdentifier("scramble-attribute", true);
    scrambleAttribute.addLongIdentifier("attribute-name", true);
    scrambleAttribute.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SCRAMBLE.get());
    parser.addArgument(scrambleAttribute);
    scrambleJSONField = new StringArgument(null, "scrambleJSONField", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_FIELD_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_SCRAMBLE_JSON_FIELD.get(scrambleAttribute.getIdentifierString()));
    scrambleJSONField.addLongIdentifier("scramble-json-field", true);
    scrambleJSONField.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SCRAMBLE.get());
    parser.addArgument(scrambleJSONField);
    parser.addDependentArgumentSet(scrambleJSONField, scrambleAttribute);
    randomSeed = new IntegerArgument('s', "randomSeed", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_RANDOM_SEED.get());
    randomSeed.addLongIdentifier("random-seed", true);
    randomSeed.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SCRAMBLE.get());
    parser.addArgument(randomSeed);
    // Add arguments pertaining to replacing attribute values with a generated
    // value using a sequential counter.
    sequentialAttribute = new StringArgument('S', "sequentialAttribute", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_SEQUENTIAL_ATTR.get(sourceContainsChangeRecords.getIdentifierString()));
    sequentialAttribute.addLongIdentifier("sequentialAttributeName", true);
    sequentialAttribute.addLongIdentifier("sequential-attribute", true);
    sequentialAttribute.addLongIdentifier("sequential-attribute-name", true);
    sequentialAttribute.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SEQUENTIAL.get());
    parser.addArgument(sequentialAttribute);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, sequentialAttribute);
    initialSequentialValue = new IntegerArgument('i', "initialSequentialValue", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_INITIAL_SEQUENTIAL_VALUE.get(sequentialAttribute.getIdentifierString()));
    initialSequentialValue.addLongIdentifier("initial-sequential-value", true);
    initialSequentialValue.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SEQUENTIAL.get());
    parser.addArgument(initialSequentialValue);
    parser.addDependentArgumentSet(initialSequentialValue, sequentialAttribute);
    sequentialValueIncrement = new IntegerArgument(null, "sequentialValueIncrement", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_SEQUENTIAL_INCREMENT.get(sequentialAttribute.getIdentifierString()));
    sequentialValueIncrement.addLongIdentifier("sequential-value-increment", true);
    sequentialValueIncrement.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SEQUENTIAL.get());
    parser.addArgument(sequentialValueIncrement);
    parser.addDependentArgumentSet(sequentialValueIncrement, sequentialAttribute);
    textBeforeSequentialValue = new StringArgument(null, "textBeforeSequentialValue", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_SEQUENTIAL_TEXT_BEFORE.get(sequentialAttribute.getIdentifierString()));
    textBeforeSequentialValue.addLongIdentifier("text-before-sequential-value", true);
    textBeforeSequentialValue.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SEQUENTIAL.get());
    parser.addArgument(textBeforeSequentialValue);
    parser.addDependentArgumentSet(textBeforeSequentialValue, sequentialAttribute);
    textAfterSequentialValue = new StringArgument(null, "textAfterSequentialValue", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_SEQUENTIAL_TEXT_AFTER.get(sequentialAttribute.getIdentifierString()));
    textAfterSequentialValue.addLongIdentifier("text-after-sequential-value", true);
    textAfterSequentialValue.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_SEQUENTIAL.get());
    parser.addArgument(textAfterSequentialValue);
    parser.addDependentArgumentSet(textAfterSequentialValue, sequentialAttribute);
    // Add arguments pertaining to attribute value replacement.
    replaceValuesAttribute = new StringArgument(null, "replaceValuesAttribute", false, 1, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_REPLACE_VALUES_ATTR.get(sourceContainsChangeRecords.getIdentifierString()));
    replaceValuesAttribute.addLongIdentifier("replace-values-attribute", true);
    replaceValuesAttribute.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_REPLACE_VALUES.get());
    parser.addArgument(replaceValuesAttribute);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, replaceValuesAttribute);
    replacementValue = new StringArgument(null, "replacementValue", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_REPLACEMENT_VALUE.get(replaceValuesAttribute.getIdentifierString()));
    replacementValue.addLongIdentifier("replacement-value", true);
    replacementValue.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_REPLACE_VALUES.get());
    parser.addArgument(replacementValue);
    parser.addDependentArgumentSet(replaceValuesAttribute, replacementValue);
    parser.addDependentArgumentSet(replacementValue, replaceValuesAttribute);
    // Add arguments pertaining to adding missing attributes.
    addAttributeName = new StringArgument(null, "addAttributeName", false, 1, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_ADD_ATTR.get("--addAttributeValue", sourceContainsChangeRecords.getIdentifierString()));
    addAttributeName.addLongIdentifier("add-attribute-name", true);
    addAttributeName.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addAttributeName);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, addAttributeName);
    addAttributeValue = new StringArgument(null, "addAttributeValue", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_ADD_VALUE.get(addAttributeName.getIdentifierString()));
    addAttributeValue.addLongIdentifier("add-attribute-value", true);
    addAttributeValue.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addAttributeValue);
    parser.addDependentArgumentSet(addAttributeName, addAttributeValue);
    parser.addDependentArgumentSet(addAttributeValue, addAttributeName);
    addToExistingValues = new BooleanArgument(null, "addToExistingValues", INFO_TRANSFORM_LDIF_ARG_DESC_ADD_MERGE_VALUES.get(addAttributeName.getIdentifierString(), addAttributeValue.getIdentifierString()));
    addToExistingValues.addLongIdentifier("add-to-existing-values", true);
    addToExistingValues.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addToExistingValues);
    parser.addDependentArgumentSet(addToExistingValues, addAttributeName);
    addAttributeBaseDN = new DNArgument(null, "addAttributeBaseDN", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_ADD_BASE_DN.get(addAttributeName.getIdentifierString()));
    addAttributeBaseDN.addLongIdentifier("add-attribute-base-dn", true);
    addAttributeBaseDN.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addAttributeBaseDN);
    parser.addDependentArgumentSet(addAttributeBaseDN, addAttributeName);
    addAttributeScope = new ScopeArgument(null, "addAttributeScope", false, null, INFO_TRANSFORM_LDIF_ARG_DESC_ADD_SCOPE.get(addAttributeBaseDN.getIdentifierString(), addAttributeName.getIdentifierString()));
    addAttributeScope.addLongIdentifier("add-attribute-scope", true);
    addAttributeScope.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addAttributeScope);
    parser.addDependentArgumentSet(addAttributeScope, addAttributeName);
    addAttributeFilter = new FilterArgument(null, "addAttributeFilter", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_ADD_FILTER.get(addAttributeName.getIdentifierString()));
    addAttributeFilter.addLongIdentifier("add-attribute-filter", true);
    addAttributeFilter.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_ADD_ATTR.get());
    parser.addArgument(addAttributeFilter);
    parser.addDependentArgumentSet(addAttributeFilter, addAttributeName);
    // Add arguments pertaining to renaming attributes.
    renameAttributeFrom = new StringArgument(null, "renameAttributeFrom", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_RENAME_FROM.get());
    renameAttributeFrom.addLongIdentifier("rename-attribute-from", true);
    renameAttributeFrom.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_RENAME.get());
    parser.addArgument(renameAttributeFrom);
    renameAttributeTo = new StringArgument(null, "renameAttributeTo", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_RENAME_TO.get(renameAttributeFrom.getIdentifierString()));
    renameAttributeTo.addLongIdentifier("rename-attribute-to", true);
    renameAttributeTo.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_RENAME.get());
    parser.addArgument(renameAttributeTo);
    parser.addDependentArgumentSet(renameAttributeFrom, renameAttributeTo);
    parser.addDependentArgumentSet(renameAttributeTo, renameAttributeFrom);
    // Add arguments pertaining to flattening subtrees.
    flattenBaseDN = new DNArgument(null, "flattenBaseDN", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_FLATTEN_BASE_DN.get());
    flattenBaseDN.addLongIdentifier("flatten-base-dn", true);
    flattenBaseDN.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_FLATTEN.get());
    parser.addArgument(flattenBaseDN);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, flattenBaseDN);
    flattenAddOmittedRDNAttributesToEntry = new BooleanArgument(null, "flattenAddOmittedRDNAttributesToEntry", 1, INFO_TRANSFORM_LDIF_ARG_DESC_FLATTEN_ADD_OMITTED_TO_ENTRY.get());
    flattenAddOmittedRDNAttributesToEntry.addLongIdentifier("flatten-add-omitted-rdn-attributes-to-entry", true);
    flattenAddOmittedRDNAttributesToEntry.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_FLATTEN.get());
    parser.addArgument(flattenAddOmittedRDNAttributesToEntry);
    parser.addDependentArgumentSet(flattenAddOmittedRDNAttributesToEntry, flattenBaseDN);
    flattenAddOmittedRDNAttributesToRDN = new BooleanArgument(null, "flattenAddOmittedRDNAttributesToRDN", 1, INFO_TRANSFORM_LDIF_ARG_DESC_FLATTEN_ADD_OMITTED_TO_RDN.get());
    flattenAddOmittedRDNAttributesToRDN.addLongIdentifier("flatten-add-omitted-rdn-attributes-to-rdn", true);
    flattenAddOmittedRDNAttributesToRDN.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_FLATTEN.get());
    parser.addArgument(flattenAddOmittedRDNAttributesToRDN);
    parser.addDependentArgumentSet(flattenAddOmittedRDNAttributesToRDN, flattenBaseDN);
    flattenExcludeFilter = new FilterArgument(null, "flattenExcludeFilter", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_FLATTEN_EXCLUDE_FILTER.get());
    flattenExcludeFilter.addLongIdentifier("flatten-exclude-filter", true);
    flattenExcludeFilter.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_FLATTEN.get());
    parser.addArgument(flattenExcludeFilter);
    parser.addDependentArgumentSet(flattenExcludeFilter, flattenBaseDN);
    // Add arguments pertaining to moving subtrees.
    moveSubtreeFrom = new DNArgument(null, "moveSubtreeFrom", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_MOVE_SUBTREE_FROM.get());
    moveSubtreeFrom.addLongIdentifier("move-subtree-from", true);
    moveSubtreeFrom.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_MOVE.get());
    parser.addArgument(moveSubtreeFrom);
    moveSubtreeTo = new DNArgument(null, "moveSubtreeTo", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_MOVE_SUBTREE_TO.get(moveSubtreeFrom.getIdentifierString()));
    moveSubtreeTo.addLongIdentifier("move-subtree-to", true);
    moveSubtreeTo.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_MOVE.get());
    parser.addArgument(moveSubtreeTo);
    parser.addDependentArgumentSet(moveSubtreeFrom, moveSubtreeTo);
    parser.addDependentArgumentSet(moveSubtreeTo, moveSubtreeFrom);
    // Add arguments pertaining to redacting attribute values.
    redactAttribute = new StringArgument(null, "redactAttribute", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_REDACT_ATTR.get());
    redactAttribute.addLongIdentifier("redact-attribute", true);
    redactAttribute.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_REDACT.get());
    parser.addArgument(redactAttribute);
    hideRedactedValueCount = new BooleanArgument(null, "hideRedactedValueCount", INFO_TRANSFORM_LDIF_ARG_DESC_HIDE_REDACTED_COUNT.get());
    hideRedactedValueCount.addLongIdentifier("hide-redacted-value-count", true);
    hideRedactedValueCount.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_REDACT.get());
    parser.addArgument(hideRedactedValueCount);
    parser.addDependentArgumentSet(hideRedactedValueCount, redactAttribute);
    // Add arguments pertaining to excluding attributes and entries.
    excludeAttribute = new StringArgument(null, "excludeAttribute", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_ATTR_NAME.get(), INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_ATTR.get());
    excludeAttribute.addLongIdentifier("suppressAttribute", true);
    excludeAttribute.addLongIdentifier("exclude-attribute", true);
    excludeAttribute.addLongIdentifier("suppress-attribute", true);
    excludeAttribute.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeAttribute);
    excludeEntryBaseDN = new DNArgument(null, "excludeEntryBaseDN", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_ENTRY_BASE_DN.get(sourceContainsChangeRecords.getIdentifierString()));
    excludeEntryBaseDN.addLongIdentifier("suppressEntryBaseDN", true);
    excludeEntryBaseDN.addLongIdentifier("exclude-entry-base-dn", true);
    excludeEntryBaseDN.addLongIdentifier("suppress-entry-base-dn", true);
    excludeEntryBaseDN.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeEntryBaseDN);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, excludeEntryBaseDN);
    excludeEntryScope = new ScopeArgument(null, "excludeEntryScope", false, null, INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_ENTRY_SCOPE.get(sourceContainsChangeRecords.getIdentifierString()));
    excludeEntryScope.addLongIdentifier("suppressEntryScope", true);
    excludeEntryScope.addLongIdentifier("exclude-entry-scope", true);
    excludeEntryScope.addLongIdentifier("suppress-entry-scope", true);
    excludeEntryScope.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeEntryScope);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, excludeEntryScope);
    excludeEntryFilter = new FilterArgument(null, "excludeEntryFilter", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_ENTRY_FILTER.get(sourceContainsChangeRecords.getIdentifierString()));
    excludeEntryFilter.addLongIdentifier("suppressEntryFilter", true);
    excludeEntryFilter.addLongIdentifier("exclude-entry-filter", true);
    excludeEntryFilter.addLongIdentifier("suppress-entry-filter", true);
    excludeEntryFilter.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeEntryFilter);
    parser.addExclusiveArgumentSet(sourceContainsChangeRecords, excludeEntryFilter);
    excludeNonMatchingEntries = new BooleanArgument(null, "excludeNonMatchingEntries", INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_NON_MATCHING.get());
    excludeNonMatchingEntries.addLongIdentifier("exclude-non-matching-entries", true);
    excludeNonMatchingEntries.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeNonMatchingEntries);
    parser.addDependentArgumentSet(excludeNonMatchingEntries, excludeEntryBaseDN, excludeEntryScope, excludeEntryFilter);
    // Add arguments for excluding records based on their change types.
    excludeChangeType = new StringArgument(null, "excludeChangeType", false, 0, INFO_TRANSFORM_LDIF_PLACEHOLDER_CHANGE_TYPES.get(), INFO_TRANSFORM_LDIF_ARG_DESC_EXCLUDE_CHANGE_TYPE.get(), StaticUtils.setOf("add", "delete", "modify", "moddn"));
    excludeChangeType.addLongIdentifier("exclude-change-type", true);
    excludeChangeType.addLongIdentifier("exclude-changetype", true);
    excludeChangeType.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeChangeType);
    // Add arguments for excluding records that don't have a change type.
    excludeRecordsWithoutChangeType = new BooleanArgument(null, "excludeRecordsWithoutChangeType", 1, INFO_TRANSFORM_LDIF_EXCLUDE_WITHOUT_CHANGETYPE.get());
    excludeRecordsWithoutChangeType.addLongIdentifier("exclude-records-without-change-type", true);
    excludeRecordsWithoutChangeType.addLongIdentifier("exclude-records-without-changetype", true);
    excludeRecordsWithoutChangeType.setArgumentGroupName(INFO_TRANSFORM_LDIF_ARG_GROUP_EXCLUDE.get());
    parser.addArgument(excludeRecordsWithoutChangeType);
    // Add the remaining arguments.
    schemaPath = new FileArgument(null, "schemaPath", false, 0, null, INFO_TRANSFORM_LDIF_ARG_DESC_SCHEMA_PATH.get(), true, true, false, false);
    schemaPath.addLongIdentifier("schemaFile", true);
    schemaPath.addLongIdentifier("schemaDirectory", true);
    schemaPath.addLongIdentifier("schema-path", true);
    schemaPath.addLongIdentifier("schema-file", true);
    schemaPath.addLongIdentifier("schema-directory", true);
    parser.addArgument(schemaPath);
    numThreads = new IntegerArgument('t', "numThreads", false, 1, null, INFO_TRANSFORM_LDIF_ARG_DESC_NUM_THREADS.get(), 1, Integer.MAX_VALUE, 1);
    numThreads.addLongIdentifier("num-threads", true);
    parser.addArgument(numThreads);
    processDNs = new BooleanArgument('d', "processDNs", INFO_TRANSFORM_LDIF_ARG_DESC_PROCESS_DNS.get());
    processDNs.addLongIdentifier("process-dns", true);
    parser.addArgument(processDNs);
    // Ensure that at least one kind of transformation was requested.
    parser.addRequiredArgumentSet(scrambleAttribute, sequentialAttribute, replaceValuesAttribute, addAttributeName, renameAttributeFrom, flattenBaseDN, moveSubtreeFrom, redactAttribute, excludeAttribute, excludeEntryBaseDN, excludeEntryScope, excludeEntryFilter, excludeChangeType, excludeRecordsWithoutChangeType);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) ScopeArgument(com.unboundid.util.args.ScopeArgument) FilterArgument(com.unboundid.util.args.FilterArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 7 with FilterArgument

use of com.unboundid.util.args.FilterArgument in project ldapsdk by pingidentity.

the class LDAPDelete method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    this.parser = parser;
    // 
    // Data Arguments
    // 
    final String argGroupData = INFO_LDAPDELETE_ARG_GROUP_DATA.get();
    entryDN = new DNArgument('b', "entryDN", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DN.get());
    entryDN.addLongIdentifier("entry-dn", true);
    entryDN.addLongIdentifier("dn", true);
    entryDN.addLongIdentifier("dnToDelete", true);
    entryDN.addLongIdentifier("dn-to-delete", true);
    entryDN.addLongIdentifier("entry", true);
    entryDN.addLongIdentifier("entryToDelete", true);
    entryDN.addLongIdentifier("entry-to-delete", true);
    entryDN.setArgumentGroupName(argGroupData);
    parser.addArgument(entryDN);
    dnFile = new FileArgument('f', "dnFile", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DN_FILE.get(), true, true, true, false);
    dnFile.addLongIdentifier("dn-file", true);
    dnFile.addLongIdentifier("dnFilename", true);
    dnFile.addLongIdentifier("dn-filename", true);
    dnFile.addLongIdentifier("deleteEntriesWithDNsFromFile", true);
    dnFile.addLongIdentifier("delete-entries0-with-dns-from-file", true);
    dnFile.addLongIdentifier("file", true);
    dnFile.addLongIdentifier("filename", true);
    dnFile.setArgumentGroupName(argGroupData);
    parser.addArgument(dnFile);
    deleteEntriesMatchingFilter = new FilterArgument(null, "deleteEntriesMatchingFilter", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_ENTRIES_MATCHING_FILTER.get());
    deleteEntriesMatchingFilter.addLongIdentifier("delete-entries-matching-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("deleteFilter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("delete-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("deleteSearchFilter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("delete-search-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("filter", true);
    deleteEntriesMatchingFilter.setArgumentGroupName(argGroupData);
    parser.addArgument(deleteEntriesMatchingFilter);
    deleteEntriesMatchingFiltersFromFile = new FileArgument(null, "deleteEntriesMatchingFiltersFromFile", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_ENTRIES_MATCHING_FILTER_FILE.get(), true, true, true, false);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-entries-matching-filters-from-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteEntriesMatchingFilterFromFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-entries-matching-filter-from-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteFilterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-filter-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteSearchFilterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-search-filter-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("filterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("filter-file", true);
    deleteEntriesMatchingFiltersFromFile.setArgumentGroupName(argGroupData);
    parser.addArgument(deleteEntriesMatchingFiltersFromFile);
    searchBaseDN = new DNArgument(null, "searchBaseDN", false, 0, null, INFO_LDAPDELETE_ARG_DESC_SEARCH_BASE_DN.get(), DN.NULL_DN);
    searchBaseDN.addLongIdentifier("search-base-dn", true);
    searchBaseDN.addLongIdentifier("baseDN", true);
    searchBaseDN.addLongIdentifier("base-dn", true);
    searchBaseDN.setArgumentGroupName(argGroupData);
    parser.addArgument(searchBaseDN);
    searchPageSize = new IntegerArgument(null, "searchPageSize", false, 1, null, INFO_LDAPDELETE_ARG_DESC_SEARCH_PAGE_SIZE.get(), 1, Integer.MAX_VALUE);
    searchPageSize.addLongIdentifier("search-page-size", true);
    searchPageSize.addLongIdentifier("simplePagedResultsPageSize", true);
    searchPageSize.addLongIdentifier("simple-paged-results-page-size", true);
    searchPageSize.addLongIdentifier("pageSize", true);
    searchPageSize.addLongIdentifier("page-size", true);
    searchPageSize.setArgumentGroupName(argGroupData);
    parser.addArgument(searchPageSize);
    encryptionPassphraseFile = new FileArgument(null, "encryptionPassphraseFile", false, 1, null, INFO_LDAPDELETE_ARG_DESC_ENCRYPTION_PW_FILE.get(), true, true, true, false);
    encryptionPassphraseFile.addLongIdentifier("encryption-passphrase-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryptionPasswordFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-password-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryptionPINFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-pin-file", true);
    encryptionPassphraseFile.setArgumentGroupName(argGroupData);
    parser.addArgument(encryptionPassphraseFile);
    characterSet = new StringArgument('i', "characterSet", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_CHARSET.get(), INFO_LDAPDELETE_ARG_DESC_CHARSET.get(), "UTF-8");
    characterSet.addLongIdentifier("character-set", true);
    characterSet.addLongIdentifier("charSet", true);
    characterSet.addLongIdentifier("char-set", true);
    characterSet.addLongIdentifier("encoding", true);
    characterSet.setArgumentGroupName(argGroupData);
    parser.addArgument(characterSet);
    rejectFile = new FileArgument('R', "rejectFile", false, 1, null, INFO_LDAPDELETE_ARG_DESC_REJECT_FILE.get(), false, true, true, false);
    rejectFile.addLongIdentifier("reject-file", true);
    rejectFile.addLongIdentifier("errorFile", true);
    rejectFile.addLongIdentifier("error-file", true);
    rejectFile.addLongIdentifier("failureFile", true);
    rejectFile.addLongIdentifier("failure-file", true);
    rejectFile.setArgumentGroupName(argGroupData);
    parser.addArgument(rejectFile);
    verbose = new BooleanArgument('v', "verbose", 1, INFO_LDAPDELETE_ARG_DESC_VERBOSE.get());
    verbose.setArgumentGroupName(argGroupData);
    parser.addArgument(verbose);
    // This argument has no effect.  It is provided for compatibility with a
    // legacy ldapdelete tool, where the argument was also offered but had no
    // effect.  In this tool, it is hidden.
    final BooleanArgument scriptFriendly = new BooleanArgument(null, "scriptFriendly", 1, INFO_LDAPDELETE_ARG_DESC_SCRIPT_FRIENDLY.get());
    scriptFriendly.addLongIdentifier("script-friendly", true);
    scriptFriendly.setArgumentGroupName(argGroupData);
    scriptFriendly.setHidden(true);
    parser.addArgument(scriptFriendly);
    // 
    // Operation Arguments
    // 
    final String argGroupOp = INFO_LDAPDELETE_ARG_GROUP_OPERATION.get();
    // NOTE:  The retryFailedOperations argument is now hidden, as we will retry
    // operations by default.  The neverRetry argument can be used to disable
    // this.
    retryFailedOperations = new BooleanArgument(null, "retryFailedOperations", 1, INFO_LDAPDELETE_ARG_DESC_RETRY_FAILED_OPS.get());
    retryFailedOperations.addLongIdentifier("retry-failed-operations", true);
    retryFailedOperations.addLongIdentifier("retryFailedOps", true);
    retryFailedOperations.addLongIdentifier("retry-failed-ops", true);
    retryFailedOperations.addLongIdentifier("retry", true);
    retryFailedOperations.setArgumentGroupName(argGroupOp);
    retryFailedOperations.setHidden(true);
    parser.addArgument(retryFailedOperations);
    neverRetry = new BooleanArgument(null, "neverRetry", 1, INFO_LDAPDELETE_ARG_DESC_NEVER_RETRY.get());
    neverRetry.addLongIdentifier("never-retry", true);
    neverRetry.setArgumentGroupName(argGroupOp);
    parser.addArgument(neverRetry);
    dryRun = new BooleanArgument('n', "dryRun", 1, INFO_LDAPDELETE_ARG_DESC_DRY_RUN.get());
    dryRun.addLongIdentifier("dry-run", true);
    dryRun.setArgumentGroupName(argGroupOp);
    parser.addArgument(dryRun);
    continueOnError = new BooleanArgument('c', "continueOnError", 1, INFO_LDAPDELETE_ARG_DESC_CONTINUE_ON_ERROR.get());
    continueOnError.addLongIdentifier("continue-on-error", true);
    continueOnError.setArgumentGroupName(argGroupOp);
    parser.addArgument(continueOnError);
    followReferrals = new BooleanArgument(null, "followReferrals", 1, INFO_LDAPDELETE_ARG_DESC_FOLLOW_REFERRALS.get());
    followReferrals.addLongIdentifier("follow-referrals", true);
    followReferrals.setArgumentGroupName(argGroupOp);
    parser.addArgument(followReferrals);
    useAdministrativeSession = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_LDAPDELETE_ARG_DESC_USE_ADMIN_SESSION.get());
    useAdministrativeSession.addLongIdentifier("use-administrative-session", true);
    useAdministrativeSession.addLongIdentifier("useAdminSession", true);
    useAdministrativeSession.addLongIdentifier("use-admin-session", true);
    useAdministrativeSession.setArgumentGroupName(argGroupOp);
    parser.addArgument(useAdministrativeSession);
    ratePerSecond = new IntegerArgument('r', "ratePerSecond", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_RATE_PER_SECOND.get(), INFO_LDAPDELETE_ARG_DESC_RATE_PER_SECOND.get(), 1, Integer.MAX_VALUE);
    ratePerSecond.addLongIdentifier("rate-per-second", true);
    ratePerSecond.addLongIdentifier("deletesPerSecond", true);
    ratePerSecond.addLongIdentifier("deletes-per-second", true);
    ratePerSecond.addLongIdentifier("operationsPerSecond", true);
    ratePerSecond.addLongIdentifier("operations-per-second", true);
    ratePerSecond.addLongIdentifier("opsPerSecond", true);
    ratePerSecond.addLongIdentifier("ops-per-second", true);
    ratePerSecond.setArgumentGroupName(argGroupOp);
    parser.addArgument(ratePerSecond);
    // This argument has no effect.  It is provided for compatibility with a
    // legacy ldapdelete tool, but this version only supports LDAPv3, so this
    // argument is hidden.
    final IntegerArgument ldapVersion = new IntegerArgument('V', "ldapVersion", false, 1, "{version}", INFO_LDAPDELETE_ARG_DESC_LDAP_VERSION.get(), 3, 3, 3);
    ldapVersion.addLongIdentifier("ldap-version", true);
    ldapVersion.setArgumentGroupName(argGroupOp);
    ldapVersion.setHidden(true);
    parser.addArgument(ldapVersion);
    // 
    // Control Arguments
    // 
    final String argGroupControls = INFO_LDAPDELETE_ARG_GROUP_CONTROLS.get();
    clientSideSubtreeDelete = new BooleanArgument(null, "clientSideSubtreeDelete", 1, INFO_LDAPDELETE_ARG_DESC_CLIENT_SIDE_SUB_DEL.get());
    clientSideSubtreeDelete.addLongIdentifier("client-side-subtree-delete", true);
    clientSideSubtreeDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(clientSideSubtreeDelete);
    serverSideSubtreeDelete = new BooleanArgument('x', "serverSideSubtreeDelete", 1, INFO_LDAPDELETE_ARG_DESC_SERVER_SIDE_SUB_DEL.get());
    serverSideSubtreeDelete.addLongIdentifier("server-side-subtree-delete", true);
    serverSideSubtreeDelete.addLongIdentifier("deleteSubtree", true);
    serverSideSubtreeDelete.addLongIdentifier("delete-subtree", true);
    serverSideSubtreeDelete.addLongIdentifier("useSubtreeDeleteControl", true);
    serverSideSubtreeDelete.addLongIdentifier("use-subtree-delete-control", true);
    serverSideSubtreeDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(serverSideSubtreeDelete);
    softDelete = new BooleanArgument('s', "softDelete", 1, INFO_LDAPDELETE_ARG_DESC_SOFT_DELETE.get());
    softDelete.addLongIdentifier("soft-delete", true);
    softDelete.addLongIdentifier("useSoftDelete", true);
    softDelete.addLongIdentifier("use-soft-delete", true);
    softDelete.addLongIdentifier("useSoftDeleteControl", true);
    softDelete.addLongIdentifier("use-soft-delete-control", true);
    softDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(softDelete);
    hardDelete = new BooleanArgument(null, "hardDelete", 1, INFO_LDAPDELETE_ARG_DESC_HARD_DELETE.get());
    hardDelete.addLongIdentifier("hard-delete", true);
    hardDelete.addLongIdentifier("useHardDelete", true);
    hardDelete.addLongIdentifier("use-hard-delete", true);
    hardDelete.addLongIdentifier("useHardDeleteControl", true);
    hardDelete.addLongIdentifier("use-hard-delete-control", true);
    hardDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(hardDelete);
    proxyAs = new StringArgument('Y', "proxyAs", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_AUTHZ_ID.get(), INFO_LDAPDELETE_ARG_DESC_PROXY_AS.get());
    proxyAs.addLongIdentifier("proxy-as", true);
    proxyAs.addLongIdentifier("proxyV2As", true);
    proxyAs.addLongIdentifier("proxy-v2-as", true);
    proxyAs.addLongIdentifier("proxiedAuth", true);
    proxyAs.addLongIdentifier("proxied-auth", true);
    proxyAs.addLongIdentifier("proxiedAuthorization", true);
    proxyAs.addLongIdentifier("proxied-authorization", true);
    proxyAs.addLongIdentifier("useProxiedAuth", true);
    proxyAs.addLongIdentifier("use-proxied-auth", true);
    proxyAs.addLongIdentifier("useProxiedAuthorization", true);
    proxyAs.addLongIdentifier("use-proxied-authorization", true);
    proxyAs.addLongIdentifier("useProxiedAuthControl", true);
    proxyAs.addLongIdentifier("use-proxied-auth-control", true);
    proxyAs.addLongIdentifier("useProxiedAuthorizationControl", true);
    proxyAs.addLongIdentifier("use-proxied-authorization-control", true);
    proxyAs.setArgumentGroupName(argGroupControls);
    parser.addArgument(proxyAs);
    proxyV1As = new DNArgument(null, "proxyV1As", false, 1, null, INFO_LDAPDELETE_ARG_DESC_PROXY_V1_AS.get());
    proxyV1As.addLongIdentifier("proxy-v1-as", true);
    proxyV1As.setArgumentGroupName(argGroupControls);
    parser.addArgument(proxyV1As);
    manageDsaIT = new BooleanArgument(null, "useManageDsaIT", 1, INFO_LDAPDELETE_ARG_DESC_MANAGE_DSA_IT.get());
    manageDsaIT.addLongIdentifier("use-manage-dsa-it", true);
    manageDsaIT.addLongIdentifier("manageDsaIT", true);
    manageDsaIT.addLongIdentifier("manage-dsa-it", true);
    manageDsaIT.addLongIdentifier("manageDsaITControl", true);
    manageDsaIT.addLongIdentifier("manage-dsa-it-control", true);
    manageDsaIT.addLongIdentifier("useManageDsaITControl", true);
    manageDsaIT.addLongIdentifier("use-manage-dsa-it-control", true);
    manageDsaIT.setArgumentGroupName(argGroupControls);
    parser.addArgument(manageDsaIT);
    assertionFilter = new FilterArgument(null, "assertionFilter", false, 1, null, INFO_LDAPDELETE_ARG_DESC_ASSERTION_FILTER.get());
    assertionFilter.addLongIdentifier("assertion-filter", true);
    assertionFilter.addLongIdentifier("useAssertionFilter", true);
    assertionFilter.addLongIdentifier("use-assertion-filter", true);
    assertionFilter.addLongIdentifier("assertionControl", true);
    assertionFilter.addLongIdentifier("assertion-control", true);
    assertionFilter.addLongIdentifier("useAssertionControl", true);
    assertionFilter.addLongIdentifier("use-assertion-control", true);
    assertionFilter.setArgumentGroupName(argGroupControls);
    parser.addArgument(assertionFilter);
    preReadAttribute = new StringArgument(null, "preReadAttribute", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ATTR.get(), INFO_LDAPDELETE_ARG_DESC_PRE_READ_ATTR.get());
    preReadAttribute.addLongIdentifier("pre-read-attribute", true);
    preReadAttribute.setArgumentGroupName(argGroupControls);
    parser.addArgument(preReadAttribute);
    noOperation = new BooleanArgument(null, "noOperation", 1, INFO_LDAPDELETE_ARG_DESC_NO_OP.get());
    noOperation.addLongIdentifier("no-operation", true);
    noOperation.addLongIdentifier("noOp", true);
    noOperation.addLongIdentifier("no-op", true);
    noOperation.setArgumentGroupName(argGroupControls);
    parser.addArgument(noOperation);
    getBackendSetID = new BooleanArgument(null, "getBackendSetID", 1, INFO_LDAPDELETE_ARG_DESC_GET_BACKEND_SET_ID.get());
    getBackendSetID.addLongIdentifier("get-backend-set-id", true);
    getBackendSetID.addLongIdentifier("useGetBackendSetID", true);
    getBackendSetID.addLongIdentifier("use-get-backend-set-id", true);
    getBackendSetID.addLongIdentifier("useGetBackendSetIDControl", true);
    getBackendSetID.addLongIdentifier("use-get-backend-set-id-control", true);
    getBackendSetID.setArgumentGroupName(argGroupControls);
    parser.addArgument(getBackendSetID);
    routeToBackendSet = new StringArgument(null, "routeToBackendSet", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ROUTE_TO_BACKEND_SET.get(), INFO_LDAPDELETE_ARG_DESC_ROUTE_TO_BACKEND_SET.get());
    routeToBackendSet.addLongIdentifier("route-to-backend-set", true);
    routeToBackendSet.addLongIdentifier("useRouteToBackendSet", true);
    routeToBackendSet.addLongIdentifier("use0route-to-backend-set", true);
    routeToBackendSet.addLongIdentifier("useRouteToBackendSetControl", true);
    routeToBackendSet.addLongIdentifier("use-route-to-backend-set-control", true);
    routeToBackendSet.setArgumentGroupName(argGroupControls);
    parser.addArgument(routeToBackendSet);
    getServerID = new BooleanArgument(null, "getServerID", 1, INFO_LDAPDELETE_ARG_DESC_GET_SERVER_ID.get());
    getServerID.addLongIdentifier("get-server-id", true);
    getServerID.addLongIdentifier("getBackendServerID", true);
    getServerID.addLongIdentifier("get-backend-server-id", true);
    getServerID.addLongIdentifier("useGetServerID", true);
    getServerID.addLongIdentifier("use-get-server-id", true);
    getServerID.addLongIdentifier("useGetServerIDControl", true);
    getServerID.addLongIdentifier("use-get-server-id-control", true);
    getServerID.setArgumentGroupName(argGroupControls);
    parser.addArgument(getServerID);
    routeToServer = new StringArgument(null, "routeToServer", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ID.get(), INFO_LDAPDELETE_ARG_DESC_ROUTE_TO_SERVER.get());
    routeToServer.addLongIdentifier("route-to-server", true);
    routeToServer.addLongIdentifier("routeToBackendServer", true);
    routeToServer.addLongIdentifier("route-to-backend-server", true);
    routeToServer.addLongIdentifier("useRouteToServer", true);
    routeToServer.addLongIdentifier("use-route-to-server", true);
    routeToServer.addLongIdentifier("useRouteToBackendServer", true);
    routeToServer.addLongIdentifier("use-route-to-backend-server", true);
    routeToServer.addLongIdentifier("useRouteToServerControl", true);
    routeToServer.addLongIdentifier("use-route-to-server-control", true);
    routeToServer.addLongIdentifier("useRouteToBackendServerControl", true);
    routeToServer.addLongIdentifier("use-route-to-backend-server-control", true);
    routeToServer.setArgumentGroupName(argGroupControls);
    parser.addArgument(routeToServer);
    useAssuredReplication = new BooleanArgument(null, "useAssuredReplication", 1, INFO_LDAPDELETE_ARG_DESC_USE_ASSURED_REPLICATION.get());
    useAssuredReplication.addLongIdentifier("use-assured-replication", true);
    useAssuredReplication.addLongIdentifier("assuredReplication", true);
    useAssuredReplication.addLongIdentifier("assured-replication", true);
    useAssuredReplication.addLongIdentifier("assuredReplicationControl", true);
    useAssuredReplication.addLongIdentifier("assured-replication-control", true);
    useAssuredReplication.addLongIdentifier("useAssuredReplicationControl", true);
    useAssuredReplication.addLongIdentifier("use-assured-replication-control", true);
    useAssuredReplication.setArgumentGroupName(argGroupControls);
    parser.addArgument(useAssuredReplication);
    assuredReplicationLocalLevel = new StringArgument(null, "assuredReplicationLocalLevel", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ASSURED_REPLICATION_LOCAL_LEVEL.get(), INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_LOCAL_LEVEL.get(), StaticUtils.setOf("none", "received-any-server", "processed-all-servers"));
    assuredReplicationLocalLevel.addLongIdentifier("assured-replication-local-level", true);
    assuredReplicationLocalLevel.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationLocalLevel);
    assuredReplicationRemoteLevel = new StringArgument(null, "assuredReplicationRemoteLevel", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ASSURED_REPLICATION_REMOTE_LEVEL.get(), INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_REMOTE_LEVEL.get(), StaticUtils.setOf("none", "received-any-remote-location", "received-all-remote-locations", "processed-all-remote-servers"));
    assuredReplicationRemoteLevel.addLongIdentifier("assured-replication-remote-level", true);
    assuredReplicationRemoteLevel.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationRemoteLevel);
    assuredReplicationTimeout = new DurationArgument(null, "assuredReplicationTimeout", false, null, INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_TIMEOUT.get());
    assuredReplicationTimeout.addLongIdentifier("assured-replication-timeout", true);
    assuredReplicationTimeout.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationTimeout);
    replicationRepair = new BooleanArgument(null, "replicationRepair", 1, INFO_LDAPDELETE_ARG_DESC_REPLICATION_REPAIR.get());
    replicationRepair.addLongIdentifier("replication-repair", true);
    replicationRepair.addLongIdentifier("replicationRepairControl", true);
    replicationRepair.addLongIdentifier("replication-repair-control", true);
    replicationRepair.addLongIdentifier("useReplicationRepair", true);
    replicationRepair.addLongIdentifier("use-replication-repair", true);
    replicationRepair.addLongIdentifier("useReplicationRepairControl", true);
    replicationRepair.addLongIdentifier("use-replication-repair-control", true);
    replicationRepair.setArgumentGroupName(argGroupControls);
    parser.addArgument(replicationRepair);
    suppressReferentialIntegrityUpdates = new BooleanArgument(null, "suppressReferentialIntegrityUpdates", 1, INFO_LDAPDELETE_ARG_DESC_SUPPRESS_REFINT_UPDATES.get());
    suppressReferentialIntegrityUpdates.addLongIdentifier("suppress-referential-integrity-updates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("useSuppressReferentialIntegrityUpdates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("use-suppress-referential-integrity-updates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("useSuppressReferentialIntegrityUpdatesControl", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("use-suppress-referential-integrity-updates-control", true);
    suppressReferentialIntegrityUpdates.setArgumentGroupName(argGroupControls);
    parser.addArgument(suppressReferentialIntegrityUpdates);
    operationPurpose = new StringArgument(null, "operationPurpose", false, 1, null, INFO_LDAPDELETE_ARG_DESC_OP_PURPOSE.get());
    operationPurpose.addLongIdentifier("operation-purpose", true);
    operationPurpose.addLongIdentifier("operationPurposeControl", true);
    operationPurpose.addLongIdentifier("operation-purpose-control", true);
    operationPurpose.addLongIdentifier("useOperationPurpose", true);
    operationPurpose.addLongIdentifier("use-operation-purpose", true);
    operationPurpose.addLongIdentifier("useOperationPurposeControl", true);
    operationPurpose.addLongIdentifier("use-operation-purpose-control", true);
    operationPurpose.setArgumentGroupName(argGroupControls);
    parser.addArgument(operationPurpose);
    authorizationIdentity = new BooleanArgument('E', "authorizationIdentity", 1, INFO_LDAPDELETE_ARG_DESC_AUTHZ_ID.get());
    authorizationIdentity.addLongIdentifier("authorization-identity", true);
    authorizationIdentity.addLongIdentifier("useAuthorizationIdentity", true);
    authorizationIdentity.addLongIdentifier("use-authorization-identity", true);
    authorizationIdentity.addLongIdentifier("useAuthorizationIdentityControl", true);
    authorizationIdentity.addLongIdentifier("use-authorization-identity-control", true);
    authorizationIdentity.setArgumentGroupName(argGroupControls);
    parser.addArgument(authorizationIdentity);
    getAuthorizationEntryAttribute = new StringArgument(null, "getAuthorizationEntryAttribute", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ATTR.get(), INFO_LDAPDELETE_ARG_DESC_GET_AUTHZ_ENTRY_ATTR.get());
    getAuthorizationEntryAttribute.addLongIdentifier("get-authorization-entry-attribute", true);
    getAuthorizationEntryAttribute.setArgumentGroupName(argGroupControls);
    parser.addArgument(getAuthorizationEntryAttribute);
    getUserResourceLimits = new BooleanArgument(null, "getUserResourceLimits", 1, INFO_LDAPDELETE_ARG_DESC_GET_USER_RESOURCE_LIMITS.get());
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits", true);
    getUserResourceLimits.addLongIdentifier("getUserResourceLimitsControl", true);
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits-control", true);
    getUserResourceLimits.addLongIdentifier("useGetUserResourceLimits", true);
    getUserResourceLimits.addLongIdentifier("use-get-user-resource-limits", true);
    getUserResourceLimits.addLongIdentifier("useGetUserResourceLimitsControl", true);
    getUserResourceLimits.addLongIdentifier("use-get-user-resource-limits-control", true);
    getUserResourceLimits.setArgumentGroupName(argGroupControls);
    parser.addArgument(getUserResourceLimits);
    deleteControl = new ControlArgument('J', "deleteControl", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_CONTROL.get());
    deleteControl.addLongIdentifier("delete-control", true);
    deleteControl.addLongIdentifier("operationControl", true);
    deleteControl.addLongIdentifier("operation-control", true);
    deleteControl.addLongIdentifier("control", true);
    deleteControl.setArgumentGroupName(argGroupControls);
    parser.addArgument(deleteControl);
    bindControl = new ControlArgument(null, "bindControl", false, 0, null, INFO_LDAPDELETE_ARG_DESC_BIND_CONTROL.get());
    bindControl.addLongIdentifier("bind-control", true);
    bindControl.setArgumentGroupName(argGroupControls);
    parser.addArgument(bindControl);
    // 
    // Argument Constraints
    // 
    // At most one argument may be provided to select the entries to delete.
    parser.addExclusiveArgumentSet(entryDN, dnFile, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile);
    // The searchBaseDN argument can only be used if identifying entries with
    // search filters.
    parser.addDependentArgumentSet(searchBaseDN, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile);
    // The search page size argument can only be used if identifying entries
    // with search filters or performing a client-side subtree delete.
    parser.addDependentArgumentSet(searchPageSize, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile, clientSideSubtreeDelete);
    // Follow referrals and manage DSA IT can't be used together.
    parser.addExclusiveArgumentSet(followReferrals, manageDsaIT);
    // Client-side and server-side subtree delete can't be used together.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, serverSideSubtreeDelete);
    // A lot of options can't be used in conjunction with client-side
    // subtree delete.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, followReferrals);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, preReadAttribute);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getBackendSetID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getServerID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, noOperation);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, dryRun);
    // Soft delete and hard delete can't be used together.
    parser.addExclusiveArgumentSet(softDelete, hardDelete);
}
Also used : ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) DurationArgument(com.unboundid.util.args.DurationArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 8 with FilterArgument

use of com.unboundid.util.args.FilterArgument in project ldapsdk by pingidentity.

the class LDAPDiff method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    this.parser = parser;
    // Add the general arguments.
    baseDNArg = new DNArgument('b', "baseDN", true, 1, INFO_LDAP_DIFF_ARG_PLACEHOLDER_BASE_DN.get(), INFO_LDAP_DIFF_ARG_DESC_BASE_DN.get());
    baseDNArg.addLongIdentifier("base-dn", true);
    baseDNArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(baseDNArg);
    sourceDNsFileArg = new FileArgument(null, "sourceDNsFile", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_SOURCE_DNS_FILE.get(), true, true, true, false);
    sourceDNsFileArg.addLongIdentifier("source-dns-file", true);
    sourceDNsFileArg.addLongIdentifier("sourceDNFile", true);
    sourceDNsFileArg.addLongIdentifier("source-dn-file", true);
    sourceDNsFileArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(sourceDNsFileArg);
    targetDNsFileArg = new FileArgument(null, "targetDNsFile", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_TARGET_DNS_FILE.get(), true, true, true, false);
    targetDNsFileArg.addLongIdentifier("target-dns-file", true);
    targetDNsFileArg.addLongIdentifier("targetDNFile", true);
    targetDNsFileArg.addLongIdentifier("target-dn-file", true);
    targetDNsFileArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(targetDNsFileArg);
    excludeBranchArg = new DNArgument('B', "excludeBranch", false, 0, null, INFO_LDAP_DIFF_ARG_DESC_EXCLUDE_BRANCH.get());
    excludeBranchArg.addLongIdentifier("exclude-branch", true);
    excludeBranchArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(excludeBranchArg);
    searchFilterArg = new FilterArgument('f', "searchFilter", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_FILTER.get(), Filter.createPresenceFilter("objectClass"));
    searchFilterArg.addLongIdentifier("search-filter", true);
    searchFilterArg.addLongIdentifier("filter", true);
    searchFilterArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(searchFilterArg);
    searchScopeArg = new ScopeArgument('s', "searchScope", false, null, INFO_LDAP_DIFF_ARG_DESC_SCOPE.get(), SearchScope.SUB);
    searchScopeArg.addLongIdentifier("search-scope", true);
    searchScopeArg.addLongIdentifier("scope", true);
    searchScopeArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(searchScopeArg);
    outputLDIFArg = new FileArgument('o', "outputLDIF", true, 1, null, INFO_LDAP_DIFF_ARG_DESC_OUTPUT_LDIF.get(), false, true, true, false);
    outputLDIFArg.addLongIdentifier("output-ldif", true);
    outputLDIFArg.addLongIdentifier("outputFile", true);
    outputLDIFArg.addLongIdentifier("output-file", true);
    outputLDIFArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(outputLDIFArg);
    wrapColumnArg = new IntegerArgument(null, "wrapColumn", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_WRAP_COLUMN.get(), 0, Integer.MAX_VALUE, 0);
    wrapColumnArg.addLongIdentifier("wrap-column", true);
    wrapColumnArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(wrapColumnArg);
    quietArg = new BooleanArgument('Q', "quiet", 1, INFO_LDAP_DIFF_ARG_DESC_QUIET.get());
    quietArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(quietArg);
    numThreadsArg = new IntegerArgument(null, "numThreads", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_NUM_THREADS.get(), 1, Integer.MAX_VALUE, 20);
    numThreadsArg.addLongIdentifier("num-threads", true);
    numThreadsArg.addLongIdentifier("numConnections", true);
    numThreadsArg.addLongIdentifier("num-connections", true);
    numThreadsArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(numThreadsArg);
    numPassesArg = new IntegerArgument(null, "numPasses", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_NUM_PASSES.get(), 1, Integer.MAX_VALUE, 3);
    numPassesArg.addLongIdentifier("num-passes", true);
    numPassesArg.addLongIdentifier("maxPasses", true);
    numPassesArg.addLongIdentifier("max-passes", true);
    numPassesArg.addLongIdentifier("maximum-Passes", true);
    numPassesArg.addLongIdentifier("maximum-passes", true);
    numPassesArg.addLongIdentifier("passes", true);
    numPassesArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(numPassesArg);
    secondsBetweenPassesArg = new IntegerArgument(null, "secondsBetweenPasses", false, 1, null, INFO_LDAP_DIFF_ARG_DESC_SECONDS_BETWEEN_PASSES.get(), 0, Integer.MAX_VALUE, 2);
    secondsBetweenPassesArg.addLongIdentifier("seconds-between-passes", true);
    secondsBetweenPassesArg.addLongIdentifier("secondsBetweenPass", true);
    secondsBetweenPassesArg.addLongIdentifier("seconds-between-pass", true);
    secondsBetweenPassesArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(secondsBetweenPassesArg);
    byteForByteArg = new BooleanArgument(null, "byteForByte", 1, INFO_LDAP_DIFF_ARG_DESC_BYTE_FOR_BYTE.get());
    byteForByteArg.addLongIdentifier("byte-for-byte", true);
    byteForByteArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(byteForByteArg);
    missingOnlyArg = new BooleanArgument(null, "missingOnly", 1, INFO_LDAP_DIFF_ARG_DESC_MISSING_ONLY.get());
    missingOnlyArg.addLongIdentifier("missing-only", true);
    missingOnlyArg.addLongIdentifier("onlyMissing", true);
    missingOnlyArg.addLongIdentifier("only-missing", true);
    missingOnlyArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(missingOnlyArg);
    // Add legacy arguments that will be used to help provide compatibility with
    // an older version of this tool.
    useLegacyExitCodeArg = new BooleanArgument(null, "useLegacyExitCode", 1, INFO_LDAP_DIFF_ARG_DESC_USE_LEGACY_EXIT_CODE.get());
    useLegacyExitCodeArg.addLongIdentifier("use-legacy-exit-code", true);
    useLegacyExitCodeArg.addLongIdentifier("useLegacyResultCode", true);
    useLegacyExitCodeArg.addLongIdentifier("use-legacy-result-code", true);
    useLegacyExitCodeArg.addLongIdentifier("legacyExitCode", true);
    useLegacyExitCodeArg.addLongIdentifier("legacy-exit-code", true);
    useLegacyExitCodeArg.addLongIdentifier("legacyResultCode", true);
    useLegacyExitCodeArg.addLongIdentifier("legacy-result-code", true);
    useLegacyExitCodeArg.setArgumentGroupName(INFO_LDAP_DIFF_ARG_GROUP_PROCESSING_ARGS.get());
    parser.addArgument(useLegacyExitCodeArg);
    legacySourceHostArg = new StringArgument('h', null, false, 1, null, "");
    legacySourceHostArg.setHidden(true);
    parser.addArgument(legacySourceHostArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceHostname"), legacySourceHostArg);
    legacySourcePortArg = new IntegerArgument('p', null, false, 1, null, "", 1, 65535);
    legacySourcePortArg.setHidden(true);
    parser.addArgument(legacySourcePortArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourcePort"), legacySourcePortArg);
    legacySourceBindDNArg = new DNArgument('D', null, false, 1, null, "");
    legacySourceBindDNArg.setHidden(true);
    parser.addArgument(legacySourceBindDNArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceBindDN"), legacySourceBindDNArg);
    legacySourceBindPasswordArg = new StringArgument('w', null, false, 1, null, "");
    legacySourceBindPasswordArg.setHidden(true);
    parser.addArgument(legacySourceBindPasswordArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceBindPassword"), legacySourceBindPasswordArg);
    legacyTargetHostArg = new StringArgument('O', null, false, 1, null, "");
    legacyTargetHostArg.setHidden(true);
    parser.addArgument(legacyTargetHostArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetHostname"), legacyTargetHostArg);
    legacyTargetBindPasswordFileArg = new FileArgument('F', null, false, 1, null, "", true, true, true, false);
    legacyTargetBindPasswordFileArg.setHidden(true);
    parser.addArgument(legacyTargetBindPasswordFileArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetBindPasswordFile"), legacyTargetBindPasswordFileArg);
    legacyTrustAllArg = new BooleanArgument('X', "trustAll", 1, "");
    legacyTrustAllArg.setHidden(true);
    parser.addArgument(legacyTrustAllArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceTrustAll"), legacyTrustAllArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetTrustAll"), legacyTrustAllArg);
    legacyKeyStorePathArg = new FileArgument('K', "keyStorePath", false, 1, null, "", true, true, true, false);
    legacyKeyStorePathArg.setHidden(true);
    parser.addArgument(legacyKeyStorePathArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceKeyStorePath"), legacyKeyStorePathArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetKeyStorePath"), legacyKeyStorePathArg);
    legacyKeyStorePasswordArg = new StringArgument('W', "keyStorePassword", false, 1, null, "");
    legacyKeyStorePasswordArg.setSensitive(true);
    legacyKeyStorePasswordArg.setHidden(true);
    parser.addArgument(legacyKeyStorePasswordArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceKeyStorePassword"), legacyKeyStorePasswordArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetKeyStorePassword"), legacyKeyStorePasswordArg);
    legacyKeyStorePasswordFileArg = new FileArgument('u', "keyStorePasswordFile", false, 1, null, "", true, true, true, false);
    legacyKeyStorePasswordFileArg.setHidden(true);
    parser.addArgument(legacyKeyStorePasswordFileArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceKeyStorePasswordFile"), legacyKeyStorePasswordFileArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetKeyStorePasswordFile"), legacyKeyStorePasswordFileArg);
    legacyKeyStoreFormatArg = new StringArgument(null, "keyStoreFormat", false, 1, null, "");
    legacyKeyStoreFormatArg.setHidden(true);
    parser.addArgument(legacyKeyStoreFormatArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceKeyStoreFormat"), legacyKeyStoreFormatArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetKeyStoreFormat"), legacyKeyStoreFormatArg);
    legacyCertNicknameArg = new StringArgument('N', "certNickname", false, 1, null, "");
    legacyCertNicknameArg.setHidden(true);
    parser.addArgument(legacyCertNicknameArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceCertNickname"), legacyCertNicknameArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetCertNickname"), legacyCertNicknameArg);
    legacyTrustStorePathArg = new FileArgument('P', "trustStorePath", false, 1, null, "", true, true, true, false);
    legacyTrustStorePathArg.setHidden(true);
    parser.addArgument(legacyTrustStorePathArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceTrustStorePath"), legacyTrustStorePathArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetTrustStorePath"), legacyTrustStorePathArg);
    legacyTrustStorePasswordArg = new StringArgument(null, "trustStorePassword", false, 1, null, "");
    legacyTrustStorePasswordArg.setSensitive(true);
    legacyTrustStorePasswordArg.setHidden(true);
    parser.addArgument(legacyTrustStorePasswordArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceTrustStorePassword"), legacyTrustStorePasswordArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetTrustStorePassword"), legacyTrustStorePasswordArg);
    legacyTrustStorePasswordFileArg = new FileArgument('U', "trustStorePasswordFile", false, 1, null, "", true, true, true, false);
    legacyTrustStorePasswordFileArg.setHidden(true);
    parser.addArgument(legacyTrustStorePasswordFileArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceTrustStorePasswordFile"), legacyTrustStorePasswordFileArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetTrustStorePasswordFile"), legacyTrustStorePasswordFileArg);
    legacyTrustStoreFormatArg = new StringArgument(null, "trustStoreFormat", false, 1, null, "");
    legacyTrustStoreFormatArg.setHidden(true);
    parser.addArgument(legacyTrustStoreFormatArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("sourceTrustStoreFormat"), legacyTrustStoreFormatArg);
    parser.addExclusiveArgumentSet(parser.getNamedArgument("targetTrustStoreFormat"), legacyTrustStoreFormatArg);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) ScopeArgument(com.unboundid.util.args.ScopeArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 9 with FilterArgument

use of com.unboundid.util.args.FilterArgument in project ldapsdk by pingidentity.

the class LDIFDiff method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    sourceLDIF = new FileArgument('s', "sourceLDIF", true, 1, null, INFO_LDIF_DIFF_ARG_DESC_SOURCE_LDIF.get(), true, true, true, false);
    sourceLDIF.addLongIdentifier("source-ldif", true);
    sourceLDIF.addLongIdentifier("source", true);
    sourceLDIF.addLongIdentifier("sourceFile", true);
    sourceLDIF.addLongIdentifier("source-file", true);
    sourceLDIF.addLongIdentifier("sourceLDIFFile", true);
    sourceLDIF.addLongIdentifier("source-ldif-file", true);
    sourceLDIF.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_SOURCE.get());
    parser.addArgument(sourceLDIF);
    final String sourcePWDesc;
    if (PING_SERVER_AVAILABLE) {
        sourcePWDesc = INFO_LDIF_DIFF_ARG_DESC_SOURCE_PW_FILE_PING_SERVER.get();
    } else {
        sourcePWDesc = INFO_LDIF_DIFF_ARG_DESC_SOURCE_PW_FILE_STANDALONE.get();
    }
    sourceEncryptionPassphraseFile = new FileArgument(null, "sourceEncryptionPassphraseFile", false, 1, null, sourcePWDesc, true, true, true, false);
    sourceEncryptionPassphraseFile.addLongIdentifier("source-encryption-passphrase-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("sourcePassphraseFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("source-passphrase-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("sourceEncryptionPasswordFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("source-encryption-password-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("sourcePasswordFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("source-password-file", true);
    sourceEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_SOURCE.get());
    parser.addArgument(sourceEncryptionPassphraseFile);
    targetLDIF = new FileArgument('t', "targetLDIF", true, 1, null, INFO_LDIF_DIFF_ARG_DESC_TARGET_LDIF.get(), true, true, true, false);
    targetLDIF.addLongIdentifier("target-ldif", true);
    targetLDIF.addLongIdentifier("target", true);
    targetLDIF.addLongIdentifier("targetFile", true);
    targetLDIF.addLongIdentifier("target-file", true);
    targetLDIF.addLongIdentifier("targetLDIFFile", true);
    targetLDIF.addLongIdentifier("target-ldif-file", true);
    targetLDIF.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_TARGET.get());
    parser.addArgument(targetLDIF);
    final String targetPWDesc;
    if (PING_SERVER_AVAILABLE) {
        targetPWDesc = INFO_LDIF_DIFF_ARG_DESC_TARGET_PW_FILE_PING_SERVER.get();
    } else {
        targetPWDesc = INFO_LDIF_DIFF_ARG_DESC_TARGET_PW_FILE_STANDALONE.get();
    }
    targetEncryptionPassphraseFile = new FileArgument(null, "targetEncryptionPassphraseFile", false, 1, null, targetPWDesc, true, true, true, false);
    targetEncryptionPassphraseFile.addLongIdentifier("target-encryption-passphrase-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("targetPassphraseFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("target-passphrase-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("targetEncryptionPasswordFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("target-encryption-password-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("targetPasswordFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("target-password-file", true);
    targetEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_TARGET.get());
    parser.addArgument(targetEncryptionPassphraseFile);
    outputLDIF = new FileArgument('o', "outputLDIF", false, 1, null, INFO_LDIF_DIFF_ARG_DESC_OUTPUT_LDIF.get(), false, true, true, false);
    outputLDIF.addLongIdentifier("output-ldif", true);
    outputLDIF.addLongIdentifier("output", true);
    outputLDIF.addLongIdentifier("outputFile", true);
    outputLDIF.addLongIdentifier("output-file", true);
    outputLDIF.addLongIdentifier("outputLDIFFile", true);
    outputLDIF.addLongIdentifier("output-ldif-file", true);
    outputLDIF.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_OUTPUT.get());
    parser.addArgument(outputLDIF);
    compressOutput = new BooleanArgument(null, "compressOutput", 1, INFO_LDIF_DIFF_ARG_DESC_COMPRESS_OUTPUT.get());
    compressOutput.addLongIdentifier("compress-output", true);
    compressOutput.addLongIdentifier("compress", true);
    compressOutput.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_OUTPUT.get());
    parser.addArgument(compressOutput);
    encryptOutput = new BooleanArgument(null, "encryptOutput", 1, INFO_LDIF_DIFF_ARG_DESC_ENCRYPT_OUTPUT.get());
    encryptOutput.addLongIdentifier("encrypt-output", true);
    encryptOutput.addLongIdentifier("encrypt", true);
    encryptOutput.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_OUTPUT.get());
    parser.addArgument(encryptOutput);
    outputEncryptionPassphraseFile = new FileArgument(null, "outputEncryptionPassphraseFile", false, 1, null, INFO_LDIF_DIFF_ARG_DESC_OUTPUT_PW_FILE.get(), true, true, true, false);
    outputEncryptionPassphraseFile.addLongIdentifier("output-encryption-passphrase-file", true);
    outputEncryptionPassphraseFile.addLongIdentifier("outputPassphraseFile", true);
    outputEncryptionPassphraseFile.addLongIdentifier("output-passphrase-file", true);
    outputEncryptionPassphraseFile.addLongIdentifier("outputEncryptionPasswordFile", true);
    outputEncryptionPassphraseFile.addLongIdentifier("output-encryption-password-file", true);
    outputEncryptionPassphraseFile.addLongIdentifier("outputPasswordFile", true);
    outputEncryptionPassphraseFile.addLongIdentifier("output-password-file", true);
    outputEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_OUTPUT.get());
    parser.addArgument(outputEncryptionPassphraseFile);
    overwriteExistingOutputLDIF = new BooleanArgument('O', "overwriteExistingOutputLDIF", 1, INFO_LDIF_DIFF_ARG_DESC_OVERWRITE_EXISTING.get());
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-existing-output-ldif", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteExistingOutputFile", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-existing-output-file", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteExistingOutput", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-existing-output", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteExisting", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-existing", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteOutputLDIF", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-output-ldif", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteOutputFile", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-output-file", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwriteOutput", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite-output", true);
    overwriteExistingOutputLDIF.addLongIdentifier("overwrite", true);
    overwriteExistingOutputLDIF.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_OUTPUT.get());
    parser.addArgument(overwriteExistingOutputLDIF);
    changeType = new StringArgument(null, "changeType", false, 0, INFO_LDIF_DIFF_ARG_PLACEHOLDER_CHANGE_TYPE.get(), INFO_LDIF_DIFF_ARG_DESC_CHANGE_TYPE.get(), StaticUtils.setOf(CHANGE_TYPE_ADD, CHANGE_TYPE_DELETE, CHANGE_TYPE_MODIFY), Collections.unmodifiableList(Arrays.asList(CHANGE_TYPE_ADD, CHANGE_TYPE_DELETE, CHANGE_TYPE_MODIFY)));
    changeType.addLongIdentifier("change-type", true);
    changeType.addLongIdentifier("operationType", true);
    changeType.addLongIdentifier("operation-type", true);
    changeType.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(changeType);
    includeFilter = new FilterArgument(null, "includeFilter", false, 0, null, INFO_LDIF_DIFF_ARG_DESC_INCLUDE_FILTER.get());
    includeFilter.addLongIdentifier("include-filter", true);
    includeFilter.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(includeFilter);
    excludeFilter = new FilterArgument(null, "excludeFilter", false, 0, null, INFO_LDIF_DIFF_ARG_DESC_EXCLUDE_FILTER.get());
    excludeFilter.addLongIdentifier("exclude-filter", true);
    excludeFilter.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(excludeFilter);
    includeAttribute = new StringArgument(null, "includeAttribute", false, 0, INFO_LDIF_DIFF_ARG_PLACEHOLDER_ATTRIBUTE.get(), INFO_LDIF_DIFF_ARG_DESC_INCLUDE_ATTRIBUTE.get());
    includeAttribute.addLongIdentifier("include-attribute", true);
    includeAttribute.addLongIdentifier("includeAttr", true);
    includeAttribute.addLongIdentifier("include-attr", true);
    includeAttribute.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(includeAttribute);
    excludeAttribute = new StringArgument(null, "excludeAttribute", false, 0, INFO_LDIF_DIFF_ARG_PLACEHOLDER_ATTRIBUTE.get(), INFO_LDIF_DIFF_ARG_DESC_EXCLUDE_ATTRIBUTE.get());
    excludeAttribute.addLongIdentifier("exclude-attribute", true);
    excludeAttribute.addLongIdentifier("excludeAttr", true);
    excludeAttribute.addLongIdentifier("exclude-attr", true);
    excludeAttribute.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(excludeAttribute);
    includeOperationalAttributes = new BooleanArgument('i', "includeOperationalAttributes", 1, INFO_LDIF_DIFF_ARG_DESC_INCLUDE_OPERATIONAL.get());
    includeOperationalAttributes.addLongIdentifier("include-operational-attributes", true);
    includeOperationalAttributes.addLongIdentifier("includeOperational", true);
    includeOperationalAttributes.addLongIdentifier("include-operational", true);
    includeOperationalAttributes.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(includeOperationalAttributes);
    excludeNoUserModificationAttributes = new BooleanArgument('e', "excludeNoUserModificationAttributes", 1, INFO_LDIF_DIFF_ARG_DESC_EXCLUDE_NO_USER_MOD.get());
    excludeNoUserModificationAttributes.addLongIdentifier("exclude-no-user-modification-attributes", true);
    excludeNoUserModificationAttributes.addLongIdentifier("excludeNoUserModAttributes", true);
    excludeNoUserModificationAttributes.addLongIdentifier("exclude-no-user-mod-attributes", true);
    excludeNoUserModificationAttributes.addLongIdentifier("excludeNoUserModification", true);
    excludeNoUserModificationAttributes.addLongIdentifier("exclude-no-user-modification", true);
    excludeNoUserModificationAttributes.addLongIdentifier("excludeNoUserMod", true);
    excludeNoUserModificationAttributes.addLongIdentifier("exclude-no-user-mod", true);
    excludeNoUserModificationAttributes.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(excludeNoUserModificationAttributes);
    nonReversibleModifications = new BooleanArgument(null, "nonReversibleModifications", 1, INFO_LDIF_DIFF_ARG_DESC_NON_REVERSIBLE_MODS.get());
    nonReversibleModifications.addLongIdentifier("non-reversible-modifications", true);
    nonReversibleModifications.addLongIdentifier("nonReversibleMods", true);
    nonReversibleModifications.addLongIdentifier("non-reversible-mods", true);
    nonReversibleModifications.addLongIdentifier("nonReversible", true);
    nonReversibleModifications.addLongIdentifier("non-reversible", true);
    nonReversibleModifications.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(nonReversibleModifications);
    singleValueChanges = new BooleanArgument('S', "singleValueChanges", 1, INFO_LDIF_DIFF_ARG_DESC_SINGLE_VALUE_CHANGES.get());
    singleValueChanges.addLongIdentifier("single-value-changes", true);
    parser.addArgument(singleValueChanges);
    stripTrailingSpaces = new BooleanArgument(null, "stripTrailingSpaces", 1, INFO_LDIF_DIFF_ARG_DESC_STRIP_TRAILING_SPACES.get());
    stripTrailingSpaces.addLongIdentifier("strip-trailing-spaces", true);
    stripTrailingSpaces.addLongIdentifier("ignoreTrailingSpaces", true);
    stripTrailingSpaces.addLongIdentifier("ignore-trailing-spaces", true);
    stripTrailingSpaces.setArgumentGroupName(INFO_LDIF_DIFF_ARG_GROUP_CONTENT.get());
    parser.addArgument(stripTrailingSpaces);
    final String schemaPathDesc;
    if (PING_SERVER_AVAILABLE) {
        schemaPathDesc = INFO_LDIF_DIFF_ARG_DESC_SCHEMA_PATH_PING_SERVER.get();
    } else {
        schemaPathDesc = INFO_LDIF_DIFF_ARG_DESC_SCHEMA_PATH_STANDALONE.get();
    }
    schemaPath = new FileArgument(null, "schemaPath", false, 0, null, schemaPathDesc, true, true, false, false);
    schemaPath.addLongIdentifier("schema-path", true);
    schemaPath.addLongIdentifier("schemaFile", true);
    schemaPath.addLongIdentifier("schema-file", true);
    schemaPath.addLongIdentifier("schemaDirectory", true);
    schemaPath.addLongIdentifier("schema-directory", true);
    schemaPath.addLongIdentifier("schema", true);
    parser.addArgument(schemaPath);
    parser.addDependentArgumentSet(compressOutput, outputLDIF);
    parser.addDependentArgumentSet(encryptOutput, outputLDIF);
    parser.addDependentArgumentSet(outputEncryptionPassphraseFile, outputLDIF);
    parser.addDependentArgumentSet(overwriteExistingOutputLDIF, outputLDIF);
    parser.addDependentArgumentSet(outputEncryptionPassphraseFile, encryptOutput);
    parser.addExclusiveArgumentSet(includeAttribute, excludeAttribute);
    parser.addExclusiveArgumentSet(includeAttribute, includeOperationalAttributes);
    parser.addExclusiveArgumentSet(includeFilter, excludeFilter);
    parser.addDependentArgumentSet(excludeNoUserModificationAttributes, includeOperationalAttributes);
    parser.addExclusiveArgumentSet(nonReversibleModifications, singleValueChanges);
}
Also used : FilterArgument(com.unboundid.util.args.FilterArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 10 with FilterArgument

use of com.unboundid.util.args.FilterArgument in project ldapsdk by pingidentity.

the class TestLDAPCommandLineTool method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(final ArgumentParser parser) throws ArgumentException {
    final ArgumentParser argListParser1 = new ArgumentParser("argumentList1", "Argument List 1 Description");
    argListParser1.addArgument(new StringArgument(null, "foo", false, -1, "{foo}", "Foo Description"));
    final ArgumentParser argListParser2 = new ArgumentParser("argumentList2", "Argument List 2 Description");
    argListParser2.addArgument(new StringArgument(null, "bar", false, -1, "{bar}", "Bar Description"));
    singleValuedArgumentListArgument = new ArgumentListArgument(null, "singleValuedArgumentList", false, 1, "{argList}", "Argument List", argListParser1);
    parser.addArgument(singleValuedArgumentListArgument);
    multiValuedArgumentListArgument = new ArgumentListArgument(null, "multiValuedArgumentList", false, -1, "{argList}", "Argument List", argListParser2);
    parser.addArgument(multiValuedArgumentListArgument);
    booleanArgument = new BooleanArgument(null, "boolean", "Boolean Description");
    parser.addArgument(booleanArgument);
    booleanValueArgument = new BooleanValueArgument(null, "booleanValue", false, "{true|false}", "Boolean Value Description");
    parser.addArgument(booleanValueArgument);
    singleValuedControlArgument = new ControlArgument(null, "singleValuedControl", false, 1, null, "Control Description");
    parser.addArgument(singleValuedControlArgument);
    multiValuedControlArgument = new ControlArgument(null, "multiValuedControl", false, -1, null, "Control Description");
    parser.addArgument(multiValuedControlArgument);
    singleValuedDNArgument = new DNArgument(null, "singleValuedDN", false, 1, "{dn}", "DN Description");
    parser.addArgument(singleValuedDNArgument);
    multiValuedDNArgument = new DNArgument(null, "multiValuedDN", false, -1, "{dn}", "DN Description");
    parser.addArgument(multiValuedDNArgument);
    durationArgument = new DurationArgument(null, "duration", false, "{duration}", "Duration Description");
    parser.addArgument(durationArgument);
    singleValuedFileArgument = new FileArgument(null, "singleValuedFile", false, 1, "{path}", "File Description", false, true, true, false);
    parser.addArgument(singleValuedFileArgument);
    multiValuedFileArgument = new FileArgument(null, "multiValuedFile", false, -1, "{path}", "File Description", false, false, false, false);
    parser.addArgument(multiValuedFileArgument);
    singleValuedFilterArgument = new FilterArgument(null, "singleValuedFilter", false, 1, "{filter}", "Filter Description");
    parser.addArgument(singleValuedFilterArgument);
    multiValuedFilterArgument = new FilterArgument(null, "multiValuedFilter", false, -1, "{filter}", "Filter Description");
    parser.addArgument(multiValuedFilterArgument);
    singleValuedTimestampArgument = new TimestampArgument(null, "singleValuedGeneralizedTime", false, 1, "{timestamp}", "Generalized Time Description");
    parser.addArgument(singleValuedTimestampArgument);
    multiValuedTimestampArgument = new TimestampArgument(null, "multiValuedGeneralizedTime", false, -1, "{timestamp}", "Generalized Time Description");
    parser.addArgument(multiValuedTimestampArgument);
    singleValuedIntegerArgument = new IntegerArgument(null, "singleValuedInteger", false, 1, "{int}", "Integer Description");
    parser.addArgument(singleValuedIntegerArgument);
    multiValuedIntegerArgument = new IntegerArgument(null, "multiValuedInteger", false, -1, "{int}", "Integer Description");
    parser.addArgument(multiValuedIntegerArgument);
    scopeArgument = new ScopeArgument(null, "scope", false, "{scope}", "Scope Description");
    parser.addArgument(scopeArgument);
    singleValuedStringArgument = new StringArgument(null, "singleValuedString", false, 1, "{string}", "String Description");
    parser.addArgument(singleValuedStringArgument);
    multiValuedOpenOptionsStringArgument = new StringArgument(null, "multiValuedOpenOptionsString", false, -1, "{string}", "String Description");
    parser.addArgument(multiValuedOpenOptionsStringArgument);
    final LinkedHashSet<String> allowedValues = new LinkedHashSet<String>(5);
    allowedValues.add("first");
    allowedValues.add("second");
    allowedValues.add("third");
    allowedValues.add("fourth");
    allowedValues.add("fifth");
    multiValuedFixedOptionsStringArgument = new StringArgument(null, "multiValuedFixedOptionsString", false, -1, "{string}", "String Description", allowedValues);
    parser.addArgument(multiValuedFixedOptionsStringArgument);
    resultCodeArgument = new IntegerArgument(null, "resultCode", true, 1, "{intValue}", "The result code");
    parser.addArgument(resultCodeArgument);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ScopeArgument(com.unboundid.util.args.ScopeArgument) DurationArgument(com.unboundid.util.args.DurationArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) ArgumentParser(com.unboundid.util.args.ArgumentParser) StringArgument(com.unboundid.util.args.StringArgument) ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) BooleanValueArgument(com.unboundid.util.args.BooleanValueArgument) TimestampArgument(com.unboundid.util.args.TimestampArgument) ArgumentListArgument(com.unboundid.util.args.ArgumentListArgument)

Aggregations

FilterArgument (com.unboundid.util.args.FilterArgument)15 StringArgument (com.unboundid.util.args.StringArgument)15 BooleanArgument (com.unboundid.util.args.BooleanArgument)14 FileArgument (com.unboundid.util.args.FileArgument)14 IntegerArgument (com.unboundid.util.args.IntegerArgument)13 DNArgument (com.unboundid.util.args.DNArgument)11 ControlArgument (com.unboundid.util.args.ControlArgument)8 ScopeArgument (com.unboundid.util.args.ScopeArgument)6 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)4 ArgumentParser (com.unboundid.util.args.ArgumentParser)3 BooleanValueArgument (com.unboundid.util.args.BooleanValueArgument)3 DurationArgument (com.unboundid.util.args.DurationArgument)3 TimestampArgument (com.unboundid.util.args.TimestampArgument)2 DN (com.unboundid.ldap.sdk.DN)1 Filter (com.unboundid.ldap.sdk.Filter)1 LDAPConnectionPool (com.unboundid.ldap.sdk.LDAPConnectionPool)1 LDAPException (com.unboundid.ldap.sdk.LDAPException)1 LDIFWriter (com.unboundid.ldif.LDIFWriter)1 DNFileReader (com.unboundid.util.DNFileReader)1 FilterFileReader (com.unboundid.util.FilterFileReader)1