Package io.vertx.rxjava.mysqlclient
Class MySQLPool
- java.lang.Object
-
- io.vertx.rxjava.sqlclient.SqlClient
-
- io.vertx.rxjava.sqlclient.Pool
-
- io.vertx.rxjava.mysqlclient.MySQLPool
-
public class MySQLPool extends Pool
A ofMySQL Connections
. NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MySQLPool>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SqlClient
client(MySQLConnectOptions connectOptions, PoolOptions poolOptions)
Create a client backed by a connection pool to the database configured with the givenconnectOptions
andpoolOptions
.static SqlClient
client(Vertx vertx, MySQLConnectOptions connectOptions, PoolOptions poolOptions)
Likeclient(java.lang.String)
with a specific instance.static SqlClient
client(Vertx vertx, String connectionUri)
Likeclient(java.lang.String)
with a defaultpoolOptions
.static SqlClient
client(Vertx vertx, String connectionUri, PoolOptions poolOptions)
static SqlClient
client(Vertx vertx, Supplier<Future<MySQLConnectOptions>> mySQLConnectOptions, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.static SqlClient
client(Vertx vertx, List<MySQLConnectOptions> mySQLConnectOptions, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.static SqlClient
client(String connectionUri)
Likeclient(java.lang.String)
with a defaultpoolOptions
.static SqlClient
client(String connectionUri, PoolOptions poolOptions)
static SqlClient
client(Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Create a client backed by a connection pool to the MySQLdatabases
.static SqlClient
client(List<MySQLConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the MySQLdatabases
with round-robin selection.MySQLPool
connectHandler(Handler<SqlConnection> handler)
Set an handler called when the pool has established a connection to the database.MySQLPool
connectionProvider(Function<Context,Future<SqlConnection>> provider)
Replace the default pool connection provider, the newprovider
returns a future connection for a given .boolean
equals(Object o)
MySQLPool
getDelegate()
int
hashCode()
static MySQLPool
newInstance(MySQLPool arg)
static MySQLPool
pool(MySQLConnectOptions database, PoolOptions options)
Create a connection pool to the MySQLserver
configured with the givenoptions
.static MySQLPool
pool(Vertx vertx, MySQLConnectOptions database, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.static MySQLPool
pool(Vertx vertx, String connectionUri)
Likepool(java.lang.String)
with default options.static MySQLPool
pool(Vertx vertx, String connectionUri, PoolOptions options)
static MySQLPool
pool(Vertx vertx, Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.static MySQLPool
pool(Vertx vertx, List<MySQLConnectOptions> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.static MySQLPool
pool(String connectionUri)
Likepool(java.lang.String)
with default options.static MySQLPool
pool(String connectionUri, PoolOptions options)
static MySQLPool
pool(Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Create a connection pool to the MySQLdatabases
.static MySQLPool
pool(List<MySQLConnectOptions> databases, PoolOptions options)
Create a connection pool to the MySQLdatabases
with round-robin selection.String
toString()
-
Methods inherited from class io.vertx.rxjava.sqlclient.Pool
close, close, getConnection, getConnection, newInstance, pool, pool, pool, preparedQuery, query, rxClose, rxGetConnection, rxWithConnection, rxWithTransaction, rxWithTransaction, size, withConnection, withConnection, withTransaction, withTransaction, withTransaction, withTransaction
-
Methods inherited from class io.vertx.rxjava.sqlclient.SqlClient
newInstance, preparedQuery
-
-
-
-
Method Detail
-
getDelegate
public MySQLPool getDelegate()
- Overrides:
getDelegate
in classPool
-
pool
public static MySQLPool pool(String connectionUri)
Likepool(java.lang.String)
with default options.- Parameters:
connectionUri
-- Returns:
-
pool
public static MySQLPool pool(String connectionUri, PoolOptions options)
- Parameters:
connectionUri
-options
-- Returns:
-
pool
public static MySQLPool pool(Vertx vertx, String connectionUri)
Likepool(java.lang.String)
with default options.- Parameters:
vertx
-connectionUri
-- Returns:
-
pool
public static MySQLPool pool(Vertx vertx, String connectionUri, PoolOptions options)
- Parameters:
vertx
-connectionUri
-options
-- Returns:
-
pool
public static MySQLPool pool(MySQLConnectOptions database, PoolOptions options)
Create a connection pool to the MySQLserver
configured with the givenoptions
.- Parameters:
database
- the options for the connectionoptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static MySQLPool pool(Vertx vertx, MySQLConnectOptions database, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-database
-options
-- Returns:
-
pool
public static MySQLPool pool(List<MySQLConnectOptions> databases, PoolOptions options)
Create a connection pool to the MySQLdatabases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of serversoptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static MySQLPool pool(Vertx vertx, List<MySQLConnectOptions> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
client
public static SqlClient client(String connectionUri)
Likeclient(java.lang.String)
with a defaultpoolOptions
.- Parameters:
connectionUri
-- Returns:
-
client
public static SqlClient client(String connectionUri, PoolOptions poolOptions)
- Parameters:
connectionUri
-poolOptions
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri)
Likeclient(java.lang.String)
with a defaultpoolOptions
.- Parameters:
vertx
-connectionUri
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri, PoolOptions poolOptions)
- Parameters:
vertx
-connectionUri
-poolOptions
-- Returns:
-
client
public static SqlClient client(MySQLConnectOptions connectOptions, PoolOptions poolOptions)
Create a client backed by a connection pool to the database configured with the givenconnectOptions
andpoolOptions
.- Parameters:
connectOptions
-poolOptions
- the options for creating the backing pool- Returns:
- the client
-
client
public static SqlClient client(Vertx vertx, MySQLConnectOptions connectOptions, PoolOptions poolOptions)
Likeclient(java.lang.String)
with a specific instance.- Parameters:
vertx
-connectOptions
-poolOptions
-- Returns:
-
client
public static SqlClient client(Vertx vertx, List<MySQLConnectOptions> mySQLConnectOptions, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.- Parameters:
vertx
-mySQLConnectOptions
-options
-- Returns:
-
client
public static SqlClient client(List<MySQLConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the MySQLdatabases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of databasesoptions
- the options for creating the pool- Returns:
- the pooled client
-
connectHandler
public MySQLPool connectHandler(Handler<SqlConnection> handler)
Description copied from class:Pool
Set an 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.- Overrides:
connectHandler
in classPool
- Parameters:
handler
- the handler- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public MySQLPool connectionProvider(Function<Context,Future<SqlConnection>> provider)
Description copied from class:Pool
Replace the default pool connection provider, the newprovider
returns a future connection for a given .A
ConnectionFactory
can be used as connection provider.- Overrides:
connectionProvider
in classPool
- Parameters:
provider
- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
pool
public static MySQLPool pool(Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Create a connection pool to the MySQLdatabases
. The supplier is called to provide the options when a new connection is created by the pool.- Parameters:
databases
- the server supplieroptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static MySQLPool pool(Vertx vertx, Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
client
public static SqlClient client(Vertx vertx, Supplier<Future<MySQLConnectOptions>> mySQLConnectOptions, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.- Parameters:
vertx
-mySQLConnectOptions
-options
-- Returns:
-
client
public static SqlClient client(Supplier<Future<MySQLConnectOptions>> databases, PoolOptions options)
Create a client backed by a connection pool to the MySQLdatabases
. The supplier is called to provide the options when a new connection is created by the pool.- Parameters:
databases
- the databases supplieroptions
- the options for creating the pool- Returns:
- the pooled client
-
-