Package io.vertx.reactivex.sqlclient
Class ClientBuilder<C>
- java.lang.Object
-
- io.vertx.reactivex.sqlclient.ClientBuilder<C>
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<ClientBuilder>__TYPE_ARGTypeArg<C>__typeArg_0
-
Constructor Summary
Constructors Constructor Description ClientBuilder(io.vertx.sqlclient.ClientBuilder delegate)ClientBuilder(Object delegate, TypeArg<C> typeArg_0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cbuild()Build and return the client.ClientBuilder<C>connectingTo(io.vertx.sqlclient.SqlConnectOptions database)Configure thedatabasethe client should connect to.ClientBuilder<C>connectingTo(String database)Configure thedatabasethe client should connect to.ClientBuilder<C>connectingTo(Supplier<io.vertx.core.Future<io.vertx.sqlclient.SqlConnectOptions>> supplier)Configure thedatabasethe client should connect to.ClientBuilder<C>connectingTo(List<io.vertx.sqlclient.SqlConnectOptions> databases)Configure thedatabasethe client should connect to.booleanequals(Object o)io.vertx.sqlclient.ClientBuildergetDelegate()inthashCode()static <C> ClientBuilder<C>newInstance(io.vertx.sqlclient.ClientBuilder arg)static <C> ClientBuilder<C>newInstance(io.vertx.sqlclient.ClientBuilder arg, TypeArg<C> __typeArg_C)StringtoString()ClientBuilder<C>using(Vertx vertx)Sets the vertx instance to use.ClientBuilder<C>with(io.vertx.sqlclient.PoolOptions options)Configure the client with the given pooloptionsClientBuilder<C>withConnectHandler(io.vertx.core.Handler<SqlConnection> handler)Set a handler called when the pool has established a connection to the database.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ClientBuilder> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.sqlclient.ClientBuilder getDelegate()
-
with
public ClientBuilder<C> with(io.vertx.sqlclient.PoolOptions options)
Configure the client with the given pooloptions- Parameters:
options- the pool options- Returns:
- a reference to this, so the API can be used fluently
-
connectingTo
public ClientBuilder<C> connectingTo(io.vertx.sqlclient.SqlConnectOptions database)
Configure thedatabasethe client should connect to. The targetdatabaseis specified as aSqlConnectOptionscoordinates.- Parameters:
database- the database coordinates- Returns:
- a reference to this, so the API can be used fluently
-
connectingTo
public ClientBuilder<C> connectingTo(String database)
Configure thedatabasethe client should connect to. The targetdatabaseis specified as aSqlConnectOptionscoordinates.- Parameters:
database- the database URI- Returns:
- a reference to this, so the API can be used fluently
-
connectingTo
public ClientBuilder<C> connectingTo(List<io.vertx.sqlclient.SqlConnectOptions> databases)
Configure thedatabasethe client should connect to. When the client needs to connect to the database, it gets a database configuration from the list ofdatabasesusing a round-robin policy.- Parameters:
databases- the list of database coordinates- Returns:
- a reference to this, so the API can be used fluently
-
using
public ClientBuilder<C> using(Vertx vertx)
Sets the vertx instance to use.- Parameters:
vertx- the vertx instance- Returns:
- a reference to this, so the API can be used fluently
-
withConnectHandler
public ClientBuilder<C> withConnectHandler(io.vertx.core.Handler<SqlConnection> handler)
Set a handler called when the pool has established a connection to the database.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(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)to release the connection to the pool.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
build
public C build()
Build and return the client.- Returns:
- the client
-
connectingTo
public ClientBuilder<C> connectingTo(Supplier<io.vertx.core.Future<io.vertx.sqlclient.SqlConnectOptions>> supplier)
Configure thedatabasethe client should connect to. When the client needs to connect to the database, it gets fresh database configuration from the databasesupplier.- Parameters:
supplier- the supplier of database coordinates- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static <C> ClientBuilder<C> newInstance(io.vertx.sqlclient.ClientBuilder arg)
-
newInstance
public static <C> ClientBuilder<C> newInstance(io.vertx.sqlclient.ClientBuilder arg, TypeArg<C> __typeArg_C)
-
-