public class LDAPConnectionArgumentParser extends com.forgerock.opendj.cli.ArgumentParser
| Constructor and Description |
|---|
LDAPConnectionArgumentParser(String mainClassName,
LocalizableMessage toolDescription,
boolean longArgumentsCaseSensitive,
com.forgerock.opendj.cli.ArgumentGroup argumentGroup,
boolean alwaysSSL)
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.
|
LDAPConnection |
connect(String host,
int port,
String bindDN,
String bindPw,
LDAPConnectionOptions options,
int timeout,
PrintStream out,
PrintStream err)
Creates a connection from information provided.
|
LDAPConnection |
connect(String host,
int port,
String bindDN,
String bindPw,
LDAPConnectionOptions options,
PrintStream out,
PrintStream err)
Creates a connection from information provided.
|
boolean |
connectionArgumentsPresent()
Indicates whether or not the user has indicated that they would like to
perform a remote operation based on the arguments.
|
SecureConnectionCliArgs |
getArguments()
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, addLdapConnectionArgument, displayMessageAndUsageReference, getArgumentForLongID, getArgumentList, getBindPassword, getDocSubcommandsDescriptionSupplement, getDocToolDescriptionSupplement, getHelpUsageReference, getOptionsRefSect1, getShortToolDescription, getTrailingArguments, getUsage, getUsageMessage, isUsageArgumentPresent, isVersionArgumentPresent, parseArguments, parseArguments, parseArguments, setDocSubcommandsDescriptionSupplement, setDocToolDescriptionSupplement, setFilePropertiesArgument, setNoPropertiesFileArgument, setShortToolDescription, setUsageArgument, setUsageArgument, setUsageOrVersionDisplayed, setVersionHandler, usageOrVersionDisplayedpublic LDAPConnectionArgumentParser(String mainClassName, LocalizableMessage toolDescription, boolean longArgumentsCaseSensitive, com.forgerock.opendj.cli.ArgumentGroup argumentGroup, boolean alwaysSSL)
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.longArgumentsCaseSensitive - Indicates whether long arguments shouldargumentGroup - Group to which LDAP arguments will be added to the parser. May be
null to indicate that arguments should be added to the default
groupalwaysSSL - If true, always use the SSL connection type. In this case, the
arguments useSSL and startTLS are not present.public boolean connectionArgumentsPresent()
public 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, com.forgerock.opendj.cli.ArgumentException
ui - user interaction for prompting the userout - stream to write messageserr - stream to write error messagesLDAPConnectionException - if there was a problem connecting to the servercom.forgerock.opendj.cli.ArgumentException - if there was a problem indicated by the input argumentspublic LDAPConnection connect(String host, int port, String bindDN, String bindPw, LDAPConnectionOptions options, PrintStream out, PrintStream err) throws LDAPConnectionException
host - of the serverport - of the serverbindDN - with which to connectbindPw - with which to connectoptions - with which to connectout - stream to write messageserr - stream to write error messagesLDAPConnectionException - if there was a problem connecting to the server indicated by the
input argumentspublic LDAPConnection connect(String host, int port, String bindDN, String bindPw, LDAPConnectionOptions options, int timeout, PrintStream out, PrintStream err) throws LDAPConnectionException
host - of the serverport - of the serverbindDN - with which to connectbindPw - with which to connectoptions - with which to connecttimeout - the timeout to establish the connection in milliseconds. Use
0 to express no timeoutout - stream to write messageserr - stream to write error messagesLDAPConnectionException - if there was a problem connecting to the server indicated by the
input argumentspublic SecureConnectionCliArgs getArguments()
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-2015 ForgeRock AS. All Rights Reserved.