Class CommandRegistry


  • public class CommandRegistry
    extends CommandResolver
    A registry that contains the commands known by a shell.

    It is a mutable command resolver.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • CommandRegistry

        public CommandRegistry​(io.vertx.ext.shell.command.CommandRegistry delegate)
      • CommandRegistry

        public CommandRegistry​(Object delegate)
    • Method Detail

      • getShared

        public static CommandRegistry getShared​(Vertx vertx)
        Parameters:
        vertx - the vertx instance
        Returns:
        the shared registry
      • create

        public static CommandRegistry create​(Vertx vertx)
        Parameters:
        vertx - the vertx instance
        Returns:
        the created registry
      • registerCommand

        public io.smallrye.mutiny.Uni<Command> registerCommand​(Command command)
        Register a command

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        command - the command to register
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • registerCommandAndAwait

        public Command registerCommandAndAwait​(Command command)
        Blocking variant of registerCommand(io.vertx.mutiny.ext.shell.command.Command).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        command - the command to register
        Returns:
        the Command instance produced by the operation.
      • registerCommands

        public io.smallrye.mutiny.Uni<List<Command>> registerCommands​(List<Command> commands)
        Register a list of commands.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        commands - the commands to register
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • registerCommandsAndAwait

        public List<Command> registerCommandsAndAwait​(List<Command> commands)
        Blocking variant of io.vertx.mutiny.ext.shell.command.CommandRegistry#registerCommands(List).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        commands - the commands to register
        Returns:
        the List instance produced by the operation.
      • registerCommandsAndForget

        public CommandRegistry registerCommandsAndForget​(List<Command> commands)
        Variant of io.vertx.mutiny.ext.shell.command.CommandRegistry#registerCommands(List) that ignores the result of the operation.

        This method subscribes on the result of io.vertx.mutiny.ext.shell.command.CommandRegistry#registerCommands(List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from io.vertx.mutiny.ext.shell.command.CommandRegistry#registerCommands(List) but you don't need to compose it with other operations.

        Parameters:
        commands - the commands to register
        Returns:
        the instance of CommandRegistry to chain method calls.
      • unregisterCommand

        public io.smallrye.mutiny.Uni<Void> unregisterCommand​(String commandName)
        Unregister a command.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        commandName - the command name
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • unregisterCommandAndAwait

        public Void unregisterCommandAndAwait​(String commandName)
        Blocking variant of unregisterCommand(String).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        commandName - the command name
        Returns:
        the Void instance produced by the operation.
      • unregisterCommandAndForget

        public CommandRegistry unregisterCommandAndForget​(String commandName)
        Variant of unregisterCommand(String) that ignores the result of the operation.

        This method subscribes on the result of unregisterCommand(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from unregisterCommand(String) but you don't need to compose it with other operations.

        Parameters:
        commandName - the command name
        Returns:
        the instance of CommandRegistry to chain method calls.
      • newInstance

        public static CommandRegistry newInstance​(io.vertx.ext.shell.command.CommandRegistry arg)