io.vertx.kafka.admin

## Interface AdminUtils

-     public interface AdminUtils

  Provides a wrapper around important methods in Kafka's AdminUtils, namely
  See Also:
    `kafka.admin.AdminUtils#createTopic(ZkUtils, String, int, int, Properties, RackAwareMode),`, `kafka.admin.AdminUtils#deleteTopic(ZkUtils, String),`, `kafka.admin.AdminUtils#changeTopicConfig(ZkUtils, String, Properties), and`, `AdminUtils.topicExists(ZkUtils, String)`

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changeTopicConfig(String topicName, Map<String,String> topicConfig, Handler<AsyncResult<Void>> completionHandler)` Updates the configuration of the topic given by topicName.
    `void` | `close(Handler<AsyncResult<Void>> completionHandler)` Closes the underlying connection to Zookeeper.
    `static AdminUtils` | `create(Vertx vertx, String zookeeperHosts)` Create a new AdminUtils instance
    `static AdminUtils` | `create(Vertx vertx, String zookeeperHosts, boolean autoClose)` Create a new AdminUtils instance
    `static AdminUtils` | `create(Vertx vertx, String zookeeperHosts, int connectionTimeoutMs, boolean isSecure, boolean autoClose)` Create a new AdminUtils instance
    `void` | `createTopic(String topicName, int partitionCount, int replicationFactor, Handler<AsyncResult<Void>> completionHandler)` Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s)
    `void` | `createTopic(String topicName, int partitionCount, int replicationFactor, Map<String,String> topicConfig, Handler<AsyncResult<Void>> completionHandler)` Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s).
    `void` | `deleteTopic(String topicName, Handler<AsyncResult<Void>> completionHandler)` Delete the Kafka topic given by the topicName.
    `void` | `topicExists(String topicName, Handler<AsyncResult<Boolean>> completionHandler)` Checks if the Kafka topic given by topicName does exist.

- - ### Method Detail

    - #### create

          static AdminUtils create(Vertx vertx,
                                   String zookeeperHosts)

      Create a new AdminUtils instance
      Parameters:
        `vertx` - Vert.x instance to use
        `zookeeperHosts` - comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182
      Returns:
        an instance of the AdminUtilWrapper

    - #### create

          static AdminUtils create(Vertx vertx,
                                   String zookeeperHosts,
                                   boolean autoClose)

      Create a new AdminUtils instance
      Parameters:
        `vertx` - Vert.x instance to use
        `zookeeperHosts` - comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182
        `autoClose` - If set to true, the client will auto-close the connection after a command
      Returns:
        an instance of the AdminUtilWrapper

    - #### create

          static AdminUtils create(Vertx vertx,
                                   String zookeeperHosts,
                                   int connectionTimeoutMs,
                                   boolean isSecure,
                                   boolean autoClose)

      Create a new AdminUtils instance
      Parameters:
        `vertx` - Vert.x instance to use
        `zookeeperHosts` - comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182
        `connectionTimeoutMs` - Maximum time in ms to wait for the client to connect to Zookeeper
        `isSecure` - If set to true, ZkUtils will perform security checks, i.e. ACL checks
        `autoClose` - If set to true, the client will auto-close the connection after a command
      Returns:
        an instance of the AdminUtilWrapper

    - #### createTopic

          void createTopic(String topicName,
                           int partitionCount,
                           int replicationFactor,
                           Handler<AsyncResult<Void>> completionHandler)

      Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s)
      Parameters:
        `topicName` - Name of the to-be-created topic
        `partitionCount` - Number of partitions
        `replicationFactor` - Number of replicates. Must be lower or equal to the number of available Brokers
        `completionHandler` - vert.x callback

    - #### createTopic

          void createTopic(String topicName,
                           int partitionCount,
                           int replicationFactor,
                           Map<String,String> topicConfig,
                           Handler<AsyncResult<Void>> completionHandler)

      Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast to @see `createTopic(String, int, int, Handler)`, one can pass in additional configuration parameters as a map (String -> String).
      Parameters:
        `topicName` - Name of the to-be-created topic
        `partitionCount` - Number of partitions
        `replicationFactor` - Number of replicates. Must be lower or equal to the number of available Brokers
        `topicConfig` - map with additional topic configuration parameters
        `completionHandler` - vert.x callback

    - #### deleteTopic

          void deleteTopic(String topicName,
                           Handler<AsyncResult<Void>> completionHandler)

      Delete the Kafka topic given by the topicName.
      Parameters:
        `topicName` - Name of the topic to be deleted
        `completionHandler` - vert.x callback

    - #### topicExists

          void topicExists(String topicName,
                           Handler<AsyncResult<Boolean>> completionHandler)

      Checks if the Kafka topic given by topicName does exist.
      Parameters:
        `topicName` - Name of the topic
        `completionHandler` - vert.x callback

    - #### changeTopicConfig

          void changeTopicConfig(String topicName,
                                 Map<String,String> topicConfig,
                                 Handler<AsyncResult<Void>> completionHandler)

      Updates the configuration of the topic given by topicName. Configuration parameters are passed in as a Map (Key -> Value) of Strings.
      Parameters:
        `topicName` - topic to be configured
        `topicConfig` - Map with configuration items
        `completionHandler` - vert.x callback

    - #### close

          void close(Handler<AsyncResult<Void>> completionHandler)

      Closes the underlying connection to Zookeeper. It is required to call the method for cleanup purposes if AdminUtils was not created with autoClose set to true.
      Parameters:
        `completionHandler` - vert.x callback

Copyright © 2019 Eclipse. All rights reserved.