Class CassandraClient

java.lang.Object
io.vertx.mutiny.cassandra.CassandraClient
All Implemented Interfaces:
MutinyDelegate

public class CassandraClient extends Object implements MutinyDelegate
Eclipse Vert.x Cassandra client.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Pavel Drankou, Thomas Segismont
See Also:
  • CassandraClient
  • Field Details

  • Constructor Details

    • CassandraClient

      public CassandraClient(io.vertx.cassandra.CassandraClient delegate)
      Create a new instance of CassandraClient delegating to the given (non-null) instance of CassandraClient.
    • CassandraClient

      public CassandraClient(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.cassandra.CassandraClient getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • executeWithFullFetch

      @CheckReturnValue public io.smallrye.mutiny.Uni<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      query - the query to execute
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.executeWithFullFetch(String)
    • executeWithFullFetchAndAwait

      public List<com.datastax.oss.driver.api.core.cql.Row> executeWithFullFetchAndAwait(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a List<com.datastax.oss.driver.api.core.cql.Row>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      query - the query to execute
      Returns:
      The operation result
      See Also:
      • CassandraClient.executeWithFullFetch(String)
    • executeWithFullFetchAndForget

      public CassandraClient executeWithFullFetchAndForget(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method ignores the List<com.datastax.oss.driver.api.core.cql.Row> result or any failure.

      Parameters:
      query - the query to execute
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.executeWithFullFetch(String)
    • executeWithFullFetch

      @CheckReturnValue public io.smallrye.mutiny.Uni<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      statement - the statement to execute
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.executeWithFullFetch(Statement)
    • executeWithFullFetchAndAwait

      public List<com.datastax.oss.driver.api.core.cql.Row> executeWithFullFetchAndAwait(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a List<com.datastax.oss.driver.api.core.cql.Row>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      statement - the statement to execute
      Returns:
      The operation result
      See Also:
      • CassandraClient.executeWithFullFetch(Statement)
    • executeWithFullFetchAndForget

      public CassandraClient executeWithFullFetchAndForget(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method ignores the List<com.datastax.oss.driver.api.core.cql.Row> result or any failure.

      Parameters:
      statement - the statement to execute
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.executeWithFullFetch(Statement)
    • execute

      @CheckReturnValue public io.smallrye.mutiny.Uni<ResultSet> execute(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      query - the query to execute
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.execute(String)
    • executeAndAwait

      public ResultSet executeAndAwait(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a ResultSet. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      query - the query to execute
      Returns:
      The operation result
      See Also:
      • CassandraClient.execute(String)
    • executeAndForget

      public CassandraClient executeAndForget(String query)
      Execute the query and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method ignores the ResultSet result or any failure.

      Parameters:
      query - the query to execute
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.execute(String)
    • execute

      @CheckReturnValue public io.smallrye.mutiny.Uni<ResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the statement and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      statement - the statement to execute
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.execute(Statement)
    • executeAndAwait

      public ResultSet executeAndAwait(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the statement and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method returns a ResultSet. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      statement - the statement to execute
      Returns:
      The operation result
      See Also:
      • CassandraClient.execute(Statement)
    • executeAndForget

      public CassandraClient executeAndForget(com.datastax.oss.driver.api.core.cql.Statement statement)
      Execute the statement and provide a handler for consuming results.

      Unlike the bare Vert.x variant, this method ignores the ResultSet result or any failure.

      Parameters:
      statement - the statement to execute
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.execute(Statement)
    • prepare

      @CheckReturnValue public io.smallrye.mutiny.Uni<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(String query)
      Prepares the provided query string.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      query - the query to prepare
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.prepare(String)
    • prepareAndAwait

      public com.datastax.oss.driver.api.core.cql.PreparedStatement prepareAndAwait(String query)
      Prepares the provided query string.

      Unlike the bare Vert.x variant, this method returns a PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      query - the query to prepare
      Returns:
      The operation result
      See Also:
      • CassandraClient.prepare(String)
    • prepareAndForget

      public CassandraClient prepareAndForget(String query)
      Prepares the provided query string.

      Unlike the bare Vert.x variant, this method ignores the PreparedStatement result or any failure.

      Parameters:
      query - the query to prepare
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.prepare(String)
    • prepare

      @CheckReturnValue public io.smallrye.mutiny.Uni<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
      Prepares the provided a SimpleStatement.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      statement - the statement to prepare
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.prepare(SimpleStatement)
    • prepareAndAwait

      public com.datastax.oss.driver.api.core.cql.PreparedStatement prepareAndAwait(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
      Prepares the provided a SimpleStatement.

      Unlike the bare Vert.x variant, this method returns a PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      statement - the statement to prepare
      Returns:
      The operation result
      See Also:
      • CassandraClient.prepare(SimpleStatement)
    • prepareAndForget

      public CassandraClient prepareAndForget(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
      Prepares the provided a SimpleStatement.

      Unlike the bare Vert.x variant, this method ignores the PreparedStatement result or any failure.

      Parameters:
      statement - the statement to prepare
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.prepare(SimpleStatement)
    • queryStream

      @CheckReturnValue public io.smallrye.mutiny.Uni<CassandraRowStream> queryStream(String sql)
      Executes the given SQL SELECT statement which returns the results of the query as a read stream.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      sql - the SQL to execute. For example SELECT * FROM table ....
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.queryStream(String)
    • queryStreamAndAwait

      public CassandraRowStream queryStreamAndAwait(String sql)
      Executes the given SQL SELECT statement which returns the results of the query as a read stream.

      Unlike the bare Vert.x variant, this method returns a CassandraRowStream. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      sql - the SQL to execute. For example SELECT * FROM table ....
      Returns:
      The operation result
      See Also:
      • CassandraClient.queryStream(String)
    • queryStreamAndForget

      public CassandraClient queryStreamAndForget(String sql)
      Executes the given SQL SELECT statement which returns the results of the query as a read stream.

      Unlike the bare Vert.x variant, this method ignores the CassandraRowStream result or any failure.

      Parameters:
      sql - the SQL to execute. For example SELECT * FROM table ....
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.queryStream(String)
    • queryStream

      @CheckReturnValue public io.smallrye.mutiny.Uni<CassandraRowStream> 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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      statement - the statement to execute.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.queryStream(Statement)
    • queryStreamAndAwait

      public CassandraRowStream queryStreamAndAwait(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.

      Unlike the bare Vert.x variant, this method returns a CassandraRowStream. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      statement - the statement to execute.
      Returns:
      The operation result
      See Also:
      • CassandraClient.queryStream(Statement)
    • queryStreamAndForget

      public CassandraClient queryStreamAndForget(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.

      Unlike the bare Vert.x variant, this method ignores the CassandraRowStream result or any failure.

      Parameters:
      statement - the statement to execute.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.queryStream(Statement)
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Closes this client.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.close()
    • closeAndAwait

      public void closeAndAwait()
      Closes this client.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • CassandraClient.close()
    • closeAndForget

      public CassandraClient closeAndForget()
      Closes this client.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.close()
    • metadata

      @CheckReturnValue public io.smallrye.mutiny.Uni<com.datastax.oss.driver.api.core.metadata.Metadata> metadata()
      Get Metadata for the session.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CassandraClient.metadata()
    • metadataAndAwait

      public com.datastax.oss.driver.api.core.metadata.Metadata metadataAndAwait()
      Get Metadata for the session.

      Unlike the bare Vert.x variant, this method returns a Metadata. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • CassandraClient.metadata()
    • metadataAndForget

      public CassandraClient metadataAndForget()
      Get Metadata for the session.

      Unlike the bare Vert.x variant, this method ignores the Metadata result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CassandraClient.metadata()
    • create

      public static CassandraClient create(Vertx vertx)
      Like create(Vertx, CassandraClientOptions) with default options.
    • create

      public static CassandraClient create(Vertx vertx, io.vertx.cassandra.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

      public static CassandraClient createShared(Vertx vertx)
      Like createShared(Vertx, String, CassandraClientOptions) with default options and client name.
    • createShared

      public static CassandraClient createShared(Vertx vertx, String clientName)
    • createShared

      public static CassandraClient createShared(Vertx vertx, io.vertx.cassandra.CassandraClientOptions options)
    • createShared

      public static CassandraClient createShared(Vertx vertx, String clientName, io.vertx.cassandra.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

      public boolean isConnected()
      Returns:
      whether this Cassandra client instance is connected
    • newInstance

      public static CassandraClient newInstance(io.vertx.cassandra.CassandraClient delegate)
      Creates a new instance of the CassandraClient.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object