public class ClientBuilder<C> extends Object
| Modifier and Type | Field and Description |
|---|---|
static io.vertx.lang.rx.TypeArg<ClientBuilder> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<C> |
__typeArg_0 |
| Constructor and Description |
|---|
ClientBuilder(ClientBuilder delegate) |
ClientBuilder(Object delegate,
io.vertx.lang.rx.TypeArg<C> typeArg_0) |
| Modifier and Type | Method and Description |
|---|---|
C |
build()
Build and return the client.
|
ClientBuilder<C> |
connectingTo(List<SqlConnectOptions> databases)
Configure the
database the client should connect to. |
ClientBuilder<C> |
connectingTo(SqlConnectOptions database)
Configure the
database the client should connect to. |
ClientBuilder<C> |
connectingTo(String database)
Configure the
database the client should connect to. |
ClientBuilder<C> |
connectingTo(java.util.function.Supplier<Future<SqlConnectOptions>> supplier)
Configure the
database the client should connect to. |
boolean |
equals(Object o) |
ClientBuilder |
getDelegate() |
int |
hashCode() |
static <C> ClientBuilder<C> |
newInstance(ClientBuilder arg) |
static <C> ClientBuilder<C> |
newInstance(ClientBuilder arg,
io.vertx.lang.rx.TypeArg<C> __typeArg_C) |
String |
toString() |
ClientBuilder<C> |
using(Vertx vertx)
Sets the vertx instance to use.
|
ClientBuilder<C> |
with(PoolOptions options)
Configure the client with the given pool
options |
ClientBuilder<C> |
withConnectHandler(Handler<SqlConnection> handler)
Set a handler called when the pool has established a connection to the database.
|
public static final io.vertx.lang.rx.TypeArg<ClientBuilder> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<C> __typeArg_0
public ClientBuilder(ClientBuilder delegate)
public ClientBuilder getDelegate()
public ClientBuilder<C> with(PoolOptions options)
optionsoptions - the pool optionspublic ClientBuilder<C> connectingTo(SqlConnectOptions database)
database the client should connect to. The target database is specified as
a SqlConnectOptions coordinates.database - the database coordinatespublic ClientBuilder<C> connectingTo(String database)
database the client should connect to. The target database is specified as
a SqlConnectOptions coordinates.database - the database URIpublic ClientBuilder<C> connectingTo(List<SqlConnectOptions> databases)
database the client should connect to. When the client needs to connect to the database,
it gets a database configuration from the list of databases using a round-robin policy.databases - the list of database coordinatespublic ClientBuilder<C> using(Vertx vertx)
vertx - the vertx instancepublic ClientBuilder<C> withConnectHandler(Handler<SqlConnection> handler)
This handler allows interactions with the database before the connection is added to the pool.
When the handler has finished, it must call SqlClient.close() to release the connection
to the pool.
handler - the handlerpublic C build()
public ClientBuilder<C> connectingTo(java.util.function.Supplier<Future<SqlConnectOptions>> supplier)
database the client should connect to. When the client needs to connect to the database,
it gets fresh database configuration from the database supplier.supplier - the supplier of database coordinatespublic static <C> ClientBuilder<C> newInstance(ClientBuilder arg)
public static <C> ClientBuilder<C> newInstance(ClientBuilder arg, io.vertx.lang.rx.TypeArg<C> __typeArg_C)
Copyright © 2023 Eclipse. All rights reserved.