Search in sources :

Example 16 with DNArgument

use of com.unboundid.util.args.DNArgument 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)

Example 17 with DNArgument

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

the class LDAPCommandLineTool method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public final void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    final String argumentGroup;
    final boolean supportsAuthentication = supportsAuthentication();
    if (supportsAuthentication) {
        argumentGroup = INFO_LDAP_TOOL_ARG_GROUP_CONNECT_AND_AUTH.get();
    } else {
        argumentGroup = INFO_LDAP_TOOL_ARG_GROUP_CONNECT.get();
    }
    host = new StringArgument(getShortIdentifierIfNotSuppressed('h'), "hostname", true, (supportsMultipleServers() ? 0 : 1), INFO_LDAP_TOOL_PLACEHOLDER_HOST.get(), INFO_LDAP_TOOL_DESCRIPTION_HOST.get(), "localhost");
    if (includeAlternateLongIdentifiers()) {
        host.addLongIdentifier("host", true);
        host.addLongIdentifier("address", true);
    }
    host.setArgumentGroupName(argumentGroup);
    parser.addArgument(host);
    port = new IntegerArgument(getShortIdentifierIfNotSuppressed('p'), "port", true, (supportsMultipleServers() ? 0 : 1), INFO_LDAP_TOOL_PLACEHOLDER_PORT.get(), INFO_LDAP_TOOL_DESCRIPTION_PORT.get(), 1, 65_535, 389);
    port.setArgumentGroupName(argumentGroup);
    parser.addArgument(port);
    if (supportsAuthentication) {
        bindDN = new DNArgument(getShortIdentifierIfNotSuppressed('D'), "bindDN", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_DN.get(), INFO_LDAP_TOOL_DESCRIPTION_BIND_DN.get());
        bindDN.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            bindDN.addLongIdentifier("bind-dn", true);
        }
        parser.addArgument(bindDN);
        bindPassword = new StringArgument(getShortIdentifierIfNotSuppressed('w'), "bindPassword", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PASSWORD.get(), INFO_LDAP_TOOL_DESCRIPTION_BIND_PW.get());
        bindPassword.setSensitive(true);
        bindPassword.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            bindPassword.addLongIdentifier("bind-password", true);
        }
        parser.addArgument(bindPassword);
        bindPasswordFile = new FileArgument(getShortIdentifierIfNotSuppressed('j'), "bindPasswordFile", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PATH.get(), INFO_LDAP_TOOL_DESCRIPTION_BIND_PW_FILE.get(), true, true, true, false);
        bindPasswordFile.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            bindPasswordFile.addLongIdentifier("bind-password-file", true);
        }
        parser.addArgument(bindPasswordFile);
        promptForBindPassword = new BooleanArgument(null, "promptForBindPassword", 1, INFO_LDAP_TOOL_DESCRIPTION_BIND_PW_PROMPT.get());
        promptForBindPassword.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            promptForBindPassword.addLongIdentifier("prompt-for-bind-password", true);
        }
        parser.addArgument(promptForBindPassword);
    }
    useSSL = new BooleanArgument(getShortIdentifierIfNotSuppressed('Z'), "useSSL", 1, INFO_LDAP_TOOL_DESCRIPTION_USE_SSL.get());
    useSSL.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        useSSL.addLongIdentifier("use-ssl", true);
    }
    parser.addArgument(useSSL);
    useStartTLS = new BooleanArgument(getShortIdentifierIfNotSuppressed('q'), "useStartTLS", 1, INFO_LDAP_TOOL_DESCRIPTION_USE_START_TLS.get());
    useStartTLS.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        useStartTLS.addLongIdentifier("use-starttls", true);
        useStartTLS.addLongIdentifier("use-start-tls", true);
    }
    parser.addArgument(useStartTLS);
    final String defaultTrustArgDesc;
    if (InternalSDKHelper.getPingIdentityServerRoot() != null) {
        defaultTrustArgDesc = INFO_LDAP_TOOL_DESCRIPTION_DEFAULT_TRUST_WITH_PING_DS.get();
    } else {
        defaultTrustArgDesc = INFO_LDAP_TOOL_DESCRIPTION_DEFAULT_TRUST_WITHOUT_PING_DS.get();
    }
    defaultTrust = new BooleanArgument(null, "defaultTrust", 1, defaultTrustArgDesc);
    defaultTrust.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        defaultTrust.addLongIdentifier("default-trust", true);
        defaultTrust.addLongIdentifier("useDefaultTrust", true);
        defaultTrust.addLongIdentifier("use-default-trust", true);
    }
    parser.addArgument(defaultTrust);
    trustAll = new BooleanArgument(getShortIdentifierIfNotSuppressed('X'), "trustAll", 1, INFO_LDAP_TOOL_DESCRIPTION_TRUST_ALL.get());
    trustAll.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        trustAll.addLongIdentifier("trustAllCertificates", true);
        trustAll.addLongIdentifier("trust-all", true);
        trustAll.addLongIdentifier("trust-all-certificates", true);
    }
    parser.addArgument(trustAll);
    keyStorePath = new StringArgument(getShortIdentifierIfNotSuppressed('K'), "keyStorePath", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PATH.get(), INFO_LDAP_TOOL_DESCRIPTION_KEY_STORE_PATH.get());
    keyStorePath.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        keyStorePath.addLongIdentifier("key-store-path", true);
    }
    parser.addArgument(keyStorePath);
    keyStorePassword = new StringArgument(getShortIdentifierIfNotSuppressed('W'), "keyStorePassword", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PASSWORD.get(), INFO_LDAP_TOOL_DESCRIPTION_KEY_STORE_PASSWORD.get());
    keyStorePassword.setSensitive(true);
    keyStorePassword.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        keyStorePassword.addLongIdentifier("keyStorePIN", true);
        keyStorePassword.addLongIdentifier("key-store-password", true);
        keyStorePassword.addLongIdentifier("key-store-pin", true);
    }
    parser.addArgument(keyStorePassword);
    keyStorePasswordFile = new FileArgument(getShortIdentifierIfNotSuppressed('u'), "keyStorePasswordFile", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PATH.get(), INFO_LDAP_TOOL_DESCRIPTION_KEY_STORE_PASSWORD_FILE.get());
    keyStorePasswordFile.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        keyStorePasswordFile.addLongIdentifier("keyStorePINFile", true);
        keyStorePasswordFile.addLongIdentifier("key-store-password-file", true);
        keyStorePasswordFile.addLongIdentifier("key-store-pin-file", true);
    }
    parser.addArgument(keyStorePasswordFile);
    promptForKeyStorePassword = new BooleanArgument(null, "promptForKeyStorePassword", 1, INFO_LDAP_TOOL_DESCRIPTION_KEY_STORE_PASSWORD_PROMPT.get());
    promptForKeyStorePassword.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        promptForKeyStorePassword.addLongIdentifier("promptForKeyStorePIN", true);
        promptForKeyStorePassword.addLongIdentifier("prompt-for-key-store-password", true);
        promptForKeyStorePassword.addLongIdentifier("prompt-for-key-store-pin", true);
    }
    parser.addArgument(promptForKeyStorePassword);
    keyStoreFormat = new StringArgument(null, "keyStoreFormat", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_FORMAT.get(), INFO_LDAP_TOOL_DESCRIPTION_KEY_STORE_FORMAT.get());
    keyStoreFormat.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        keyStoreFormat.addLongIdentifier("keyStoreType", true);
        keyStoreFormat.addLongIdentifier("key-store-format", true);
        keyStoreFormat.addLongIdentifier("key-store-type", true);
    }
    parser.addArgument(keyStoreFormat);
    trustStorePath = new StringArgument(getShortIdentifierIfNotSuppressed('P'), "trustStorePath", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PATH.get(), INFO_LDAP_TOOL_DESCRIPTION_TRUST_STORE_PATH.get());
    trustStorePath.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        trustStorePath.addLongIdentifier("trust-store-path", true);
    }
    parser.addArgument(trustStorePath);
    trustStorePassword = new StringArgument(getShortIdentifierIfNotSuppressed('T'), "trustStorePassword", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PASSWORD.get(), INFO_LDAP_TOOL_DESCRIPTION_TRUST_STORE_PASSWORD.get());
    trustStorePassword.setSensitive(true);
    trustStorePassword.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        trustStorePassword.addLongIdentifier("trustStorePIN", true);
        trustStorePassword.addLongIdentifier("trust-store-password", true);
        trustStorePassword.addLongIdentifier("trust-store-pin", true);
    }
    parser.addArgument(trustStorePassword);
    trustStorePasswordFile = new FileArgument(getShortIdentifierIfNotSuppressed('U'), "trustStorePasswordFile", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_PATH.get(), INFO_LDAP_TOOL_DESCRIPTION_TRUST_STORE_PASSWORD_FILE.get());
    trustStorePasswordFile.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        trustStorePasswordFile.addLongIdentifier("trustStorePINFile", true);
        trustStorePasswordFile.addLongIdentifier("trust-store-password-file", true);
        trustStorePasswordFile.addLongIdentifier("trust-store-pin-file", true);
    }
    parser.addArgument(trustStorePasswordFile);
    promptForTrustStorePassword = new BooleanArgument(null, "promptForTrustStorePassword", 1, INFO_LDAP_TOOL_DESCRIPTION_TRUST_STORE_PASSWORD_PROMPT.get());
    promptForTrustStorePassword.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        promptForTrustStorePassword.addLongIdentifier("promptForTrustStorePIN", true);
        promptForTrustStorePassword.addLongIdentifier("prompt-for-trust-store-password", true);
        promptForTrustStorePassword.addLongIdentifier("prompt-for-trust-store-pin", true);
    }
    parser.addArgument(promptForTrustStorePassword);
    trustStoreFormat = new StringArgument(null, "trustStoreFormat", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_FORMAT.get(), INFO_LDAP_TOOL_DESCRIPTION_TRUST_STORE_FORMAT.get());
    trustStoreFormat.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        trustStoreFormat.addLongIdentifier("trustStoreType", true);
        trustStoreFormat.addLongIdentifier("trust-store-format", true);
        trustStoreFormat.addLongIdentifier("trust-store-type", true);
    }
    parser.addArgument(trustStoreFormat);
    certificateNickname = new StringArgument(getShortIdentifierIfNotSuppressed('N'), "certNickname", false, 1, INFO_LDAP_TOOL_PLACEHOLDER_CERT_NICKNAME.get(), INFO_LDAP_TOOL_DESCRIPTION_CERT_NICKNAME.get());
    certificateNickname.setArgumentGroupName(argumentGroup);
    if (includeAlternateLongIdentifiers()) {
        certificateNickname.addLongIdentifier("certificateNickname", true);
        certificateNickname.addLongIdentifier("cert-nickname", true);
        certificateNickname.addLongIdentifier("certificate-nickname", true);
    }
    parser.addArgument(certificateNickname);
    if (supportsSSLDebugging()) {
        enableSSLDebugging = new BooleanArgument(null, "enableSSLDebugging", 1, INFO_LDAP_TOOL_DESCRIPTION_ENABLE_SSL_DEBUGGING.get());
        enableSSLDebugging.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            enableSSLDebugging.addLongIdentifier("enableTLSDebugging", true);
            enableSSLDebugging.addLongIdentifier("enableStartTLSDebugging", true);
            enableSSLDebugging.addLongIdentifier("enable-ssl-debugging", true);
            enableSSLDebugging.addLongIdentifier("enable-tls-debugging", true);
            enableSSLDebugging.addLongIdentifier("enable-starttls-debugging", true);
            enableSSLDebugging.addLongIdentifier("enable-start-tls-debugging", true);
        }
        parser.addArgument(enableSSLDebugging);
        addEnableSSLDebuggingArgument(enableSSLDebugging);
    }
    if (supportsAuthentication) {
        saslOption = new StringArgument(getShortIdentifierIfNotSuppressed('o'), "saslOption", false, 0, INFO_LDAP_TOOL_PLACEHOLDER_SASL_OPTION.get(), INFO_LDAP_TOOL_DESCRIPTION_SASL_OPTION.get());
        saslOption.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            saslOption.addLongIdentifier("sasl-option", true);
        }
        parser.addArgument(saslOption);
        useSASLExternal = new BooleanArgument(null, "useSASLExternal", 1, INFO_LDAP_TOOL_DESCRIPTION_USE_SASL_EXTERNAL.get());
        useSASLExternal.setArgumentGroupName(argumentGroup);
        if (includeAlternateLongIdentifiers()) {
            useSASLExternal.addLongIdentifier("use-sasl-external", true);
        }
        parser.addArgument(useSASLExternal);
        if (supportsSASLHelp()) {
            helpSASL = new BooleanArgument(null, "helpSASL", INFO_LDAP_TOOL_DESCRIPTION_HELP_SASL.get());
            helpSASL.setArgumentGroupName(argumentGroup);
            if (includeAlternateLongIdentifiers()) {
                helpSASL.addLongIdentifier("help-sasl", true);
            }
            helpSASL.setUsageArgument(true);
            parser.addArgument(helpSASL);
            setHelpSASLArgument(helpSASL);
        }
    }
    // Both useSSL and useStartTLS cannot be used together.
    parser.addExclusiveArgumentSet(useSSL, useStartTLS);
    // Only one option may be used for specifying the key store password.
    parser.addExclusiveArgumentSet(keyStorePassword, keyStorePasswordFile, promptForKeyStorePassword);
    // Only one option may be used for specifying the trust store password.
    parser.addExclusiveArgumentSet(trustStorePassword, trustStorePasswordFile, promptForTrustStorePassword);
    // The defaultTrust argument cannot be used in conjunction with the
    // trustAll argument.
    parser.addExclusiveArgumentSet(defaultTrust, trustAll);
    // It doesn't make sense to provide a trust store path if any server
    // certificate should be trusted.
    parser.addExclusiveArgumentSet(trustAll, trustStorePath);
    // If a key store password is provided, then a key store path must have also
    // been provided.
    parser.addDependentArgumentSet(keyStorePassword, keyStorePath);
    parser.addDependentArgumentSet(keyStorePasswordFile, keyStorePath);
    parser.addDependentArgumentSet(promptForKeyStorePassword, keyStorePath);
    // If a trust store password is provided, then a trust store path must have
    // also been provided.
    parser.addDependentArgumentSet(trustStorePassword, trustStorePath);
    parser.addDependentArgumentSet(trustStorePasswordFile, trustStorePath);
    parser.addDependentArgumentSet(promptForTrustStorePassword, trustStorePath);
    // If a key or trust store path is provided, then the tool must either use
    // SSL or StartTLS.
    parser.addDependentArgumentSet(keyStorePath, useSSL, useStartTLS);
    parser.addDependentArgumentSet(trustStorePath, useSSL, useStartTLS);
    // If the default trust argument was used, then the tool must either use
    // SSL or StartTLS.
    parser.addDependentArgumentSet(defaultTrust, useSSL, useStartTLS);
    // If the tool should trust all server certificates, then the tool must
    // either use SSL or StartTLS.
    parser.addDependentArgumentSet(trustAll, useSSL, useStartTLS);
    if (supportsAuthentication) {
        // provided unless defaultToPromptForBindPassword returns true.
        if (!defaultToPromptForBindPassword()) {
            parser.addDependentArgumentSet(bindDN, bindPassword, bindPasswordFile, promptForBindPassword);
        }
        // The bindDN, saslOption, and useSASLExternal arguments are all mutually
        // exclusive.
        parser.addExclusiveArgumentSet(bindDN, saslOption, useSASLExternal);
        // Only one option may be used for specifying the bind password.
        parser.addExclusiveArgumentSet(bindPassword, bindPasswordFile, promptForBindPassword);
        // If a bind password was provided, then the a bind DN or SASL option
        // must have also been provided.
        parser.addDependentArgumentSet(bindPassword, bindDN, saslOption);
        parser.addDependentArgumentSet(bindPasswordFile, bindDN, saslOption);
        parser.addDependentArgumentSet(promptForBindPassword, bindDN, saslOption);
    }
    addNonLDAPArguments(parser);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) 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 18 with DNArgument

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

