|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.util.args.ArgumentParser
org.opends.server.util.args.LDAPConnectionArgumentParser
public class LDAPConnectionArgumentParser
Creates an argument parser pre-populated with arguments for specifying information for openning and LDAPConnection an LDAP connection.
Field Summary |
---|
Fields inherited from class org.opends.server.util.args.ArgumentParser |
---|
argumentGroups, defaultArgGroup, generalArgGroup, ioArgGroup, ldapArgGroup |
Constructor Summary | |
---|---|
LDAPConnectionArgumentParser(java.lang.String mainClassName,
Message toolDescription,
boolean longArgumentsCaseSensitive,
ArgumentGroup argumentGroup)
Creates a new instance of this argument parser with no arguments. |
|
LDAPConnectionArgumentParser(java.lang.String mainClassName,
Message toolDescription,
boolean longArgumentsCaseSensitive,
boolean allowsTrailingArguments,
int minTrailingArguments,
int maxTrailingArguments,
java.lang.String trailingArgsDisplayName,
ArgumentGroup argumentGroup)
Creates a new instance of this argument parser with no arguments that may or may not be allowed to have unnamed trailing arguments. |
Method Summary | |
---|---|
LDAPConnection |
connect(LDAPConnectionConsoleInteraction ui,
java.io.PrintStream out,
java.io.PrintStream err)
Creates a connection using a console interaction that will be used to potientially interact with the user to prompt for necessary information for establishing the connection. |
LDAPConnection |
connect(java.io.PrintStream out,
java.io.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(java.lang.String host,
int port,
java.lang.String bindDN,
java.lang.String bindPw,
LDAPConnectionOptions options,
java.io.PrintStream out,
java.io.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 java.lang.String |
getPasswordValue(StringArgument bindPwdArg,
FileBasedArgument bindPwdFileArg)
Commodity method that retrieves the password value analyzing the contents of a string argument and of a file based argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LDAPConnectionArgumentParser(java.lang.String mainClassName, Message toolDescription, boolean longArgumentsCaseSensitive, 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.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 grouppublic LDAPConnectionArgumentParser(java.lang.String mainClassName, Message toolDescription, boolean longArgumentsCaseSensitive, boolean allowsTrailingArguments, int minTrailingArguments, int maxTrailingArguments, java.lang.String trailingArgsDisplayName, 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.longArgumentsCaseSensitive
- Indicates whether long arguments should
be treated in a case-sensitive manner.allowsTrailingArguments
- Indicates whether this parser allows
unnamed trailing arguments to be
provided.minTrailingArguments
- The minimum number of unnamed trailing
arguments that must be provided. A
value less than or equal to zero
indicates that no minimum will be
enforced.maxTrailingArguments
- The maximum number of unnamed trailing
arguments that may be provided. A
value less than or equal to zero
indicates that no maximum will be
enforced.trailingArgsDisplayName
- The display name that should be used
as a placeholder for unnamed trailing
arguments in the generated 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 groupMethod Detail |
---|
public boolean connectionArgumentsPresent()
public LDAPConnection connect(java.io.PrintStream out, java.io.PrintStream err) throws LDAPConnectionException, ArgumentException
out
- stream to write messageserr
- stream to write messages
LDAPConnectionException
- if there was a problem connecting
to the server indicated by the input arguments
ArgumentException
- if there was a problem processing the input
argumentspublic LDAPConnection connect(LDAPConnectionConsoleInteraction ui, java.io.PrintStream out, java.io.PrintStream err) throws LDAPConnectionException
ui
- user interaction for prompting the userout
- stream to write messageserr
- stream to write messages
LDAPConnectionException
- if there was a problem connecting
to the server indicated by the input argumentspublic LDAPConnection connect(java.lang.String host, int port, java.lang.String bindDN, java.lang.String bindPw, LDAPConnectionOptions options, java.io.PrintStream out, java.io.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 messages
LDAPConnectionException
- if there was a problem connecting
to the server indicated by the input argumentspublic SecureConnectionCliArgs getArguments()
public static java.lang.String getPasswordValue(StringArgument bindPwdArg, FileBasedArgument bindPwdFileArg)
bindPwdArg
- the string argument.bindPwdFileArg
- the file based argument.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |