Class CassandraClient


  • public class CassandraClient
    extends Object
    Eclipse Vert.x Cassandra client.

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

    • Constructor Detail

      • CassandraClient

        public CassandraClient​(io.vertx.cassandra.CassandraClient delegate)
      • CassandraClient

        public CassandraClient​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.cassandra.CassandraClient getDelegate()
      • hashCode

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

        public static CassandraClient create​(Vertx vertx,
                                             io.vertx.cassandra.CassandraClientOptions options)
        Parameters:
        vertx - the Vert.x instance
        options - the options
        Returns:
        the client
      • createShared

        public static CassandraClient createShared​(Vertx vertx)
        Parameters:
        vertx -
        Returns:
      • createShared

        public static CassandraClient createShared​(Vertx vertx,
                                                   String clientName)
        Parameters:
        vertx -
        clientName -
        Returns:
      • createShared

        public static CassandraClient createShared​(Vertx vertx,
                                                   io.vertx.cassandra.CassandraClientOptions options)
        Parameters:
        vertx -
        options -
        Returns:
      • createShared

        public static CassandraClient createShared​(Vertx vertx,
                                                   String clientName,
                                                   io.vertx.cassandra.CassandraClientOptions options)
        Parameters:
        vertx - the Vert.x instance
        clientName - the shared client name
        options - the options
        Returns:
        the client
      • isConnected

        public boolean isConnected()
        Returns:
        whether this Cassandra client instance is connected
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        query - the query to execute
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • executeAndAwait

        public ResultSet executeAndAwait​(String query)
        Blocking variant of execute(String).

        This method waits 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 ResultSet instance produced by the operation.
      • executeAndForget

        public CassandraClient executeAndForget​(String query)
        Variant of execute(String) that ignores the result of the operation.

        This method subscribes on the result of execute(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from execute(String) but you don't need to compose it with other operations.

        Parameters:
        query - the query to execute
        Returns:
        the instance of CassandraClient to chain method calls.
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        sql - the SQL to execute. For example SELECT * FROM table ....
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • queryStreamAndAwait

        public CassandraRowStream queryStreamAndAwait​(String sql)
        Blocking variant of queryStream(String).

        This method waits 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 CassandraRowStream instance produced by the operation.
      • queryStreamAndForget

        public CassandraClient queryStreamAndForget​(String sql)
        Variant of queryStream(String) that ignores the result of the operation.

        This method subscribes on the result of queryStream(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from queryStream(String) but you don't need to compose it with other operations.

        Parameters:
        sql - the SQL to execute. For example SELECT * FROM table ....
        Returns:
        the instance of CassandraClient to chain method calls.
      • close

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

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • closeAndAwait

        public Void closeAndAwait()
        Blocking variant of close().

        This method waits 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 Void instance produced by the operation.
      • closeAndForget

        public CassandraClient closeAndForget()
        Variant of close() that ignores the result of the operation.

        This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

        Returns:
        the instance of CassandraClient to chain method calls.
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        query - the query to execute
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • executeWithFullFetchAndAwait

        public List<com.datastax.oss.driver.api.core.cql.Row> executeWithFullFetchAndAwait​(String query)
        Blocking variant of executeWithFullFetch(String).

        This method waits 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 List instance produced by the operation.
      • executeWithFullFetchAndForget

        public void executeWithFullFetchAndForget​(String query)
        Variant of executeWithFullFetch(String) that ignores the result of the operation.

        This method subscribes on the result of executeWithFullFetch(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from executeWithFullFetch(String) but you don't need to compose it with other operations.

        Parameters:
        query - the query to execute
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        statement - the statement to execute
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • executeWithFullFetchAndAwait

        public List<com.datastax.oss.driver.api.core.cql.Row> executeWithFullFetchAndAwait​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Blocking variant of executeWithFullFetch(Statement).

        This method waits 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 List instance produced by the operation.
      • executeWithFullFetchAndForget

        public void executeWithFullFetchAndForget​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Variant of executeWithFullFetch(Statement) that ignores the result of the operation.

        This method subscribes on the result of executeWithFullFetch(Statement), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from executeWithFullFetch(Statement) but you don't need to compose it with other operations.

        Parameters:
        statement - the statement to execute
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        statement - the statement to execute
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • executeAndAwait

        public ResultSet executeAndAwait​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Blocking variant of execute(Statement).

        This method waits 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 ResultSet instance produced by the operation.
      • executeAndForget

        public CassandraClient executeAndForget​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Variant of execute(Statement) that ignores the result of the operation.

        This method subscribes on the result of execute(Statement), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from execute(Statement) but you don't need to compose it with other operations.

        Parameters:
        statement - the statement to execute
        Returns:
        the instance of CassandraClient to chain method calls.
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        query - the query to prepare
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • prepareAndAwait

        public com.datastax.oss.driver.api.core.cql.PreparedStatement prepareAndAwait​(String query)
        Blocking variant of prepare(String).

        This method waits 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 PreparedStatement instance produced by the operation.
      • prepareAndForget

        public void prepareAndForget​(String query)
        Variant of prepare(String) that ignores the result of the operation.

        This method subscribes on the result of prepare(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from prepare(String) but you don't need to compose it with other operations.

        Parameters:
        query - the query to prepare
      • 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 .

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        statement - the statement to prepare
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • prepareAndAwait

        public com.datastax.oss.driver.api.core.cql.PreparedStatement prepareAndAwait​(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
        Blocking variant of prepare(SimpleStatement).

        This method waits 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 PreparedStatement instance produced by the operation.
      • prepareAndForget

        public void prepareAndForget​(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
        Variant of prepare(SimpleStatement) that ignores the result of the operation.

        This method subscribes on the result of prepare(SimpleStatement), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from prepare(SimpleStatement) but you don't need to compose it with other operations.

        Parameters:
        statement - the statement to prepare
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        statement - the statement to execute.
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • queryStreamAndAwait

        public CassandraRowStream queryStreamAndAwait​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Blocking variant of queryStream(Statement).

        This method waits 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 CassandraRowStream instance produced by the operation.
      • queryStreamAndForget

        public CassandraClient queryStreamAndForget​(com.datastax.oss.driver.api.core.cql.Statement statement)
        Variant of queryStream(Statement) that ignores the result of the operation.

        This method subscribes on the result of queryStream(Statement), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from queryStream(Statement) but you don't need to compose it with other operations.

        Parameters:
        statement - the statement to execute.
        Returns:
        the instance of CassandraClient to chain method calls.
      • metadata

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

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • metadataAndAwait

        public com.datastax.oss.driver.api.core.metadata.Metadata metadataAndAwait()
        Blocking variant of metadata().

        This method waits 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 Metadata instance produced by the operation.
      • metadataAndForget

        public void metadataAndForget()
        Variant of metadata() that ignores the result of the operation.

        This method subscribes on the result of metadata(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from metadata() but you don't need to compose it with other operations.

      • newInstance

        public static CassandraClient newInstance​(io.vertx.cassandra.CassandraClient arg)