/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.reactivex.kafka.admin;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import java.util.Map;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;

Provides a wrapper around important methods in Kafka's AdminUtils, namely

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Provides a wrapper around important methods in Kafka's AdminUtils, namely * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.kafka.admin.AdminUtils original} non RX-ified interface using Vert.x codegen. */
@io.vertx.lang.rx.RxGen(io.vertx.kafka.admin.AdminUtils.class) public class AdminUtils { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdminUtils that = (AdminUtils) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final io.vertx.lang.rx.TypeArg<AdminUtils> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new AdminUtils((io.vertx.kafka.admin.AdminUtils) obj), AdminUtils::getDelegate ); private final io.vertx.kafka.admin.AdminUtils delegate; public AdminUtils(io.vertx.kafka.admin.AdminUtils delegate) { this.delegate = delegate; } public io.vertx.kafka.admin.AdminUtils getDelegate() { return delegate; }
Create a new AdminUtils instance
Params:
  • 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 a new AdminUtils instance * @param vertx Vert.x instance to use * @param zookeeperHosts comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182 * @return an instance of the AdminUtilWrapper */
@Deprecated() public static io.vertx.reactivex.kafka.admin.AdminUtils create(io.vertx.reactivex.core.Vertx vertx, String zookeeperHosts) { io.vertx.reactivex.kafka.admin.AdminUtils ret = io.vertx.reactivex.kafka.admin.AdminUtils.newInstance(io.vertx.kafka.admin.AdminUtils.create(vertx.getDelegate(), zookeeperHosts)); return ret; }
Create a new AdminUtils instance
Params:
  • 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 a new AdminUtils instance * @param vertx Vert.x instance to use * @param zookeeperHosts comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182 * @param autoClose If set to true, the client will auto-close the connection after a command * @return an instance of the AdminUtilWrapper */
@Deprecated() public static io.vertx.reactivex.kafka.admin.AdminUtils create(io.vertx.reactivex.core.Vertx vertx, String zookeeperHosts, boolean autoClose) { io.vertx.reactivex.kafka.admin.AdminUtils ret = io.vertx.reactivex.kafka.admin.AdminUtils.newInstance(io.vertx.kafka.admin.AdminUtils.create(vertx.getDelegate(), zookeeperHosts, autoClose)); return ret; }
Create a new AdminUtils instance
Params:
  • 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
/** * Create a new AdminUtils instance * @param vertx Vert.x instance to use * @param zookeeperHosts comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182 * @param connectionTimeoutMs Maximum time in ms to wait for the client to connect to Zookeeper * @param isSecure If set to true, ZkUtils will perform security checks, i.e. ACL checks * @param autoClose If set to true, the client will auto-close the connection after a command * @return an instance of the AdminUtilWrapper */
@Deprecated() public static io.vertx.reactivex.kafka.admin.AdminUtils create(io.vertx.reactivex.core.Vertx vertx, String zookeeperHosts, int connectionTimeoutMs, boolean isSecure, boolean autoClose) { io.vertx.reactivex.kafka.admin.AdminUtils ret = io.vertx.reactivex.kafka.admin.AdminUtils.newInstance(io.vertx.kafka.admin.AdminUtils.create(vertx.getDelegate(), zookeeperHosts, connectionTimeoutMs, isSecure, autoClose)); return ret; }
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s)
Params:
  • 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
/** * Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s) * @param topicName Name of the to-be-created topic * @param partitionCount Number of partitions * @param replicationFactor Number of replicates. Must be lower or equal to the number of available Brokers * @param completionHandler vert.x callback */
@Deprecated() public void createTopic(String topicName, int partitionCount, int replicationFactor, Handler<AsyncResult<Void>> completionHandler) { delegate.createTopic(topicName, partitionCount, replicationFactor, completionHandler); }
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s)
Params:
  • 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
Returns:
/** * Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s) * @param topicName Name of the to-be-created topic * @param partitionCount Number of partitions * @param replicationFactor Number of replicates. Must be lower or equal to the number of available Brokers * @return */
@Deprecated() public Completable rxCreateTopic(String topicName, int partitionCount, int replicationFactor) { return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> { createTopic(topicName, partitionCount, replicationFactor, handler); }); }
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast to @see createTopic, one can pass in additional configuration parameters as a map (String -> String).
Params:
  • 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
/** * Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast * to @see {@link io.vertx.reactivex.kafka.admin.AdminUtils#createTopic}, one can pass in additional configuration * parameters as a map (String -> String). * @param topicName Name of the to-be-created topic * @param partitionCount Number of partitions * @param replicationFactor Number of replicates. Must be lower or equal to the number of available Brokers * @param topicConfig map with additional topic configuration parameters * @param completionHandler vert.x callback */
@Deprecated() public void createTopic(String topicName, int partitionCount, int replicationFactor, Map<String, String> topicConfig, Handler<AsyncResult<Void>> completionHandler) { delegate.createTopic(topicName, partitionCount, replicationFactor, topicConfig, completionHandler); }
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast to @see createTopic, one can pass in additional configuration parameters as a map (String -> String).
Params:
  • 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
Returns:
/** * Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast * to @see {@link io.vertx.reactivex.kafka.admin.AdminUtils#createTopic}, one can pass in additional configuration * parameters as a map (String -> String). * @param topicName Name of the to-be-created topic * @param partitionCount Number of partitions * @param replicationFactor Number of replicates. Must be lower or equal to the number of available Brokers * @param topicConfig map with additional topic configuration parameters * @return */
@Deprecated() public Completable rxCreateTopic(String topicName, int partitionCount, int replicationFactor, Map<String, String> topicConfig) { return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> { createTopic(topicName, partitionCount, replicationFactor, topicConfig, handler); }); }
Delete the Kafka topic given by the topicName.
Params:
  • topicName – Name of the topic to be deleted
  • completionHandler – vert.x callback
/** * Delete the Kafka topic given by the topicName. * @param topicName Name of the topic to be deleted * @param completionHandler vert.x callback */
@Deprecated() public void deleteTopic(String topicName, Handler<AsyncResult<Void>> completionHandler) { delegate.deleteTopic(topicName, completionHandler); }
Delete the Kafka topic given by the topicName.
Params:
  • topicName – Name of the topic to be deleted
Returns:
/** * Delete the Kafka topic given by the topicName. * @param topicName Name of the topic to be deleted * @return */
@Deprecated() public Completable rxDeleteTopic(String topicName) { return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> { deleteTopic(topicName, handler); }); }
Checks if the Kafka topic given by topicName does exist.
Params:
  • topicName – Name of the topic
  • completionHandler – vert.x callback
/** * Checks if the Kafka topic given by topicName does exist. * @param topicName Name of the topic * @param completionHandler vert.x callback */
@Deprecated() public void topicExists(String topicName, Handler<AsyncResult<Boolean>> completionHandler) { delegate.topicExists(topicName, completionHandler); }
Checks if the Kafka topic given by topicName does exist.
Params:
  • topicName – Name of the topic
Returns:
/** * Checks if the Kafka topic given by topicName does exist. * @param topicName Name of the topic * @return */
@Deprecated() public Single<Boolean> rxTopicExists(String topicName) { return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> { topicExists(topicName, handler); }); }
Updates the configuration of the topic given by topicName. Configuration parameters are passed in as a Map (Key -> Value) of Strings.
Params:
  • topicName – topic to be configured
  • topicConfig – Map with configuration items
  • completionHandler – vert.x callback
/** * Updates the configuration of the topic given by topicName. Configuration parameters * are passed in as a Map (Key -> Value) of Strings. * @param topicName topic to be configured * @param topicConfig Map with configuration items * @param completionHandler vert.x callback */
@Deprecated() public void changeTopicConfig(String topicName, Map<String, String> topicConfig, Handler<AsyncResult<Void>> completionHandler) { delegate.changeTopicConfig(topicName, topicConfig, completionHandler); }
Updates the configuration of the topic given by topicName. Configuration parameters are passed in as a Map (Key -> Value) of Strings.
Params:
  • topicName – topic to be configured
  • topicConfig – Map with configuration items
Returns:
/** * Updates the configuration of the topic given by topicName. Configuration parameters * are passed in as a Map (Key -> Value) of Strings. * @param topicName topic to be configured * @param topicConfig Map with configuration items * @return */
@Deprecated() public Completable rxChangeTopicConfig(String topicName, Map<String, String> topicConfig) { return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> { changeTopicConfig(topicName, topicConfig, handler); }); }
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.
Params:
  • completionHandler – vert.x callback
/** * 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. * @param completionHandler vert.x callback */
@Deprecated() public void close(Handler<AsyncResult<Void>> completionHandler) { delegate.close(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.
Returns:
/** * 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. * @return */
@Deprecated() public Completable rxClose() { return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> { close(handler); }); } public static AdminUtils newInstance(io.vertx.kafka.admin.AdminUtils arg) { return arg != null ? new AdminUtils(arg) : null; } }