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 Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CassandraClient` | `close()` Closes this client.
    `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` | `createNonShared(Vertx vertx)` Deprecated. use `create(Vertx)` instead
    `static CassandraClient` | `createNonShared(Vertx vertx, CassandraClientOptions options)` Deprecated. use `create(Vertx, CassandraClientOptions)` instead
    `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.
    `<R> CassandraClient` | `execute(com.datastax.driver.core.Statement statement, java.util.stream.Collector<com.datastax.driver.core.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.driver.core.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)` Execute the statement and provide a handler for consuming results.
    `<R> CassandraClient` | `execute(String query, java.util.stream.Collector<com.datastax.driver.core.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.
    `CassandraClient` | `executeWithFullFetch(com.datastax.driver.core.Statement statement, Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)` Execute the query and provide a handler for consuming results.
    `CassandraClient` | `executeWithFullFetch(String query, Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)` Execute the query and provide a handler for consuming results.
    `boolean` | `isConnected()`
    `CassandraClient` | `prepare(String query, Handler<AsyncResult<com.datastax.driver.core.PreparedStatement>> resultHandler)` Prepares the provided query string.
    `CassandraClient` | `queryStream(com.datastax.driver.core.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, 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

    - #### createNonShared

          @Deprecated
          static CassandraClient createNonShared(Vertx vertx)

      Deprecated. use `create(Vertx)` instead

    - #### create

          static CassandraClient create(Vertx vertx)

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

    - #### createNonShared

          @Deprecated
          static CassandraClient createNonShared(Vertx vertx,
                                                             CassandraClientOptions options)

      Deprecated. use `create(Vertx, CassandraClientOptions)` instead

    - #### 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.driver.core.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

          CassandraClient executeWithFullFetch(com.datastax.driver.core.Statement statement,
                                               Handler<AsyncResult<List<com.datastax.driver.core.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

    - #### 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

          <R> CassandraClient execute(String query,
                                      java.util.stream.Collector<com.datastax.driver.core.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

          CassandraClient execute(com.datastax.driver.core.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

          <R> CassandraClient execute(com.datastax.driver.core.Statement statement,
                                      java.util.stream.Collector<com.datastax.driver.core.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

    - #### prepare

          CassandraClient prepare(String query,
                                  Handler<AsyncResult<com.datastax.driver.core.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

    - #### 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

          CassandraClient queryStream(com.datastax.driver.core.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

    - #### close

          CassandraClient close()

      Closes this client.
      Returns:
        current Cassandra client instance

    - #### close

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

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

Copyright © 2021 Eclipse. All rights reserved.