Class ControlPanelArgumentParser

  • All Implemented Interfaces:
    ToolRefDocContainer

    public class ControlPanelArgumentParser
    extends ArgumentParser
    Class used to parse the arguments of the control panel command-line.
    • 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 ArgumentException
        Initializes 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: ArgumentParser
        Parses the provided set of arguments and updates the information associated with this parser accordingly.
        Overrides:
        parseArguments in class ArgumentParser
        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 null if 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 null if 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, return null.
        Returns:
        The password stored into the specified file on by the command line argument, or null if 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 IllegalStateException
        Returns 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 0 if 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.