io.vertx.cassandra

## Interface CassandraClient

-     public interface CassandraClient

  Eclipse Vert.x Cassandra client.
  Author:
    Pavel Drankou, Thomas Segismont

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_SHARED_CLIENT_NAME` The default shared client name.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Future<Void>` | `close()` Like `close(Handler)` but returns a `Future` of the asynchronous result.
    `CassandraClient` | `close(Handler<AsyncResult<Void>> closeHandler)` Closes this client.
    `static CassandraClient` | `create(Vertx vertx)` Like `create(Vertx, CassandraClientOptions)` 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)` Like `createShared(Vertx, String, CassandraClientOptions)` with default options and client name.
    `static CassandraClient` | `createShared(Vertx vertx, CassandraClientOptions options)` Like `createShared(Vertx, String, CassandraClientOptions)` with default client name.
    `static CassandraClient` | `createShared(Vertx vertx, String clientName)` Like `createShared(Vertx, String, CassandraClientOptions)` 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.
    `Future<ResultSet>` | `execute(com.datastax.oss.driver.api.core.cql.Statement statement)` Like `execute(Statement, Handler)` but returns a `Future` of the asynchronous result.
    `<R> Future<R>` | `execute(com.datastax.oss.driver.api.core.cql.Statement statement, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)` Like `execute(Statement, Collector, Handler)` but returns a `Future` of the asynchronous result.
    `<R> CassandraClient` | `execute(com.datastax.oss.driver.api.core.cql.Statement statement, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector, Handler<AsyncResult<R>> resultHandler)` Execute a statement and produce a result by applying a collector to result set rows.
    `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.
    `Future<ResultSet>` | `execute(String query)` Like `execute(String, Handler)` but returns a `Future` of the asynchronous result.
    `<R> Future<R>` | `execute(String query, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)` Like `execute(String, Collector, Handler)` but returns a `Future` of the asynchronous result.
    `<R> CassandraClient` | `execute(String query, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector, Handler<AsyncResult<R>> resultHandler)` Execute a query and produce a result by applying a collector to result set rows.
    `CassandraClient` | `execute(String query, Handler<AsyncResult<ResultSet>> resultHandler)` Execute the query and provide a handler for consuming results.
    `Future<List<com.datastax.oss.driver.api.core.cql.Row>>` | `executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)` Like `executeWithFullFetch(Statement, Handler)` but returns a `Future` of the asynchronous result.
    `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.
    `Future<List<com.datastax.oss.driver.api.core.cql.Row>>` | `executeWithFullFetch(String query)` Like `executeWithFullFetch(String, Handler)` but returns a `Future` of the asynchronous result.
    `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.
    `boolean` | `isConnected()`
    `Future<com.datastax.oss.driver.api.core.metadata.Metadata>` | `metadata()` Like `metadata(Handler)` but returns a `Future` of the asynchronous result.
    `void` | `metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)` Get `Metadata` for the session.
    `Future<com.datastax.oss.driver.api.core.cql.PreparedStatement>` | `prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)` Like `prepare(SimpleStatement, Handler)` but returns a `Future` of the asynchronous result.
    `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 `SimpleStatement`.
    `Future<com.datastax.oss.driver.api.core.cql.PreparedStatement>` | `prepare(String query)` Like `prepare(String, Handler)` but returns a `Future` of the asynchronous result.
    `CassandraClient` | `prepare(String query, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)` Prepares the provided query string.
    `Future<CassandraRowStream>` | `queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)` Like `queryStream(Statement, Handler)` but returns a `Future` of the asynchronous result.
    `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.
    `Future<CassandraRowStream>` | `queryStream(String sql)` Like `queryStream(String, Handler)` but returns a `Future` of the asynchronous result.
    `CassandraClient` | `queryStream(String sql, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)` Executes the given SQL `SELECT` statement which returns the results of the query as a read stream.

