Package io.vertx.reactivex.cassandra
Class CassandraClient
- java.lang.Object
-
- io.vertx.reactivex.cassandra.CassandraClient
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<CassandraClient>
__TYPE_ARG
static String
DEFAULT_SHARED_CLIENT_NAME
The default shared client name.
-
Constructor Summary
Constructors Constructor Description CassandraClient(CassandraClient delegate)
CassandraClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CassandraClient
close()
Closes this client.CassandraClient
close(Handler<AsyncResult<Void>> closeHandler)
Closes this client.static CassandraClient
create(Vertx vertx)
Likecreate(io.vertx.reactivex.core.Vertx)
with default options.static CassandraClient
create(Vertx vertx, CassandraClientOptions options)
Create a Cassandra client which maintains its own driver session.static CassandraClient
createShared(Vertx vertx)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default options and client name.static CassandraClient
createShared(Vertx vertx, CassandraClientOptions options)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default client name.static CassandraClient
createShared(Vertx vertx, String clientName)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default options.static CassandraClient
createShared(Vertx vertx, String clientName, CassandraClientOptions options)
Create a Cassandra client that shares its driver session with any other client having the same name.boolean
equals(Object o)
CassandraClient
execute(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the statement and provide a handler for consuming results.CassandraClient
execute(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)
Execute the statement and provide a handler for consuming results.CassandraClient
execute(String query)
Execute the query and provide a handler for consuming results.CassandraClient
execute(String query, Handler<AsyncResult<ResultSet>> resultHandler)
Execute the query and provide a handler for consuming results.CassandraClient
executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the query and provide a handler for consuming results.CassandraClient
executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.CassandraClient
executeWithFullFetch(String query)
Execute the query and provide a handler for consuming results.CassandraClient
executeWithFullFetch(String query, Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.CassandraClient
getDelegate()
int
hashCode()
boolean
isConnected()
void
metadata()
Get for the session.void
metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)
Get for the session.static CassandraClient
newInstance(CassandraClient arg)
CassandraClient
prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Prepares the provided a .CassandraClient
prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided a .CassandraClient
prepare(String query)
Prepares the provided query string.CassandraClient
prepare(String query, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided query string.CassandraClient
queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
Executes the given SQL statement which returns the results of the query as a read stream.CassandraClient
queryStream(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQL statement which returns the results of the query as a read stream.CassandraClient
queryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.CassandraClient
queryStream(String sql, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.io.reactivex.Completable
rxClose()
Closes this client.io.reactivex.Single<ResultSet>
rxExecute(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the statement and provide a handler for consuming results.io.reactivex.Single<ResultSet>
rxExecute(String query)
Execute the query and provide a handler for consuming results.io.reactivex.Single<List<com.datastax.oss.driver.api.core.cql.Row>>
rxExecuteWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the query and provide a handler for consuming results.io.reactivex.Single<List<com.datastax.oss.driver.api.core.cql.Row>>
rxExecuteWithFullFetch(String query)
Execute the query and provide a handler for consuming results.io.reactivex.Single<com.datastax.oss.driver.api.core.metadata.Metadata>
rxMetadata()
Get for the session.io.reactivex.Single<com.datastax.oss.driver.api.core.cql.PreparedStatement>
rxPrepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Prepares the provided a .io.reactivex.Single<com.datastax.oss.driver.api.core.cql.PreparedStatement>
rxPrepare(String query)
Prepares the provided query string.io.reactivex.Single<CassandraRowStream>
rxQueryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
Executes the given SQL statement which returns the results of the query as a read stream.io.reactivex.Single<CassandraRowStream>
rxQueryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<CassandraClient> __TYPE_ARG
-
DEFAULT_SHARED_CLIENT_NAME
public static final String DEFAULT_SHARED_CLIENT_NAME
The default shared client name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CassandraClient
public CassandraClient(CassandraClient delegate)
-
CassandraClient
public CassandraClient(Object delegate)
-
-
Method Detail
-
getDelegate
public CassandraClient getDelegate()
-
create
public static CassandraClient create(Vertx vertx)
Likecreate(io.vertx.reactivex.core.Vertx)
with default options.- Parameters:
vertx
-- Returns:
-
create
public static CassandraClient create(Vertx vertx, CassandraClientOptions options)
Create a Cassandra client which maintains its own driver session.It is not recommended to create several non shared clients in an application.
- Parameters:
vertx
- the Vert.x instanceoptions
- the options- Returns:
- the client
-
createShared
public static CassandraClient createShared(Vertx vertx)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default options and client name.- Parameters:
vertx
-- Returns:
-
createShared
public static CassandraClient createShared(Vertx vertx, String clientName)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default options.- Parameters:
vertx
-clientName
-- Returns:
-
createShared
public static CassandraClient createShared(Vertx vertx, CassandraClientOptions options)
LikecreateShared(io.vertx.reactivex.core.Vertx)
with default client name.- Parameters:
vertx
-options
-- Returns:
-
createShared
public static CassandraClient createShared(Vertx vertx, String clientName, CassandraClientOptions options)
Create a Cassandra client that shares its driver session with any other client having the same name.- Parameters:
vertx
- the Vert.x instanceclientName
- the shared client nameoptions
- the options- Returns:
- the client
-
isConnected
public boolean isConnected()
- Returns:
- whether this Cassandra client instance is connected
-
execute
public CassandraClient execute(String query, Handler<AsyncResult<ResultSet>> resultHandler)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to executeresultHandler
- handler called when result of execution is present, but can be not fully fetched- Returns:
- current Cassandra client instance
-
execute
public CassandraClient execute(String query)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to execute- Returns:
- current Cassandra client instance
-
rxExecute
public io.reactivex.Single<ResultSet> rxExecute(String query)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to execute- Returns:
- current Cassandra client instance
-
queryStream
public CassandraClient queryStream(String sql, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.rowStreamHandler
- the handler which is called once the operation completes. It will return an instance ofCassandraRowStream
.- Returns:
- current Cassandra client instance
-
queryStream
public CassandraClient queryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
- current Cassandra client instance
-
rxQueryStream
public io.reactivex.Single<CassandraRowStream> rxQueryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
- current Cassandra client instance
-
close
public CassandraClient close(Handler<AsyncResult<Void>> closeHandler)
Closes this client.- Parameters:
closeHandler
- handler called when client is closed- Returns:
- current Cassandra client instance
-
close
public CassandraClient close()
Closes this client.- Returns:
- current Cassandra client instance
-
rxClose
public io.reactivex.Completable rxClose()
Closes this client.- Returns:
- current Cassandra client instance
-
executeWithFullFetch
public CassandraClient executeWithFullFetch(String query, Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to executeresultHandler
- handler called when result of execution is fully fetched.- Returns:
- current Cassandra client instance
-
executeWithFullFetch
public CassandraClient executeWithFullFetch(String query)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to execute- Returns:
- current Cassandra client instance
-
rxExecuteWithFullFetch
public io.reactivex.Single<List<com.datastax.oss.driver.api.core.cql.Row>> rxExecuteWithFullFetch(String query)
Execute the query and provide a handler for consuming results.- Parameters:
query
- the query to execute- Returns:
- current Cassandra client instance
-
executeWithFullFetch
public CassandraClient executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.- Parameters:
statement
- the statement to executeresultHandler
- handler called when result of execution is fully fetched.- Returns:
- current Cassandra client instance
-
executeWithFullFetch
public CassandraClient executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the query and provide a handler for consuming results.- Parameters:
statement
- the statement to execute- Returns:
- current Cassandra client instance
-
rxExecuteWithFullFetch
public io.reactivex.Single<List<com.datastax.oss.driver.api.core.cql.Row>> rxExecuteWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the query and provide a handler for consuming results.- Parameters:
statement
- the statement to execute- Returns:
- current Cassandra client instance
-
execute
public CassandraClient execute(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)
Execute the statement and provide a handler for consuming results.- Parameters:
statement
- the statement to executeresultHandler
- handler called when result of execution is present- Returns:
- current Cassandra client instance
-
execute
public CassandraClient execute(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the statement and provide a handler for consuming results.- Parameters:
statement
- the statement to execute- Returns:
- current Cassandra client instance
-
rxExecute
public io.reactivex.Single<ResultSet> rxExecute(com.datastax.oss.driver.api.core.cql.Statement statement)
Execute the statement and provide a handler for consuming results.- Parameters:
statement
- the statement to execute- Returns:
- current Cassandra client instance
-
prepare
public CassandraClient prepare(String query, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided query string.- Parameters:
query
- the query to prepareresultHandler
- handler called when result of query preparation is present- Returns:
- current Cassandra client instance
-
prepare
public CassandraClient prepare(String query)
Prepares the provided query string.- Parameters:
query
- the query to prepare- Returns:
- current Cassandra client instance
-
rxPrepare
public io.reactivex.Single<com.datastax.oss.driver.api.core.cql.PreparedStatement> rxPrepare(String query)
Prepares the provided query string.- Parameters:
query
- the query to prepare- Returns:
- current Cassandra client instance
-
prepare
public CassandraClient prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided a .- Parameters:
statement
- the statement to prepareresultHandler
- handler called when result of query preparation is present- Returns:
- current Cassandra client instance
-
prepare
public CassandraClient prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Prepares the provided a .- Parameters:
statement
- the statement to prepare- Returns:
- current Cassandra client instance
-
rxPrepare
public io.reactivex.Single<com.datastax.oss.driver.api.core.cql.PreparedStatement> rxPrepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Prepares the provided a .- Parameters:
statement
- the statement to prepare- Returns:
- current Cassandra client instance
-
queryStream
public CassandraClient queryStream(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQL statement which returns the results of the query as a read stream.- Parameters:
statement
- the statement to execute.rowStreamHandler
- the handler which is called once the operation completes. It will return an instance ofCassandraRowStream
.- Returns:
- current Cassandra client instance
-
queryStream
public CassandraClient queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
Executes the given SQL statement which returns the results of the query as a read stream.- Parameters:
statement
- the statement to execute.- Returns:
- current Cassandra client instance
-
rxQueryStream
public io.reactivex.Single<CassandraRowStream> rxQueryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
Executes the given SQL statement which returns the results of the query as a read stream.- Parameters:
statement
- the statement to execute.- Returns:
- current Cassandra client instance
-
metadata
public void metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)
Get for the session.- Parameters:
handler
- the handler called backed with the metadata
-
metadata
public void metadata()
Get for the session.
-
rxMetadata
public io.reactivex.Single<com.datastax.oss.driver.api.core.metadata.Metadata> rxMetadata()
Get for the session.- Returns:
-
newInstance
public static CassandraClient newInstance(CassandraClient arg)
-
-