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_POOL_NAME` The name of the default pool

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `CassandraClient` | `connect()` Connect to a Cassandra service.
    `CassandraClient` | `connect(Handler<AsyncResult<Void>> connectHandler)` Connect to a Cassandra service.
    `CassandraClient` | `connect(String keyspace, Handler<AsyncResult<Void>> connectHandler)` Connect to a Cassandra service.
    `static CassandraClient` | `createNonShared(Vertx vertx)` Like `createNonShared(Vertx, CassandraClientOptions)` but with default client options.
    `static CassandraClient` | `createNonShared(Vertx vertx, CassandraClientOptions cassandraClientOptions)` Create a Cassandra client which maintains its own data source.
    `static CassandraClient` | `createShared(Vertx vertx)` Like `createShared(Vertx, String, CassandraClientOptions)`, but with default client options and datasource.
    `static CassandraClient` | `createShared(Vertx vertx, CassandraClientOptions cassandraClientOptions)` Like `createShared(Vertx, String, CassandraClientOptions)`, but with datasource name.
    `static CassandraClient` | `createShared(Vertx vertx, String datasourceName)` Like `createShared(Vertx, String, CassandraClientOptions)`, but with default client options.
    `static CassandraClient` | `createShared(Vertx vertx, String datasourceName, CassandraClientOptions cassandraClientOptions)` Create a Cassandra client which shares its data source with any other Cassandra clients created with the same data source name.
    `CassandraClient` | `disconnect()` Disconnects from the Cassandra service.
    `CassandraClient` | `disconnect(Handler<AsyncResult<Void>> disconnectHandler)` Disconnects from the Cassandra service.
    `CassandraClient` | `execute(com.datastax.driver.core.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)` Execute the statement 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.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_POOL_NAME

          static final String DEFAULT_POOL_NAME

      The name of the default pool
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createNonShared

          static CassandraClient createNonShared(Vertx vertx)

      Like `createNonShared(Vertx, CassandraClientOptions)` but with default client options.

    - #### createNonShared

          static CassandraClient createNonShared(Vertx vertx,
                                                 CassandraClientOptions cassandraClientOptions)

      Create a Cassandra client which maintains its own data source.

      It is not recommended to create several non shared clients in an application. Your application should either use only single non shared client, or use shared client. This is because `CassandraClient` backed by `Session`. And Datastax does not recommended to have several `Session` instances. Better to have only one, and share it.

      Parameters:
        `vertx` - the Vert.x instance
        `cassandraClientOptions` - the options
      Returns:
        the client

    - #### createShared

          static CassandraClient createShared(Vertx vertx)

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

    - #### createShared

          static CassandraClient createShared(Vertx vertx,
                                              String datasourceName)

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

    - #### createShared

          static CassandraClient createShared(Vertx vertx,
                                              CassandraClientOptions cassandraClientOptions)

      Like `createShared(Vertx, String, CassandraClientOptions)`, but with datasource name.

    - #### createShared

          static CassandraClient createShared(Vertx vertx,
                                              String datasourceName,
                                              CassandraClientOptions cassandraClientOptions)

      Create a Cassandra client which shares its data source with any other Cassandra clients created with the same data source name.
      Parameters:
        `vertx` - the Vert.x instance
        `cassandraClientOptions` - the options
        `datasourceName` - the data source name
      Returns:
        the client

    - #### connect

          CassandraClient connect()

      Connect to a Cassandra service.
      Returns:
        current Cassandra client instance

    - #### isConnected

          boolean isConnected()

      Returns:
        whether this Cassandra client instance connected.

    - #### connect

          CassandraClient connect(Handler<AsyncResult<Void>> connectHandler)

      Connect to a Cassandra service.
      Parameters:
        `connectHandler` - handler called when asynchronous connect call ends
      Returns:
        current Cassandra client instance

    - #### connect

          CassandraClient connect(String keyspace,
                                  Handler<AsyncResult<Void>> connectHandler)

      Connect to a Cassandra service.
      Parameters:
        `keyspace` - The name of the keyspace to use for the created connection.
        `connectHandler` - handler called when asynchronous connect call ends
      Returns:
        current Cassandra client instance

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

          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

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

    - #### disconnect

          CassandraClient disconnect()

      Disconnects from the Cassandra service.
      Returns:
        current Cassandra client instance

    - #### disconnect

          CassandraClient disconnect(Handler<AsyncResult<Void>> disconnectHandler)

      Disconnects from the Cassandra service.
      Parameters:
        `disconnectHandler` - handler called when asynchronous disconnect call ends
      Returns:
        current Cassandra client instance

Copyright © 2019 Eclipse. All rights reserved.