- - ### Field Detail

    - #### DEFAULT_SHARED_CLIENT_NAME

          static final String DEFAULT_SHARED_CLIENT_NAME

      The default shared client name.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### create

          static CassandraClient create(Vertx vertx)

      Like `create(Vertx, CassandraClientOptions)` with default options.

    - #### create

          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 instance
        `options` - the options
      Returns:
        the client

    - #### createShared

          static CassandraClient createShared(Vertx vertx)

      Like `createShared(Vertx, String, CassandraClientOptions)` with default options and client name.

    - #### createShared

          static CassandraClient createShared(Vertx vertx,
                                              String clientName)

      Like `createShared(Vertx, String, CassandraClientOptions)` with default options.

    - #### createShared

          static CassandraClient createShared(Vertx vertx,
                                              CassandraClientOptions options)

      Like `createShared(Vertx, String, CassandraClientOptions)` with default client name.

    - #### createShared

          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 instance
        `options` - the options
        `clientName` - the shared client name
      Returns:
        the client

    - #### isConnected

          boolean isConnected()

      Returns:
        whether this Cassandra client instance is connected

    - #### executeWithFullFetch

          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:
        `resultHandler` - handler called when result of execution is fully fetched.
        `query` - the query to execute
      Returns:
        current Cassandra client instance

    - #### executeWithFullFetch

          Future<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(String query)

      Like `executeWithFullFetch(String, Handler)` but returns a `Future` of the asynchronous result.

    - #### executeWithFullFetch

          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:
        `resultHandler` - handler called when result of execution is fully fetched.
        `statement` - the statement to execute
      Returns:
        current Cassandra client instance

    - #### executeWithFullFetch

          Future<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)

      Like `executeWithFullFetch(Statement, Handler)` but returns a `Future` of the asynchronous result.

    - #### execute

          CassandraClient execute(String query,
                                  Handler<AsyncResult<ResultSet>> resultHandler)

      Execute the query and provide a handler for consuming results.
      Parameters:
        `resultHandler` - handler called when result of execution is present, but can be not fully fetched
        `query` - the query to execute
      Returns:
        current Cassandra client instance

    - #### execute

          Future<ResultSet> execute(String query)

      Like `execute(String, Handler)` but returns a `Future` of the asynchronous result.

    - #### execute

          <R> CassandraClient execute(String query,
                                      java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector,
                                      Handler<AsyncResult<R>> resultHandler)

      Execute a query and produce a result by applying a collector to result set rows.
      Type Parameters:
        `R` - the result type
      Parameters:
        `query` - the query to execute
        `collector` - the collector to use to produce a result
        `resultHandler` - the handler called when result of execution and collection is present
      Returns:
        current Cassandra client instance

    - #### execute

          <R> Future<R> execute(String query,
                                java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)

      Like `execute(String, Collector, Handler)` but returns a `Future` of the asynchronous result.

    - #### execute

          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:
        `resultHandler` - handler called when result of execution is present
        `statement` - the statement to execute
      Returns:
        current Cassandra client instance

    - #### execute

          Future<ResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement statement)

      Like `execute(Statement, Handler)` but returns a `Future` of the asynchronous result.

    - #### execute

          <R> CassandraClient execute(com.datastax.oss.driver.api.core.cql.Statement statement,
                                      java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector,
                                      Handler<AsyncResult<R>> resultHandler)

      Execute a statement and produce a result by applying a collector to result set rows.
      Type Parameters:
        `R` - the result type
      Parameters:
        `statement` - the statement to execute
        `collector` - the collector to use to produce a result
        `resultHandler` - the handler called when result of execution and collection is present
      Returns:
        current Cassandra client instance

    - #### execute

          <R> Future<R> execute(com.datastax.oss.driver.api.core.cql.Statement statement,
                                java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)

      Like `execute(Statement, Collector, Handler)` but returns a `Future` of the asynchronous result.

    - #### prepare

          CassandraClient prepare(String query,
                                  Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)

      Prepares the provided query string.
      Parameters:
        `resultHandler` - handler called when result of query preparation is present
        `query` - the query to prepare
      Returns:
        current Cassandra client instance

    - #### prepare

          Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(String query)

      Like `prepare(String, Handler)` but returns a `Future` of the asynchronous result.

    - #### prepare

          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 `SimpleStatement`.
      Parameters:
        `resultHandler` - handler called when result of query preparation is present
        `statement` - the statement to prepare
      Returns:
        current Cassandra client instance

    - #### prepare

          Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)

      Like `prepare(SimpleStatement, Handler)` but returns a `Future` of the asynchronous result.

    - #### queryStream

          CassandraClient queryStream(String sql,
                                      Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)

      Executes the given SQL `SELECT` statement which returns the results of the query as a read stream.
      Parameters:
        `sql` - the SQL to execute. For example `SELECT * FROM table ...`.
        `rowStreamHandler` - the handler which is called once the operation completes. It will return an instance of `CassandraRowStream`.
      Returns:
        current Cassandra client instance

    - #### queryStream

          Future<CassandraRowStream> queryStream(String sql)

      Like `queryStream(String, Handler)` but returns a `Future` of the asynchronous result.

    - #### queryStream

          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 of `CassandraRowStream`.
      Returns:
        current Cassandra client instance

    - #### queryStream

          Future<CassandraRowStream> queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)

      Like `queryStream(Statement, Handler)` but returns a `Future` of the asynchronous result.

    - #### close

          Future<Void> close()

      Like `close(Handler)` but returns a `Future` of the asynchronous result.

    - #### close

          CassandraClient close(Handler<AsyncResult<Void>> closeHandler)

      Closes this client.
      Parameters:
        `closeHandler` - handler called when client is closed
      Returns:
        current Cassandra client instance

    - #### metadata

          void metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)

      Get `Metadata` for the session.
      Parameters:
        `handler` - the handler called backed with the metadata

    - #### metadata

          Future<com.datastax.oss.driver.api.core.metadata.Metadata> metadata()

      Like `metadata(Handler)` but returns a `Future` of the asynchronous result.

Copyright © 2024 Eclipse. All rights reserved.