Package org.opends.guitools.controlpanel
Class ControlPanelArgumentParser
- java.lang.Object
-
- com.forgerock.opendj.cli.ArgumentParser
-
- org.opends.guitools.controlpanel.ControlPanelArgumentParser
-
- All Implemented Interfaces:
ToolRefDocContainer
public class ControlPanelArgumentParser extends ArgumentParser
Class used to parse the arguments of the control panel command-line.
-
-
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 ControlPanelArgumentParser(String mainClassName, org.forgerock.i18n.LocalizableMessage msg)The default constructor for this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBindPassword()Get the password which has to be used for the command without prompting the user.intgetConnectTimeout()Returns the timeout to be used to connect in milliseconds.static intgetDefaultAdministrationPort()Returns the default value for the administration port.static StringgetDefaultBindDN()Returns the default bind DN.StringgetExplicitBindDn()Returns the bind DN explicitly provided in the command-line.StringgetExplicitHostName()Returns the host name explicitly provided in the command-line.intgetExplicitPort()Returns the administration port explicitly provided in the command-line.voidinitializeArguments()Initializes the arguments without parsing them.booleanisRemote()Returns whether the user specified to connect to a remote server.booleanisTrustAll()Returns whether the user specified to trust all certificates 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
-
ControlPanelArgumentParser
public ControlPanelArgumentParser(String mainClassName, org.forgerock.i18n.LocalizableMessage msg)
The default constructor for this class.- Parameters:
mainClassName- the class name of the main class for the command-line that is being used.msg- the usage message.
-
-
Method Detail
-
getDefaultAdministrationPort
public static int getDefaultAdministrationPort()
Returns the default value for the administration port.- Returns:
- the default value for the administration port.
-
getDefaultBindDN
public static String getDefaultBindDN()
Returns the default bind DN.- Returns:
- the default bind DN.
-
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.
-
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.
-
getExplicitHostName
public String getExplicitHostName()
Returns the host name explicitly provided in the command-line.- Returns:
- the host name bind DN explicitly provided in the command-line.
Returns
nullif no bind DN was explicitly provided.
-
getExplicitPort
public int getExplicitPort()
Returns the administration port explicitly provided in the command-line.- Returns:
- the administration port explicitly provided in the command-line. Returns -1 if no port was explicitly provided.
-
getExplicitBindDn
public String getExplicitBindDn()
Returns the bind DN explicitly provided in the command-line.- Returns:
- the bind DN explicitly provided in the command-line.
Returns
nullif no bind DN was explicitly provided.
-
getBindPassword
public String getBindPassword()
Get the password which has to be used for the command without prompting the user. If no password was specified, returnnull.- Returns:
- The password stored into the specified file on by the
command line argument, or
nullif not specified.
-
isTrustAll
public boolean isTrustAll()
Returns whether the user specified to trust all certificates or not.- Returns:
- whether the user specified to trust all certificates or not.
-
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.
-
isRemote
public boolean isRemote()
Returns whether the user specified to connect to a remote server.- Returns:
- whether the user specified to connect to a remote server.
-
-