Class DocGeneratorSubCommandHandler

  • All Implemented Interfaces:
    Comparable<org.forgerock.opendj.config.dsconfig.SubCommandHandler>

    public final class DocGeneratorSubCommandHandler
    extends Object
    Adds a hidden sub-command to write generated reference documentation for the dsconfig command.
    • Method Detail

      • getSubCommand

        public com.forgerock.opendj.cli.SubCommand getSubCommand()
        Gets the sub-command associated with this handler.
        Returns:
        Returns the sub-command associated with this handler.
      • run

        public com.forgerock.opendj.cli.MenuResult<Integer> run​(DsConfig app,
                                                                ManagementContextFactory factory)
                                                         throws com.forgerock.opendj.cli.ClientException
        Run this sub-command handler.
        Parameters:
        app - The tool.
        factory - The LDAP management context factory context factory.
        Returns:
        Returns a MenuResult.success() containing zero if the sub-command completed successfully or non-zero if it did not, or MenuResult.quit(), or MenuResult.cancel(), if the sub-command was run interactively and the user chose to quit or cancel.
        Throws:
        com.forgerock.opendj.cli.ClientException - If the management context could not be created.
      • create

        public static DocGeneratorSubCommandHandler create​(com.forgerock.opendj.cli.ArgumentParser parser,
                                                           String commandName,
                                                           String extension)
        Creates a new doc generation sub-command.
        Parameters:
        parser - The sub-command argument parser.
        commandName - The name of the command.
        extension - The file extension for generated files.
        Returns:
        a new doc generation sub-command.
      • compareTo

        public final int compareTo​(org.forgerock.opendj.config.dsconfig.SubCommandHandler o)
        Specified by:
        compareTo in interface Comparable<org.forgerock.opendj.config.dsconfig.SubCommandHandler>
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getCommandBuilder

        public final com.forgerock.opendj.cli.CommandBuilder getCommandBuilder()
        Gets the command builder associated with this handler. The method should be called after calling run() method.
        Returns:
        Returns the sub-command associated with this handler.
      • getTags

        public final Set<Tag> getTags()
        Gets the tags associated with this sub-command handler.
        Returns:
        Returns the tags associated with this sub-command handler.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public final String toString()
        Get the string representation of this sub-command handler.

        The string representation is simply the sub-command's name.

        Overrides:
        toString in class Object
        Returns:
        Returns the string representation of this sub-command handler.
      • getTimeUnit

        protected final com.forgerock.opendj.util.DurationUnit getTimeUnit()
                                                                    throws com.forgerock.opendj.cli.ArgumentException
        Gets the optional time unit that the user requested.
        Returns:
        Returns the time unit that the user requested, or null if no time unit was specified.
        Throws:
        com.forgerock.opendj.cli.ArgumentException - If the user specified an invalid time unit.