Search in sources :

Example 16 with BooleanArgument

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

the class LDIFModify method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    sourceLDIF = new FileArgument('s', "sourceLDIF", (sourceReader == null), 1, null, INFO_LDIFMODIFY_ARG_DESC_SOURCE_LDIF.get(), true, true, true, false);
    sourceLDIF.addLongIdentifier("source-ldif", true);
    sourceLDIF.addLongIdentifier("sourceFile", true);
    sourceLDIF.addLongIdentifier("source-file", true);
    sourceLDIF.addLongIdentifier("source", true);
    sourceLDIF.addLongIdentifier("inputLDIF", true);
    sourceLDIF.addLongIdentifier("input-ldif", true);
    sourceLDIF.addLongIdentifier("inputFile", true);
    sourceLDIF.addLongIdentifier("input-file", true);
    sourceLDIF.addLongIdentifier("input", true);
    sourceLDIF.addLongIdentifier("ldifFile", true);
    sourceLDIF.addLongIdentifier("ldif-file", true);
    sourceLDIF.addLongIdentifier("ldif", true);
    sourceLDIF.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(sourceLDIF);
    final String sourcePWDesc;
    if (PING_SERVER_AVAILABLE) {
        sourcePWDesc = INFO_LDIFMODIFY_ARG_DESC_SOURCE_PW_FILE_PING_SERVER.get();
    } else {
        sourcePWDesc = INFO_LDIFMODIFY_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.addLongIdentifier("inputEncryptionPassphraseFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("input-encryption-passphrase-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("inputPassphraseFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("input-passphrase-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("inputEncryptionPasswordFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("input-encryption-password-file", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("inputPasswordFile", true);
    sourceEncryptionPassphraseFile.addLongIdentifier("input-password-file", true);
    sourceEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(sourceEncryptionPassphraseFile);
    changesLDIF = new FileArgument('m', "changesLDIF", (changesReader == null), 1, null, INFO_LDIFMODIFY_ARG_DESC_CHANGES_LDIF.get(), true, true, true, false);
    changesLDIF.addLongIdentifier("changes-ldif", true);
    changesLDIF.addLongIdentifier("changesFile", true);
    changesLDIF.addLongIdentifier("changes-file", true);
    changesLDIF.addLongIdentifier("changes", true);
    changesLDIF.addLongIdentifier("updatesLDIF", true);
    changesLDIF.addLongIdentifier("updates-ldif", true);
    changesLDIF.addLongIdentifier("updatesFile", true);
    changesLDIF.addLongIdentifier("updates-file", true);
    changesLDIF.addLongIdentifier("updates", true);
    changesLDIF.addLongIdentifier("modificationsLDIF", true);
    changesLDIF.addLongIdentifier("modifications-ldif", true);
    changesLDIF.addLongIdentifier("modificationsFile", true);
    changesLDIF.addLongIdentifier("modifications-file", true);
    changesLDIF.addLongIdentifier("modifications", true);
    changesLDIF.addLongIdentifier("modsLDIF", true);
    changesLDIF.addLongIdentifier("mods-ldif", true);
    changesLDIF.addLongIdentifier("modsFile", true);
    changesLDIF.addLongIdentifier("mods-file", true);
    changesLDIF.addLongIdentifier("mods", true);
    changesLDIF.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(changesLDIF);
    final String changesPWDesc;
    if (PING_SERVER_AVAILABLE) {
        changesPWDesc = INFO_LDIFMODIFY_ARG_DESC_CHANGES_PW_FILE_PING_SERVER.get();
    } else {
        changesPWDesc = INFO_LDIFMODIFY_ARG_DESC_CHANGES_PW_FILE_STANDALONE.get();
    }
    changesEncryptionPassphraseFile = new FileArgument(null, "changesEncryptionPassphraseFile", false, 1, null, changesPWDesc, true, true, true, false);
    changesEncryptionPassphraseFile.addLongIdentifier("changes-encryption-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changesPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changes-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changesEncryptionPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changes-encryption-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changesPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("changes-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updatesEncryptionPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updates-encryption-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updatesPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updates-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updatesEncryptionPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updates-encryption-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updatesPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("updates-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modificationsEncryptionPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modifications-encryption-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modificationsPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modifications-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modificationsEncryptionPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modifications-encryption-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modificationsPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modifications-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modsEncryptionPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("mods-encryption-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modsPassphraseFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("mods-passphrase-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modsEncryptionPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("mods-encryption-password-file", true);
    changesEncryptionPassphraseFile.addLongIdentifier("modsPasswordFile", true);
    changesEncryptionPassphraseFile.addLongIdentifier("mods-password-file", true);
    changesEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(changesEncryptionPassphraseFile);
    stripTrailingSpaces = new BooleanArgument(null, "stripTrailingSpaces", 1, INFO_LDIFMODIFY_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_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(stripTrailingSpaces);
    lenientModifications = new BooleanArgument(null, "lenientModifications", 1, INFO_LDIFMODIFY_ARG_DESC_LENIENT_MODIFICATIONS.get());
    lenientModifications.addLongIdentifier("lenient-modifications", true);
    lenientModifications.addLongIdentifier("lenientModification", true);
    lenientModifications.addLongIdentifier("lenient-modification", true);
    lenientModifications.addLongIdentifier("lenientMods", true);
    lenientModifications.addLongIdentifier("lenient-mods", true);
    lenientModifications.addLongIdentifier("lenientMod", true);
    lenientModifications.addLongIdentifier("lenient-mod", true);
    lenientModifications.addLongIdentifier("lenient", true);
    lenientModifications.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    lenientModifications.setHidden(true);
    parser.addArgument(lenientModifications);
    strictModifications = new BooleanArgument(null, "strictModifications", 1, INFO_LDIFMODIFY_ARG_DESC_STRICT_MODIFICATIONS.get());
    strictModifications.addLongIdentifier("strict-modifications", true);
    strictModifications.addLongIdentifier("strictModification", true);
    strictModifications.addLongIdentifier("strict-modification", true);
    strictModifications.addLongIdentifier("strictMods", true);
    strictModifications.addLongIdentifier("strict-mods", true);
    strictModifications.addLongIdentifier("strictMod", true);
    strictModifications.addLongIdentifier("strict-mod", true);
    strictModifications.addLongIdentifier("strict", true);
    strictModifications.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(strictModifications);
    ignoreDuplicateDeletes = new BooleanArgument(null, "ignoreDuplicateDeletes", 1, INFO_LDIFMODIFY_ARG_DESC_IGNORE_DUPLICATE_DELETES.get());
    ignoreDuplicateDeletes.addLongIdentifier("ignore-duplicate-deletes", true);
    ignoreDuplicateDeletes.addLongIdentifier("ignoreRepeatedDeletes", true);
    ignoreDuplicateDeletes.addLongIdentifier("ignore-repeated-deletes", true);
    ignoreDuplicateDeletes.addLongIdentifier("ignoreRepeatDeletes", true);
    ignoreDuplicateDeletes.addLongIdentifier("ignore-repeat-deletes", true);
    ignoreDuplicateDeletes.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(ignoreDuplicateDeletes);
    ignoreDeletesOfNonexistentEntries = new BooleanArgument(null, "ignoreDeletesOfNonexistentEntries", 1, INFO_LDIFMODIFY_ARG_DESC_IGNORE_NONEXISTENT_DELETES.get());
    ignoreDeletesOfNonexistentEntries.addLongIdentifier("ignore-deletes-of-nonexistent-entries", true);
    ignoreDeletesOfNonexistentEntries.addLongIdentifier("ignoreNonexistentDeletes", true);
    ignoreDeletesOfNonexistentEntries.addLongIdentifier("ignore-nonexistent-deletes", true);
    ignoreDeletesOfNonexistentEntries.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(ignoreDeletesOfNonexistentEntries);
    ignoreModifiesOfNonexistentEntries = new BooleanArgument(null, "ignoreModifiesOfNonexistentEntries", 1, INFO_LDIFMODIFY_ARG_DESC_IGNORE_NONEXISTENT_MODIFIES.get());
    ignoreModifiesOfNonexistentEntries.addLongIdentifier("ignore-modifies-of-nonexistent-entries", true);
    ignoreModifiesOfNonexistentEntries.addLongIdentifier("ignoreNonexistentModifies", true);
    ignoreModifiesOfNonexistentEntries.addLongIdentifier("ignore-nonexistent-modifies", true);
    ignoreModifiesOfNonexistentEntries.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_INPUT.get());
    parser.addArgument(ignoreModifiesOfNonexistentEntries);
    targetLDIF = new FileArgument('t', "targetLDIF", (targetWriter == null), 1, null, INFO_LDIFMODIFY_ARG_DESC_TARGET_LDIF.get(), false, true, true, false);
    targetLDIF.addLongIdentifier("target-ldif", true);
    targetLDIF.addLongIdentifier("targetFile", true);
    targetLDIF.addLongIdentifier("target-file", true);
    targetLDIF.addLongIdentifier("target", true);
    targetLDIF.addLongIdentifier("outputLDIF", true);
    targetLDIF.addLongIdentifier("output-ldif", true);
    targetLDIF.addLongIdentifier("outputFile", true);
    targetLDIF.addLongIdentifier("output-file", true);
    targetLDIF.addLongIdentifier("output", true);
    targetLDIF.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(targetLDIF);
    compressTarget = new BooleanArgument(null, "compressTarget", 1, INFO_LDIFMODIFY_ARG_DESC_COMPRESS_TARGET.get());
    compressTarget.addLongIdentifier("compress-target", true);
    compressTarget.addLongIdentifier("compressOutput", true);
    compressTarget.addLongIdentifier("compress-output", true);
    compressTarget.addLongIdentifier("compress", true);
    compressTarget.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(compressTarget);
    encryptTarget = new BooleanArgument(null, "encryptTarget", 1, INFO_LDIFMODIFY_ARG_DESC_ENCRYPT_TARGET.get());
    encryptTarget.addLongIdentifier("encrypt-target", true);
    encryptTarget.addLongIdentifier("encryptOutput", true);
    encryptTarget.addLongIdentifier("encrypt-output", true);
    encryptTarget.addLongIdentifier("encrypt", true);
    encryptTarget.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(encryptTarget);
    targetEncryptionPassphraseFile = new FileArgument(null, "targetEncryptionPassphraseFile", false, 1, null, INFO_LDIFMODIFY_ARG_DESC_TARGET_PW_FILE.get(), 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.addLongIdentifier("outputEncryptionPassphraseFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("output-encryption-passphrase-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("outputPassphraseFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("output-passphrase-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("outputEncryptionPasswordFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("output-encryption-password-file", true);
    targetEncryptionPassphraseFile.addLongIdentifier("outputPasswordFile", true);
    targetEncryptionPassphraseFile.addLongIdentifier("output-password-file", true);
    targetEncryptionPassphraseFile.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(targetEncryptionPassphraseFile);
    wrapColumn = new IntegerArgument(null, "wrapColumn", false, 1, null, INFO_LDIFMODIFY_ARG_DESC_WRAP_COLUMN.get(), 5, Integer.MAX_VALUE);
    wrapColumn.addLongIdentifier("wrap-column", true);
    wrapColumn.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(wrapColumn);
    doNotWrap = new BooleanArgument('T', "doNotWrap", 1, INFO_LDIFMODIFY_ARG_DESC_DO_NOT_WRAP.get());
    doNotWrap.addLongIdentifier("do-not-wrap", true);
    doNotWrap.addLongIdentifier("dontWrap", true);
    doNotWrap.addLongIdentifier("dont-wrap", true);
    doNotWrap.addLongIdentifier("noWrap", true);
    doNotWrap.addLongIdentifier("no-wrap", true);
    doNotWrap.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(doNotWrap);
    suppressComments = new BooleanArgument(null, "suppressComments", 1, INFO_LDIFMODIFY_ARG_DESC_SUPPRESS_COMMENTS.get());
    suppressComments.addLongIdentifier("suppress-comments", true);
    suppressComments.addLongIdentifier("excludeComments", true);
    suppressComments.addLongIdentifier("exclude-comments", true);
    suppressComments.addLongIdentifier("noComments", true);
    suppressComments.addLongIdentifier("no-comments", true);
    suppressComments.setArgumentGroupName(INFO_LDIFMODIFY_ARG_GROUP_OUTPUT.get());
    parser.addArgument(suppressComments);
    noSchemaCheck = new BooleanArgument(null, "noSchemaCheck", 1, INFO_LDIFMODIFY_ARG_DESC_NO_SCHEMA_CHECK.get());
    noSchemaCheck.addLongIdentifier("no-schema-check", true);
    noSchemaCheck.setHidden(true);
    parser.addArgument(noSchemaCheck);
    parser.addExclusiveArgumentSet(lenientModifications, strictModifications);
    parser.addExclusiveArgumentSet(wrapColumn, doNotWrap);
    parser.addDependentArgumentSet(targetEncryptionPassphraseFile, encryptTarget);
}
Also used : BooleanArgument(com.unboundid.util.args.BooleanArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) FileArgument(com.unboundid.util.args.FileArgument)

Example 17 with BooleanArgument

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

the class GenerateSchemaFromSource method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    classNameArg = new StringArgument('c', "javaClass", true, 1, INFO_GEN_SCHEMA_VALUE_PLACEHOLDER_CLASS.get(), INFO_GEN_SCHEMA_ARG_DESCRIPTION_JAVA_CLASS.get());
    classNameArg.addLongIdentifier("java-class", true);
    parser.addArgument(classNameArg);
    outputFileArg = new FileArgument('f', "outputFile", true, 1, INFO_GEN_SCHEMA_VALUE_PLACEHOLDER_PATH.get(), INFO_GEN_SCHEMA_ARG_DESCRIPTION_OUTPUT_FILE.get(), false, true, true, false);
    outputFileArg.addLongIdentifier("output-file", true);
    parser.addArgument(outputFileArg);
    modifyFormatArg = new BooleanArgument('m', "modifyFormat", INFO_GEN_SCHEMA_ARG_DESCRIPTION_MODIFY_FORMAT.get());
    modifyFormatArg.addLongIdentifier("modify-format", true);
    parser.addArgument(modifyFormatArg);
}
Also used : BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 18 with BooleanArgument

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

the class GenerateSourceFromSchema method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    outputDirectoryArg = new FileArgument('d', "outputDirectory", false, 1, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_PATH.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_OUTPUT_DIRECTORY.get(), true, true, false, true);
    outputDirectoryArg.addLongIdentifier("output-directory", true);
    parser.addArgument(outputDirectoryArg);
    structuralClassArg = new StringArgument('s', "structuralClass", true, 1, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_STRUCTURAL_CLASS.get());
    structuralClassArg.addLongIdentifier("structural-class", true);
    parser.addArgument(structuralClassArg);
    auxiliaryClassArg = new StringArgument('a', "auxiliaryClass", false, 0, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_AUXILIARY_CLASS.get());
    auxiliaryClassArg.addLongIdentifier("auxiliary-class", true);
    parser.addArgument(auxiliaryClassArg);
    rdnAttributeArg = new StringArgument('r', "rdnAttribute", true, 0, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_RDN_ATTRIBUTE.get());
    rdnAttributeArg.addLongIdentifier("rdn-attribute", true);
    parser.addArgument(rdnAttributeArg);
    lazyAttributeArg = new StringArgument('l', "lazyAttribute", false, 0, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_LAZY_ATTRIBUTE.get());
    lazyAttributeArg.addLongIdentifier("lazy-attribute", true);
    parser.addArgument(lazyAttributeArg);
    operationalAttributeArg = new StringArgument('O', "operationalAttribute", false, 0, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_OPERATIONAL_ATTRIBUTE.get());
    operationalAttributeArg.addLongIdentifier("operational-attribute", true);
    parser.addArgument(operationalAttributeArg);
    defaultParentDNArg = new DNArgument('b', "defaultParentDN", false, 1, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_DN.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_DEFAULT_PARENT_DN.get());
    defaultParentDNArg.addLongIdentifier("default-parent-dn", true);
    parser.addArgument(defaultParentDNArg);
    packageNameArg = new StringArgument('n', "packageName", false, 1, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_PACKAGE_NAME.get());
    packageNameArg.addLongIdentifier("package-name", true);
    parser.addArgument(packageNameArg);
    classNameArg = new StringArgument('c', "className", false, 1, INFO_GEN_SOURCE_VALUE_PLACEHOLDER_NAME.get(), INFO_GEN_SOURCE_ARG_DESCRIPTION_CLASS_NAME.get());
    classNameArg.addLongIdentifier("class-name", true);
    parser.addArgument(classNameArg);
    terseArg = new BooleanArgument('t', "terse", 1, INFO_GEN_SOURCE_ARG_DESCRIPTION_TERSE.get());
    parser.addArgument(terseArg);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 19 with BooleanArgument

use of com.unboundid.util.args.BooleanArgument 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 20 with BooleanArgument

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

the class DeliverOneTimePassword method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    bindDN = new DNArgument('D', "bindDN", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_DN.get(), INFO_DELIVER_OTP_DESCRIPTION_BIND_DN.get());
    bindDN.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_ID_AND_AUTH.get());
    bindDN.addLongIdentifier("bind-dn", true);
    parser.addArgument(bindDN);
    userName = new StringArgument('n', "userName", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_USERNAME.get(), INFO_DELIVER_OTP_DESCRIPTION_USERNAME.get());
    userName.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_ID_AND_AUTH.get());
    userName.addLongIdentifier("user-name", true);
    parser.addArgument(userName);
    bindPassword = new StringArgument('w', "bindPassword", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_PASSWORD.get(), INFO_DELIVER_OTP_DESCRIPTION_BIND_PW.get());
    bindPassword.setSensitive(true);
    bindPassword.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_ID_AND_AUTH.get());
    bindPassword.addLongIdentifier("bind-password", true);
    parser.addArgument(bindPassword);
    bindPasswordFile = new FileArgument('j', "bindPasswordFile", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_PATH.get(), INFO_DELIVER_OTP_DESCRIPTION_BIND_PW_FILE.get(), true, true, true, false);
    bindPasswordFile.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_ID_AND_AUTH.get());
    bindPasswordFile.addLongIdentifier("bind-password-file", true);
    parser.addArgument(bindPasswordFile);
    promptForBindPassword = new BooleanArgument(null, "promptForBindPassword", 1, INFO_DELIVER_OTP_DESCRIPTION_BIND_PW_PROMPT.get());
    promptForBindPassword.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_ID_AND_AUTH.get());
    promptForBindPassword.addLongIdentifier("prompt-for-bind-password", true);
    parser.addArgument(promptForBindPassword);
    deliveryMechanism = new StringArgument('m', "deliveryMechanism", false, 0, INFO_DELIVER_OTP_PLACEHOLDER_NAME.get(), INFO_DELIVER_OTP_DESCRIPTION_MECH.get());
    deliveryMechanism.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    deliveryMechanism.addLongIdentifier("delivery-mechanism", true);
    parser.addArgument(deliveryMechanism);
    messageSubject = new StringArgument('s', "messageSubject", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_SUBJECT.get(), INFO_DELIVER_OTP_DESCRIPTION_SUBJECT.get());
    messageSubject.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    messageSubject.addLongIdentifier("message-subject", true);
    parser.addArgument(messageSubject);
    fullTextBeforeOTP = new StringArgument('f', "fullTextBeforeOTP", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_FULL_BEFORE.get(), INFO_DELIVER_OTP_DESCRIPTION_FULL_BEFORE.get());
    fullTextBeforeOTP.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    fullTextBeforeOTP.addLongIdentifier("full-text-before-otp", true);
    parser.addArgument(fullTextBeforeOTP);
    fullTextAfterOTP = new StringArgument('F', "fullTextAfterOTP", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_FULL_AFTER.get(), INFO_DELIVER_OTP_DESCRIPTION_FULL_AFTER.get());
    fullTextAfterOTP.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    fullTextAfterOTP.addLongIdentifier("full-text-after-otp", true);
    parser.addArgument(fullTextAfterOTP);
    compactTextBeforeOTP = new StringArgument('c', "compactTextBeforeOTP", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_COMPACT_BEFORE.get(), INFO_DELIVER_OTP_DESCRIPTION_COMPACT_BEFORE.get());
    compactTextBeforeOTP.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    compactTextBeforeOTP.addLongIdentifier("compact-text-before-otp", true);
    parser.addArgument(compactTextBeforeOTP);
    compactTextAfterOTP = new StringArgument('C', "compactTextAfterOTP", false, 1, INFO_DELIVER_OTP_PLACEHOLDER_COMPACT_AFTER.get(), INFO_DELIVER_OTP_DESCRIPTION_COMPACT_AFTER.get());
    compactTextAfterOTP.setArgumentGroupName(INFO_DELIVER_OTP_GROUP_DELIVERY_MECH.get());
    compactTextAfterOTP.addLongIdentifier("compact-text-after-otp", true);
    parser.addArgument(compactTextAfterOTP);
    // Either the bind DN or username must have been provided.
    parser.addRequiredArgumentSet(bindDN, userName);
    // Only one option may be used for specifying the user identity.
    parser.addExclusiveArgumentSet(bindDN, userName);
    // Only one option may be used for specifying the bind password.
    parser.addExclusiveArgumentSet(bindPassword, bindPasswordFile, promptForBindPassword);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Aggregations

BooleanArgument (com.unboundid.util.args.BooleanArgument)65 StringArgument (com.unboundid.util.args.StringArgument)53 FileArgument (com.unboundid.util.args.FileArgument)51 IntegerArgument (com.unboundid.util.args.IntegerArgument)35 DNArgument (com.unboundid.util.args.DNArgument)25 LDAPException (com.unboundid.ldap.sdk.LDAPException)19 File (java.io.File)19 ArgumentException (com.unboundid.util.args.ArgumentException)18 ASN1BitString (com.unboundid.asn1.ASN1BitString)16 NotNull (com.unboundid.util.NotNull)16 FilterArgument (com.unboundid.util.args.FilterArgument)14 ControlArgument (com.unboundid.util.args.ControlArgument)13 IOException (java.io.IOException)13 UnrecoverableKeyException (java.security.UnrecoverableKeyException)12 ArrayList (java.util.ArrayList)12 KeyStore (java.security.KeyStore)10 ScopeArgument (com.unboundid.util.args.ScopeArgument)9 Certificate (java.security.cert.Certificate)8 ArgumentParser (com.unboundid.util.args.ArgumentParser)7 DN (com.unboundid.ldap.sdk.DN)6