public class LDAPConnectionArgumentParser
extends com.forgerock.opendj.cli.ArgumentParser
Constructor and Description |
---|
LDAPConnectionArgumentParser(String mainClassName,
LocalizableMessage toolDescription,
com.forgerock.opendj.cli.ArgumentGroup argumentGroup)
Creates a new instance of this argument parser with no arguments.
|
Modifier and Type | Method and Description |
---|---|
LDAPConnection |
connect(LDAPConnectionConsoleInteraction ui,
PrintStream out,
PrintStream err)
Creates a connection using a console interaction that will be used to potentially interact with the user to
prompt for necessary information for establishing the connection.
|
LDAPConnection |
connect(PrintStream out,
PrintStream err)
Creates a new LDAPConnection and invokes a connect operation using information provided in the parsed set of
arguments that were provided by the user.
|
SecureConnectionCliArgs |
getLdapConnectionArguments()
Gets the arguments associated with this parser.
|
static String |
getPasswordValue(com.forgerock.opendj.cli.StringArgument bindPwdArg,
com.forgerock.opendj.cli.FileBasedArgument bindPwdFileArg,
com.forgerock.opendj.cli.StringArgument bindDnArg,
PrintStream out,
PrintStream err)
Commodity method that retrieves the password value analyzing the contents of a string argument and of a file
based argument.
|
static String |
getPasswordValue(com.forgerock.opendj.cli.StringArgument bindPassword,
com.forgerock.opendj.cli.FileBasedArgument bindPasswordFile,
String bindDNValue,
PrintStream out,
PrintStream err)
Commodity method that retrieves the password value analyzing the contents of a string argument and of a file
based argument.
|
addArgument, addArgument, addDefaultArgument, builder, getArgumentForLongId, getArguments, getBindPassword, getDocSubcommandsDescriptionSupplement, getDocToolDescriptionSupplement, getScriptNameOrJava, getShortToolDescription, getTrailingArguments, parseArguments, setDocSubcommandsDescriptionSupplement, setDocToolDescriptionSupplement, setShortToolDescription, setUsageArgument, setVersionHandler, usageOrVersionDisplayed
public LDAPConnectionArgumentParser(String mainClassName, LocalizableMessage toolDescription, com.forgerock.opendj.cli.ArgumentGroup argumentGroup)
mainClassName
- The fully-qualified name of the Java class that should be invoked to launch the program with which
this argument parser is associated.toolDescription
- A human-readable description for the tool, which will be included when displaying usage information.argumentGroup
- Group to which LDAP arguments will be added to the parser. May be null to indicate that arguments
should be added to the default grouppublic LDAPConnection connect(PrintStream out, PrintStream err) throws LDAPConnectionException, com.forgerock.opendj.cli.ArgumentException
out
- stream to write messageserr
- stream to write error messagesLDAPConnectionException
- if there was a problem connecting to the server indicated by the input argumentscom.forgerock.opendj.cli.ArgumentException
- if there was a problem processing the input argumentspublic LDAPConnection connect(LDAPConnectionConsoleInteraction ui, PrintStream out, PrintStream err) throws LDAPConnectionException, SSLConnectionException, com.forgerock.opendj.cli.ArgumentException
ui
- user interaction for prompting the userout
- stream to write messageserr
- stream to write error messagesSSLConnectionException
- if there was a problem connecting with SSL to the serverLDAPConnectionException
- if there was any other problem connecting to the servercom.forgerock.opendj.cli.ArgumentException
- if there was a problem indicated by the input argumentspublic SecureConnectionCliArgs getLdapConnectionArguments()
public static String getPasswordValue(com.forgerock.opendj.cli.StringArgument bindPwdArg, com.forgerock.opendj.cli.FileBasedArgument bindPwdFileArg, com.forgerock.opendj.cli.StringArgument bindDnArg, PrintStream out, PrintStream err)
bindPwdArg
- the string argument for the password.bindPwdFileArg
- the file based argument for the password.bindDnArg
- the string argument for the bindDN.out
- stream to write message.err
- stream to write error message.public static String getPasswordValue(com.forgerock.opendj.cli.StringArgument bindPassword, com.forgerock.opendj.cli.FileBasedArgument bindPasswordFile, String bindDNValue, PrintStream out, PrintStream err) throws com.forgerock.opendj.cli.ClientException
bindPassword
- the string argument for the password.bindPasswordFile
- the file based argument for the password.bindDNValue
- the string value for the bindDN.out
- stream to write message.err
- stream to write error message.com.forgerock.opendj.cli.ClientException
- if the password cannot be readCopyright © 2010–2017 ForgeRock AS. All rights reserved.