Package org.opends.server.tools
Class InstallDSArgumentParser
- java.lang.Object
-
- com.forgerock.opendj.cli.ArgumentParser
-
- org.opends.server.tools.InstallDSArgumentParser
-
- All Implemented Interfaces:
ToolRefDocContainer
public class InstallDSArgumentParser extends ArgumentParser
Class used to parse the arguments of the setup command-line and to check that there are not conflicting arguments (nor missing arguments in no prompt mode). Note that this class does not perform checks involving network (like if a given port is free) nor the validity of the certificate information provided.
-
-
Field Summary
-
Fields inherited from class com.forgerock.opendj.cli.ArgumentParser
argumentGroups, DEFAULT_OPENDJ_CONFIG_DIR, DEFAULT_OPENDJ_PROPERTIES_FILE_EXTENSION, DEFAULT_OPENDJ_PROPERTIES_FILE_NAME, ioArgGroup, PROPERTY_SCRIPT_NAME, PROPERTY_SCRIPT_NAME_LEGACY
-
-
Constructor Summary
Constructors Constructor Description InstallDSArgumentParser(String mainClassName)The default constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetConnectTimeout()Returns the timeout to be used to connect in milliseconds.StringgetDirectoryManagerPassword()Returns the directory manager password provided by the user.StringgetKeyStorePassword()Returns the key store password provided by the user.voidinitializeArguments()Initializes the arguments without parsing them.booleanisCli()Returns whether the command was launched in CLI mode or not.voidparseArguments(String[] args)Parses the provided set of arguments and updates the information associated with this parser accordingly.-
Methods inherited from class com.forgerock.opendj.cli.ArgumentParser
addArgument, addArgument, addDefaultArgument, addLdapConnectionArgument, displayMessageAndUsageReference, getArgumentForLongID, getArgumentList, getBindPassword, getDocSubcommandsDescriptionSupplement, getDocToolDescriptionSupplement, getHelpUsageReference, getOptionsRefSect1, getShortToolDescription, getTrailingArguments, getUsage, isUsageArgumentPresent, isVersionArgumentPresent, parseArguments, parseArguments, replaceArgument, setDocSubcommandsDescriptionSupplement, setDocToolDescriptionSupplement, setFilePropertiesArgument, setNoPropertiesFileArgument, setShortToolDescription, setUsageArgument, setUsageArgument, setUsageOrVersionDisplayed, setVersionHandler, usageOrVersionDisplayed
-
-
-
-
Constructor Detail
-
InstallDSArgumentParser
public InstallDSArgumentParser(String mainClassName)
The default constructor for this class.- Parameters:
mainClassName- the class name of the main class for the command-line that is being used.
-
-
Method Detail
-
initializeArguments
public void initializeArguments() throws ArgumentExceptionInitializes the arguments without parsing them.- Throws:
ArgumentException- if there was an error creating or adding the arguments. If this occurs is likely to be a bug.
-
isCli
public boolean isCli()
Returns whether the command was launched in CLI mode or not.- Returns:
trueif the command was launched to use CLI mode andfalseotherwise.
-
parseArguments
public void parseArguments(String[] args) throws ArgumentException
Description copied from class:ArgumentParserParses the provided set of arguments and updates the information associated with this parser accordingly.- Overrides:
parseArgumentsin classArgumentParser- Parameters:
args- The raw set of arguments to parse.- Throws:
ArgumentException- If a problem was encountered while parsing the provided arguments.
-
getDirectoryManagerPassword
public String getDirectoryManagerPassword()
Returns the directory manager password provided by the user. This method should be called after a call to parseArguments.- Returns:
- the directory manager password provided by the user.
-
getKeyStorePassword
public String getKeyStorePassword()
Returns the key store password provided by the user. This method should be called after a call to parseArguments.- Returns:
- the key store password provided by the user.
-
getConnectTimeout
public int getConnectTimeout() throws IllegalStateExceptionReturns the timeout to be used to connect in milliseconds. The method must be called after parsing the arguments.- Returns:
- the timeout to be used to connect in milliseconds. Returns
0if there is no timeout. - Throws:
IllegalStateException- if the method is called before parsing the arguments.
-
-