io.vertx.ext.shell.command

## Interface CommandRegistry

- All Superinterfaces:
    CommandResolver

      public interface CommandRegistry
      extends CommandResolver

  A registry that contains the commands known by a shell.

  It is a mutable command resolver.
  Author:
    Julien Viet

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CommandRegistry` | `create(Vertx vertx)` Create a new registry.
    `static CommandRegistry` | `getShared(Vertx vertx)` Get the shared registry for the Vert.x instance.
    `Future<Command>` | `registerCommand(Class<? extends AnnotatedCommand> command)` Like `registerCommand(Class, Handler)`, without a completion handler.
    `CommandRegistry` | `registerCommand(Class<? extends AnnotatedCommand> command, Handler<AsyncResult<Command>> completionHandler)` Register a single command.
    `Future<Command>` | `registerCommand(Command command)` Like `registerCommand(Command, Handler)`, without a completion handler.
    `CommandRegistry` | `registerCommand(Command command, Handler<AsyncResult<Command>> completionHandler)` Register a command
    `Future<List<Command>>` | `registerCommands(List<Command> commands)` Like `registerCommands(List, Handler)`, without a completion handler.
    `CommandRegistry` | `registerCommands(List<Command> commands, Handler<AsyncResult<List<Command>>> completionHandler)` Register a list of commands.
    `Future<Void>` | `unregisterCommand(String commandName)` Like `unregisterCommand(String, Handler)`, without a completion handler.
    `CommandRegistry` | `unregisterCommand(String commandName, Handler<AsyncResult<Void>> completionHandler)` Unregister a command.

    - ### Methods inherited from interface io.vertx.ext.shell.command.CommandResolver

      `baseCommands, commands, getCommand`

- - ### Method Detail

    - #### getShared

          static CommandRegistry getShared(Vertx vertx)

      Get the shared registry for the Vert.x instance.
      Parameters:
        `vertx` - the vertx instance
      Returns:
        the shared registry

    - #### create

          static CommandRegistry create(Vertx vertx)

      Create a new registry.
      Parameters:
        `vertx` - the vertx instance
      Returns:
        the created registry

    - #### registerCommand

          Future<Command> registerCommand(Class<? extends AnnotatedCommand> command)

      Like `registerCommand(Class, Handler)`, without a completion handler.

    - #### registerCommand

          CommandRegistry registerCommand(Class<? extends AnnotatedCommand> command,
                                          Handler<AsyncResult<Command>> completionHandler)

      Register a single command.
      Parameters:
        `command` - the class of the command to register
        `completionHandler` - notified when the command is registered
      Returns:
        a reference to this, so the API can be used fluently

    - #### registerCommand

          Future<Command> registerCommand(Command command)

      Like `registerCommand(Command, Handler)`, without a completion handler.

    - #### registerCommand

          CommandRegistry registerCommand(Command command,
                                          Handler<AsyncResult<Command>> completionHandler)

      Register a command
      Parameters:
        `command` - the command to register
        `completionHandler` - notified when the command is registered
      Returns:
        a reference to this, so the API can be used fluently

    - #### registerCommands

          Future<List<Command>> registerCommands(List<Command> commands)

      Like `registerCommands(List, Handler)`, without a completion handler.

    - #### registerCommands

          CommandRegistry registerCommands(List<Command> commands,
                                           Handler<AsyncResult<List<Command>>> completionHandler)

      Register a list of commands.
      Parameters:
        `commands` - the commands to register
        `completionHandler` - notified when the command is registered
      Returns:
        a reference to this, so the API can be used fluently

    - #### unregisterCommand

          Future<Void> unregisterCommand(String commandName)

      Like `unregisterCommand(String, Handler)`, without a completion handler.

    - #### unregisterCommand

          CommandRegistry unregisterCommand(String commandName,
                                            Handler<AsyncResult<Void>> completionHandler)

      Unregister a command.
      Parameters:
        `commandName` - the command name
        `completionHandler` - notified when the command is unregistered
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2024 Eclipse. All rights reserved.