the class InMemoryDirectoryServerTool method addToolArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addToolArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    portArgument = new IntegerArgument('p', "port", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PORT.get(), INFO_MEM_DS_TOOL_ARG_DESC_PORT.get(), 0, 65_535);
    portArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    parser.addArgument(portArgument);
    useSSLArgument = new BooleanArgument('Z', "useSSL", INFO_MEM_DS_TOOL_ARG_DESC_USE_SSL.get());
    useSSLArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    useSSLArgument.addLongIdentifier("use-ssl", true);
    parser.addArgument(useSSLArgument);
    useStartTLSArgument = new BooleanArgument('q', "useStartTLS", INFO_MEM_DS_TOOL_ARG_DESC_USE_START_TLS.get());
    useStartTLSArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    useStartTLSArgument.addLongIdentifier("use-starttls", true);
    useStartTLSArgument.addLongIdentifier("use-start-tls", true);
    parser.addArgument(useStartTLSArgument);
    keyStorePathArgument = new FileArgument('K', "keyStorePath", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_KEY_STORE_PATH.get(), true, true, true, false);
    keyStorePathArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    keyStorePathArgument.addLongIdentifier("key-store-path", true);
    parser.addArgument(keyStorePathArgument);
    keyStorePasswordArgument = new StringArgument('W', "keyStorePassword", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PASSWORD.get(), INFO_MEM_DS_TOOL_ARG_DESC_KEY_STORE_PW.get());
    keyStorePasswordArgument.setSensitive(true);
    keyStorePasswordArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    keyStorePasswordArgument.addLongIdentifier("keyStorePIN", true);
    keyStorePasswordArgument.addLongIdentifier("key-store-password", true);
    keyStorePasswordArgument.addLongIdentifier("key-store-pin", true);
    parser.addArgument(keyStorePasswordArgument);
    keyStoreTypeArgument = new StringArgument(null, "keyStoreType", false, 1, "{type}", INFO_MEM_DS_TOOL_ARG_DESC_KEY_STORE_TYPE.get(), CryptoHelper.KEY_STORE_TYPE_JKS);
    keyStoreTypeArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    keyStoreTypeArgument.addLongIdentifier("keyStoreFormat", true);
    keyStoreTypeArgument.addLongIdentifier("key-store-type", true);
    keyStoreTypeArgument.addLongIdentifier("key-store-format", true);
    parser.addArgument(keyStoreTypeArgument);
    generateSelfSignedCertificateArgument = new BooleanArgument(null, "generateSelfSignedCertificate", 1, INFO_MEM_DS_TOOL_ARG_DESC_SELF_SIGNED_CERT.get());
    generateSelfSignedCertificateArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    generateSelfSignedCertificateArgument.addLongIdentifier("useSelfSignedCertificate", true);
    generateSelfSignedCertificateArgument.addLongIdentifier("selfSignedCertificate", true);
    generateSelfSignedCertificateArgument.addLongIdentifier("generate-self-signed-certificate", true);
    generateSelfSignedCertificateArgument.addLongIdentifier("use-self-signed-certificate", true);
    generateSelfSignedCertificateArgument.addLongIdentifier("self-signed-certificate", true);
    parser.addArgument(generateSelfSignedCertificateArgument);
    trustStorePathArgument = new FileArgument('P', "trustStorePath", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_TRUST_STORE_PATH.get(), true, true, true, false);
    trustStorePathArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    trustStorePathArgument.addLongIdentifier("trust-store-path", true);
    parser.addArgument(trustStorePathArgument);
    trustStorePasswordArgument = new StringArgument('T', "trustStorePassword", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PASSWORD.get(), INFO_MEM_DS_TOOL_ARG_DESC_TRUST_STORE_PW.get());
    trustStorePasswordArgument.setSensitive(true);
    trustStorePasswordArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    trustStorePasswordArgument.addLongIdentifier("trustStorePIN", true);
    trustStorePasswordArgument.addLongIdentifier("trust-store-password", true);
    trustStorePasswordArgument.addLongIdentifier("trust-store-pin", true);
    parser.addArgument(trustStorePasswordArgument);
    trustStoreTypeArgument = new StringArgument(null, "trustStoreType", false, 1, "{type}", INFO_MEM_DS_TOOL_ARG_DESC_TRUST_STORE_TYPE.get(), CryptoHelper.KEY_STORE_TYPE_JKS);
    trustStoreTypeArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    trustStoreTypeArgument.addLongIdentifier("trustStoreFormat", true);
    trustStoreTypeArgument.addLongIdentifier("trust-store-type", true);
    trustStoreTypeArgument.addLongIdentifier("trust-store-format", true);
    parser.addArgument(trustStoreTypeArgument);
    sslClientAuthPolicy = new StringArgument(null, "sslClientAuthPolicy", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_SSL_CLIENT_AUTH_POLICY.get(), INFO_MEM_DS_TOOL_ARG_DESC_SSL_CLIENT_AUTH_POLICY.get(), StaticUtils.setOf(SSL_CLIENT_AUTH_POLICY_PROHIBITED, SSL_CLIENT_AUTH_POLICY_OPTIONAL, SSL_CLIENT_AUTH_POLICY_REQUIRED), SSL_CLIENT_AUTH_POLICY_PROHIBITED);
    sslClientAuthPolicy.addLongIdentifier("ssl-client-auth-policy", true);
    sslClientAuthPolicy.addLongIdentifier("sslClientAuthenticationPolicy", true);
    sslClientAuthPolicy.addLongIdentifier("ssl-client-authentication-policy", true);
    sslClientAuthPolicy.addLongIdentifier("sslClientCertificatePolicy", true);
    sslClientAuthPolicy.addLongIdentifier("ssl-client-certificate-policy", true);
    sslClientAuthPolicy.addLongIdentifier("sslClientCertPolicy", true);
    sslClientAuthPolicy.addLongIdentifier("ssl-client-cert-policy", true);
    sslClientAuthPolicy.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    parser.addArgument(sslClientAuthPolicy);
    maxConcurrentConnectionsArgument = new IntegerArgument(null, "maxConcurrentConnections", false, 1, null, INFO_MEM_DS_TOOL_ARG_DESC_MAX_CONNECTIONS.get(), 1, Integer.MAX_VALUE, Integer.MAX_VALUE);
    maxConcurrentConnectionsArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    maxConcurrentConnectionsArgument.addLongIdentifier("maximumConcurrentConnections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("maxConnections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("maximumConnections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("max-concurrent-connections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("maximum-concurrent-connections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("max-connections", true);
    maxConcurrentConnectionsArgument.addLongIdentifier("maximum-connections", true);
    parser.addArgument(maxConcurrentConnectionsArgument);
    dontStartArgument = new BooleanArgument(null, "dontStart", INFO_MEM_DS_TOOL_ARG_DESC_DONT_START.get());
    dontStartArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_CONNECTIVITY.get());
    dontStartArgument.setHidden(true);
    dontStartArgument.addLongIdentifier("doNotStart", true);
    dontStartArgument.addLongIdentifier("dont-start", true);
    dontStartArgument.addLongIdentifier("do-not-start", true);
    parser.addArgument(dontStartArgument);
    baseDNArgument = new DNArgument('b', "baseDN", true, 0, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_BASE_DN.get(), INFO_MEM_DS_TOOL_ARG_DESC_BASE_DN.get());
    baseDNArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    baseDNArgument.addLongIdentifier("base-dn", true);
    parser.addArgument(baseDNArgument);
    ldifFileArgument = new FileArgument('l', "ldifFile", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_LDIF_FILE.get(), true, true, true, false);
    ldifFileArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    ldifFileArgument.addLongIdentifier("ldif-file", true);
    parser.addArgument(ldifFileArgument);
    additionalBindDNArgument = new DNArgument('D', "additionalBindDN", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_BIND_DN.get(), INFO_MEM_DS_TOOL_ARG_DESC_ADDITIONAL_BIND_DN.get());
    additionalBindDNArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    additionalBindDNArgument.addLongIdentifier("additional-bind-dn", true);
    parser.addArgument(additionalBindDNArgument);
    additionalBindPasswordArgument = new StringArgument('w', "additionalBindPassword", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PASSWORD.get(), INFO_MEM_DS_TOOL_ARG_DESC_ADDITIONAL_BIND_PW.get());
    additionalBindPasswordArgument.setSensitive(true);
    additionalBindPasswordArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    additionalBindPasswordArgument.addLongIdentifier("additional-bind-password", true);
    parser.addArgument(additionalBindPasswordArgument);
    useDefaultSchemaArgument = new BooleanArgument('s', "useDefaultSchema", INFO_MEM_DS_TOOL_ARG_DESC_USE_DEFAULT_SCHEMA.get());
    useDefaultSchemaArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    useDefaultSchemaArgument.addLongIdentifier("use-default-schema", true);
    parser.addArgument(useDefaultSchemaArgument);
    useSchemaFileArgument = new FileArgument('S', "useSchemaFile", false, 0, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_USE_SCHEMA_FILE.get(), true, true, false, false);
    useSchemaFileArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    useSchemaFileArgument.addLongIdentifier("use-schema-file", true);
    parser.addArgument(useSchemaFileArgument);
    doNotValidateSchemaDefinitionsArgument = new BooleanArgument(null, "doNotValidateSchemaDefinitions", 1, INFO_MEM_DS_TOOL_ARG_DESC_DO_NOT_VALIDATE_SCHEMA.get(useSchemaFileArgument.getIdentifierString()));
    doNotValidateSchemaDefinitionsArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    doNotValidateSchemaDefinitionsArgument.addLongIdentifier("do-not-validate-schema-definitions", true);
    parser.addArgument(doNotValidateSchemaDefinitionsArgument);
    doNotGenerateOperationalAttributesArgument = new BooleanArgument(null, "doNotGenerateOperationalAttributes", 1, INFO_MEM_DS_TOOL_ARG_DESC_DO_NOT_GENERATE_OP_ATTRS.get());
    doNotGenerateOperationalAttributesArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    doNotGenerateOperationalAttributesArgument.addLongIdentifier("do-not-generate-operational-attributes");
    parser.addArgument(doNotGenerateOperationalAttributesArgument);
    equalityIndexArgument = new StringArgument('I', "equalityIndex", false, 0, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_ATTR.get(), INFO_MEM_DS_TOOL_ARG_DESC_EQ_INDEX.get());
    equalityIndexArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    equalityIndexArgument.addLongIdentifier("equality-index", true);
    parser.addArgument(equalityIndexArgument);
    maxChangeLogEntriesArgument = new IntegerArgument('c', "maxChangeLogEntries", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_COUNT.get(), INFO_MEM_DS_TOOL_ARG_DESC_MAX_CHANGELOG_ENTRIES.get(), 0, Integer.MAX_VALUE, 0);
    maxChangeLogEntriesArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    maxChangeLogEntriesArgument.addLongIdentifier("max-changelog-entries", true);
    maxChangeLogEntriesArgument.addLongIdentifier("max-change-log-entries", true);
    parser.addArgument(maxChangeLogEntriesArgument);
    sizeLimitArgument = new IntegerArgument(null, "sizeLimit", false, 1, null, INFO_MEM_DS_TOOL_ARG_DESC_SIZE_LIMIT.get(), 1, Integer.MAX_VALUE, Integer.MAX_VALUE);
    sizeLimitArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    sizeLimitArgument.addLongIdentifier("searchSizeLimit", true);
    sizeLimitArgument.addLongIdentifier("size-limit", true);
    sizeLimitArgument.addLongIdentifier("search-size-limit", true);
    parser.addArgument(sizeLimitArgument);
    passwordAttributeArgument = new StringArgument(null, "passwordAttribute", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_ATTR.get(), INFO_MEM_DS_TOOL_ARG_DESC_PASSWORD_ATTRIBUTE.get(), "userPassword");
    passwordAttributeArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    passwordAttributeArgument.addLongIdentifier("passwordAttributeType", true);
    passwordAttributeArgument.addLongIdentifier("password-attribute", true);
    passwordAttributeArgument.addLongIdentifier("password-attribute-type", true);
    parser.addArgument(passwordAttributeArgument);
    final Set<String> allowedSchemes = StaticUtils.setOf("md5", "smd5", "sha", "ssha", "sha256", "ssha256", "sha384", "ssha384", "sha512", "ssha512", "clear", "base64", "hex");
    defaultPasswordEncodingArgument = new StringArgument(null, "defaultPasswordEncoding", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_SCHEME.get(), INFO_MEM_DS_TOOL_ARG_DESC_DEFAULT_PASSWORD_ENCODING.get(), allowedSchemes);
    defaultPasswordEncodingArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    defaultPasswordEncodingArgument.addLongIdentifier("defaultPasswordEncodingScheme", true);
    defaultPasswordEncodingArgument.addLongIdentifier("defaultPasswordStorageScheme", true);
    defaultPasswordEncodingArgument.addLongIdentifier("defaultPasswordScheme", true);
    defaultPasswordEncodingArgument.addLongIdentifier("default-password-encoding", true);
    defaultPasswordEncodingArgument.addLongIdentifier("default-password-encoding-scheme", true);
    defaultPasswordEncodingArgument.addLongIdentifier("default-password-storage-scheme", true);
    defaultPasswordEncodingArgument.addLongIdentifier("default-password-scheme", true);
    parser.addArgument(defaultPasswordEncodingArgument);
    final Set<String> allowedOperationTypeAllowedValues = StaticUtils.setOf("add", "bind", "compare", "delete", "extended", "modify", "modify-dn", "search");
    allowedOperationTypeArgument = new StringArgument(null, "allowedOperationType", false, 0, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_TYPE.get(), INFO_MEM_DS_TOOL_ARG_DESC_ALLOWED_OP_TYPE.get(), allowedOperationTypeAllowedValues);
    allowedOperationTypeArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    allowedOperationTypeArgument.addLongIdentifier("allowed-operation-type", true);
    parser.addArgument(allowedOperationTypeArgument);
    final Set<String> authRequiredTypeAllowedValues = StaticUtils.setOf("add", "compare", "delete", "extended", "modify", "modify-dn", "search");
    authenticationRequiredOperationTypeArgument = new StringArgument(null, "authenticationRequiredOperationType", false, 0, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_TYPE.get(), INFO_MEM_DS_TOOL_ARG_DESC_AUTH_REQUIRED_OP_TYPE.get(), authRequiredTypeAllowedValues);
    authenticationRequiredOperationTypeArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    authenticationRequiredOperationTypeArgument.addLongIdentifier("requiredAuthenticationOperationType", true);
    authenticationRequiredOperationTypeArgument.addLongIdentifier("requireAuthenticationOperationType", true);
    authenticationRequiredOperationTypeArgument.addLongIdentifier("authentication-required-operation-type", true);
    authenticationRequiredOperationTypeArgument.addLongIdentifier("required-authentication-operation-type", true);
    authenticationRequiredOperationTypeArgument.addLongIdentifier("require-authentication-operation-type", true);
    parser.addArgument(authenticationRequiredOperationTypeArgument);
    vendorNameArgument = new StringArgument(null, "vendorName", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_VALUE.get(), INFO_MEM_DS_TOOL_ARG_DESC_VENDOR_NAME.get());
    vendorNameArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    vendorNameArgument.addLongIdentifier("vendor-name", true);
    parser.addArgument(vendorNameArgument);
    vendorVersionArgument = new StringArgument(null, "vendorVersion", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_VALUE.get(), INFO_MEM_DS_TOOL_ARG_DESC_VENDOR_VERSION.get());
    vendorVersionArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_DATA.get());
    vendorVersionArgument.addLongIdentifier("vendor-version", true);
    parser.addArgument(vendorVersionArgument);
    accessLogToStandardOutArgument = new BooleanArgument('A', "accessLogToStandardOut", INFO_MEM_DS_TOOL_ARG_DESC_ACCESS_LOG_TO_STDOUT.get());
    accessLogToStandardOutArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    accessLogToStandardOutArgument.addLongIdentifier("access-log-to-standard-out", true);
    parser.addArgument(accessLogToStandardOutArgument);
    accessLogFileArgument = new FileArgument('a', "accessLogFile", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_ACCESS_LOG_FILE.get(), false, true, true, false);
    accessLogFileArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    accessLogFileArgument.addLongIdentifier("access-log-format", true);
    parser.addArgument(accessLogFileArgument);
    jsonAccessLogToStandardOutArgument = new BooleanArgument(null, "jsonAccessLogToStandardOut", INFO_MEM_DS_TOOL_ARG_DESC_JSON_ACCESS_LOG_TO_STDOUT.get());
    jsonAccessLogToStandardOutArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    jsonAccessLogToStandardOutArgument.addLongIdentifier("json-access-log-to-standard-out", true);
    parser.addArgument(jsonAccessLogToStandardOutArgument);
    jsonAccessLogFileArgument = new FileArgument(null, "jsonAccessLogFile", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_JSON_ACCESS_LOG_FILE.get(), false, true, true, false);
    jsonAccessLogFileArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    jsonAccessLogFileArgument.addLongIdentifier("json-access-log-format", true);
    parser.addArgument(jsonAccessLogFileArgument);
    ldapDebugLogToStandardOutArgument = new BooleanArgument(null, "ldapDebugLogToStandardOut", INFO_MEM_DS_TOOL_ARG_DESC_LDAP_DEBUG_LOG_TO_STDOUT.get());
    ldapDebugLogToStandardOutArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    ldapDebugLogToStandardOutArgument.addLongIdentifier("ldap-debug-log-to-standard-out", true);
    parser.addArgument(ldapDebugLogToStandardOutArgument);
    ldapDebugLogFileArgument = new FileArgument('d', "ldapDebugLogFile", false, 1, INFO_MEM_DS_TOOL_ARG_PLACEHOLDER_PATH.get(), INFO_MEM_DS_TOOL_ARG_DESC_LDAP_DEBUG_LOG_FILE.get(), false, true, true, false);
    ldapDebugLogFileArgument.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    ldapDebugLogFileArgument.addLongIdentifier("ldap-debug-log-file", true);
    parser.addArgument(ldapDebugLogFileArgument);
    codeLogFile = new FileArgument('C', "codeLogFile", false, 1, "{path}", INFO_MEM_DS_TOOL_ARG_DESC_CODE_LOG_FILE.get(), false, true, true, false);
    codeLogFile.setArgumentGroupName(INFO_MEM_DS_TOOL_GROUP_LOGGING.get());
    codeLogFile.addLongIdentifier("code-log-file", true);
    parser.addArgument(codeLogFile);
    parser.addExclusiveArgumentSet(useDefaultSchemaArgument, useSchemaFileArgument);
    parser.addDependentArgumentSet(doNotValidateSchemaDefinitionsArgument, useSchemaFileArgument);
    parser.addExclusiveArgumentSet(useSSLArgument, useStartTLSArgument);
    parser.addExclusiveArgumentSet(keyStorePathArgument, generateSelfSignedCertificateArgument);
    parser.addExclusiveArgumentSet(accessLogToStandardOutArgument, accessLogFileArgument);
    parser.addExclusiveArgumentSet(jsonAccessLogToStandardOutArgument, jsonAccessLogFileArgument);
    parser.addExclusiveArgumentSet(ldapDebugLogToStandardOutArgument, ldapDebugLogFileArgument);
    parser.addDependentArgumentSet(additionalBindDNArgument, additionalBindPasswordArgument);
    parser.addDependentArgumentSet(additionalBindPasswordArgument, additionalBindDNArgument);
    parser.addDependentArgumentSet(useSSLArgument, keyStorePathArgument, generateSelfSignedCertificateArgument);
    parser.addDependentArgumentSet(keyStorePathArgument, keyStorePasswordArgument);
    parser.addDependentArgumentSet(keyStorePasswordArgument, keyStorePathArgument);
    parser.addDependentArgumentSet(keyStoreTypeArgument, keyStorePathArgument);
    parser.addDependentArgumentSet(useStartTLSArgument, keyStorePathArgument, generateSelfSignedCertificateArgument);
    parser.addDependentArgumentSet(keyStorePathArgument, useSSLArgument, useStartTLSArgument);
    parser.addDependentArgumentSet(generateSelfSignedCertificateArgument, useSSLArgument, useStartTLSArgument);
    parser.addDependentArgumentSet(trustStorePathArgument, useSSLArgument, useStartTLSArgument);
    parser.addDependentArgumentSet(trustStorePasswordArgument, trustStorePathArgument);
    parser.addDependentArgumentSet(trustStoreTypeArgument, trustStorePathArgument);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) 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 19 with DNArgument

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

