Class SecureConnectionCliParser

    • Field Detail

      • verboseArg

        protected BooleanArgument verboseArg
        The 'verbose' global argument.
      • propertiesFileArg

        protected StringArgument propertiesFileArg
        Argument indicating a properties file argument.
      • noPropertiesFileArg

        protected BooleanArgument noPropertiesFileArg
        The argument which should be used to indicate that we will not look for properties file.
    • Constructor Detail

      • SecureConnectionCliParser

        protected SecureConnectionCliParser​(String mainClassName,
                                            org.forgerock.i18n.LocalizableMessage toolDescription,
                                            boolean longArgumentsCaseSensitive)
        Creates a new instance of this argument parser with no arguments.
        Parameters:
        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 subcommand and long argument names should be treated in a case-sensitive manner.
    • Method Detail

      • getBindDN

        public String getBindDN()
        Get the bindDN which has to be used for the command.
        Returns:
        The bindDN specified by the command line argument, or the default value, if not specified.
      • getAdministratorUID

        public String getAdministratorUID()
        Returns the Administrator UID provided in the command-line.
        Returns:
        the Administrator UID provided in the command-line.
      • getBindPassword

        public String getBindPassword()
        Gets 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 it if not specified.
      • createGlobalArguments

        protected Set<Argument> createGlobalArguments​(OutputStream outStream,
                                                      boolean alwaysSSL)
                                               throws ArgumentException
        Initialize Global option.
        Parameters:
        outStream - The output stream used for the usage.
        alwaysSSL - If true, always use the SSL connection type. In this case, the arguments useSSL and startTLS are not present.
        Returns:
        a ArrayList with the options created.
        Throws:
        ArgumentException - If there is a problem with any of the parameters used to create this argument.
      • initializeGlobalArguments

        protected void initializeGlobalArguments​(Collection<Argument> args)
                                          throws ArgumentException
        Initialize the global options with the provided set of arguments.
        Parameters:
        args - the arguments to use to initialize the global options.
        Throws:
        ArgumentException - if there is a conflict with the provided arguments.
      • initializeGlobalArguments

        protected void initializeGlobalArguments​(Collection<Argument> args,
                                                 ArgumentGroup argGroup)
                                          throws ArgumentException
        Initialize the global options with the provided set of arguments.
        Parameters:
        args - the arguments to use to initialize the global options.
        argGroup - to which args will be added
        Throws:
        ArgumentException - if there is a conflict with the provided arguments.
      • getHostName

        public String getHostName()
        Get the host name which has to be used for the command.
        Returns:
        The host name specified by the command line argument, or the default value, if not specified.
      • getPort

        public String getPort()
        Get the port which has to be used for the command.
        Returns:
        The port specified by the command line argument, or the default value, if not specified.
      • validateGlobalOptions

        public int validateGlobalOptions​(org.forgerock.i18n.LocalizableMessageBuilder buf)
        Indication if provided global options are validate.
        Parameters:
        buf - The LocalizableMessageBuilder to write the error message.
        Returns:
        return code.
      • validateGlobalOptions

        public int validateGlobalOptions​(PrintStream err)
        Indication if provided global options are validate.
        Parameters:
        err - The stream to be used to print error message.
        Returns:
        return code.
      • isVerbose

        public boolean isVerbose()
        Indicate if the verbose mode is required.
        Returns:
        True if verbose mode is required
      • getTrustManager

        public ApplicationTrustManager getTrustManager()
        Handle TrustStore.
        Returns:
        The trustStore manager to be used for the command.
      • 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 or 0 if there is no timeout.
        Throws:
        IllegalStateException - if the method is called before parsing the arguments.