the class IdentifyReferencesToMissingEntries method addNonLDAPArguments.

/**
 * Adds the arguments needed by this command-line tool to the provided
 * argument parser which are not related to connecting or authenticating to
 * the directory server.
 *
 * @param  parser  The argument parser to which the arguments should be added.
 *
 * @throws  ArgumentException  If a problem occurs while adding the arguments.
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    String description = "The search base DN(s) to use to find entries with " + "references to other entries.  At least one base DN must be " + "specified.";
    baseDNArgument = new DNArgument('b', "baseDN", true, 0, "{dn}", description);
    baseDNArgument.addLongIdentifier("base-dn", true);
    parser.addArgument(baseDNArgument);
    description = "The attribute(s) for which to find missing references.  " + "At least one attribute must be specified, and each attribute " + "must be indexed for equality searches and have values which are DNs.";
    attributeArgument = new StringArgument('A', "attribute", true, 0, "{attr}", description);
    parser.addArgument(attributeArgument);
    description = "The maximum number of entries to retrieve at a time when " + "attempting to find entries with references to other entries.  This " + "requires that the authenticated user have permission to use the " + "simple paged results control, but it can avoid problems with the " + "server sending entries too quickly for the client to handle.  By " + "default, the simple paged results control will not be used.";
    pageSizeArgument = new IntegerArgument('z', "simplePageSize", false, 1, "{num}", description, 1, Integer.MAX_VALUE);
    pageSizeArgument.addLongIdentifier("simple-page-size", true);
    parser.addArgument(pageSizeArgument);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) StringArgument(com.unboundid.util.args.StringArgument)

Example 20 with DNArgument

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

the class IdentifyUniqueAttributeConflicts method addNonLDAPArguments.

/**
 * Adds the arguments needed by this command-line tool to the provided
 * argument parser which are not related to connecting or authenticating to
 * the directory server.
 *
 * @param  parser  The argument parser to which the arguments should be added.
 *
 * @throws ArgumentException  If a problem occurs while adding the arguments.
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    String description = "The search base DN(s) to use to find entries with " + "attributes for which to find uniqueness conflicts.  At least one " + "base DN must be specified.";
    baseDNArgument = new DNArgument('b', "baseDN", true, 0, "{dn}", description);
    baseDNArgument.addLongIdentifier("base-dn", true);
    parser.addArgument(baseDNArgument);
    description = "A filter that will be used to identify the set of " + "entries in which to identify uniqueness conflicts.  If this is not " + "specified, then all entries containing the target attribute(s) " + "will be examined.";
    filterArgument = new FilterArgument('f', "filter", false, 1, "{filter}", description);
    parser.addArgument(filterArgument);
    description = "The attributes for which to find uniqueness conflicts.  " + "At least one attribute must be specified, and each attribute " + "must be indexed for equality searches.";
    attributeArgument = new StringArgument('A', "attribute", true, 0, "{attr}", description);
    parser.addArgument(attributeArgument);
    description = "Indicates the behavior to exhibit if multiple unique " + "attributes are provided.  Allowed values are '" + BEHAVIOR_UNIQUE_WITHIN_ATTR + "' (indicates that each value only " + "needs to be unique within its own attribute type), '" + BEHAVIOR_UNIQUE_ACROSS_ATTRS_INCLUDING_SAME + "' (indicates that " + "each value needs to be unique across all of the specified " + "attributes), '" + BEHAVIOR_UNIQUE_ACROSS_ATTRS_EXCEPT_SAME + "' (indicates each value needs to be unique across all of the " + "specified attributes, except that multiple attributes in the same " + "entry are allowed to share the same value), and '" + BEHAVIOR_UNIQUE_IN_COMBINATION + "' (indicates that every " + "combination of the values of the specified attributes must be " + "unique across each entry).";
    final Set<String> allowedValues = StaticUtils.setOf(BEHAVIOR_UNIQUE_WITHIN_ATTR, BEHAVIOR_UNIQUE_ACROSS_ATTRS_INCLUDING_SAME, BEHAVIOR_UNIQUE_ACROSS_ATTRS_EXCEPT_SAME, BEHAVIOR_UNIQUE_IN_COMBINATION);
    multipleAttributeBehaviorArgument = new StringArgument('m', "multipleAttributeBehavior", false, 1, "{behavior}", description, allowedValues, BEHAVIOR_UNIQUE_WITHIN_ATTR);
    multipleAttributeBehaviorArgument.addLongIdentifier("multiple-attribute-behavior", true);
    parser.addArgument(multipleAttributeBehaviorArgument);
    description = "The maximum number of entries to retrieve at a time when " + "attempting to find uniqueness conflicts.  This requires that the " + "authenticated user have permission to use the simple paged results " + "control, but it can avoid problems with the server sending entries " + "too quickly for the client to handle.  By default, the simple " + "paged results control will not be used.";
    pageSizeArgument = new IntegerArgument('z', "simplePageSize", false, 1, "{num}", description, 1, Integer.MAX_VALUE);
    pageSizeArgument.addLongIdentifier("simple-page-size", true);
    parser.addArgument(pageSizeArgument);
    description = "The time limit in seconds that will be used for search " + "requests attempting to identify conflicts for each value of any of " + "the unique attributes.  This time limit is used to avoid sending " + "expensive unindexed search requests that can consume significant " + "server resources.  If any of these search operations fails in a " + "way that indicates the requested time limit was exceeded, the " + "tool will abort its processing.  A value of zero indicates that no " + "time limit will be enforced.  If this argument is not provided, a " + "default time limit of " + DEFAULT_TIME_LIMIT_SECONDS + " will be used.";
    timeLimitArgument = new IntegerArgument('l', "timeLimitSeconds", false, 1, "{num}", description, 0, Integer.MAX_VALUE, DEFAULT_TIME_LIMIT_SECONDS);
    timeLimitArgument.addLongIdentifier("timeLimit", true);
    timeLimitArgument.addLongIdentifier("time-limit-seconds", true);
    timeLimitArgument.addLongIdentifier("time-limit", true);
    parser.addArgument(timeLimitArgument);
}
Also used : DNArgument(com.unboundid.util.args.DNArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) StringArgument(com.unboundid.util.args.StringArgument)

Aggregations

DNArgument (com.unboundid.util.args.DNArgument)31 StringArgument (com.unboundid.util.args.StringArgument)28 BooleanArgument (com.unboundid.util.args.BooleanArgument)25 FileArgument (com.unboundid.util.args.FileArgument)24 IntegerArgument (com.unboundid.util.args.IntegerArgument)23 FilterArgument (com.unboundid.util.args.FilterArgument)11 ControlArgument (com.unboundid.util.args.ControlArgument)8 ScopeArgument (com.unboundid.util.args.ScopeArgument)6 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)5 DN (com.unboundid.ldap.sdk.DN)5 LDAPException (com.unboundid.ldap.sdk.LDAPException)5 BooleanValueArgument (com.unboundid.util.args.BooleanValueArgument)5 DurationArgument (com.unboundid.util.args.DurationArgument)5 ArgumentException (com.unboundid.util.args.ArgumentException)4 ArgumentParser (com.unboundid.util.args.ArgumentParser)4 TimestampArgument (com.unboundid.util.args.TimestampArgument)4 NotNull (com.unboundid.util.NotNull)3 SubCommand (com.unboundid.util.args.SubCommand)3 File (java.io.File)3 ASN1BitString (com.unboundid.asn1.ASN1BitString)2