Class CassandraClientOptions

java.lang.Object
io.vertx.cassandra.CassandraClientOptions

public class CassandraClientOptions extends Object
Eclipse Vert.x Cassandra client options.
Author:
Pavel Drankou, Thomas Segismont
  • Field Details

    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      Default port for connecting with Cassandra service.
      See Also:
    • DEFAULT_HOST

      public static final String DEFAULT_HOST
      Default host for connecting with Cassandra service.
      See Also:
  • Constructor Details

    • CassandraClientOptions

      public CassandraClientOptions()
      Default constructor.
    • CassandraClientOptions

      public CassandraClientOptions(CassandraClientOptions other)
      Copy constructor.
      Parameters:
      other - The other client to copy from.
    • CassandraClientOptions

      public CassandraClientOptions(com.datastax.oss.driver.api.core.CqlSessionBuilder builder)
      Constructor using an existing CqlSessionBuilder instance.
    • CassandraClientOptions

      public CassandraClientOptions(JsonObject json)
      Constructor to create options from JSON.
      Parameters:
      json - the JSON
  • Method Details

    • toJson

      public JsonObject toJson()
      Returns:
      a JSON representation of these options
    • addContactPoint

      public CassandraClientOptions addContactPoint(InetSocketAddress address)
      Adds a contact point to use for the initial connection to the cluster
      Parameters:
      address - the address
      Returns:
      a reference to this, so the API can be used fluently
    • addContactPoint

      public CassandraClientOptions addContactPoint(String host, int port)
      Adds a contact point to use for the initial connection to the cluster
      Parameters:
      host - the address
      port - the port
      Returns:
      a reference to this, so the API can be used fluently
    • dataStaxClusterBuilder

      public com.datastax.oss.driver.api.core.CqlSessionBuilder dataStaxClusterBuilder()
      Returns:
      a cluster builder, which will be used by the client
    • getKeyspace

      public String getKeyspace()
      Returns:
      the keyspace to use when creating the Cassandra session
    • setKeyspace

      public CassandraClientOptions setKeyspace(String keyspace)
      Set the keyspace to use when creating the Cassandra session. Defaults to null.
      Parameters:
      keyspace - the keyspace to use when creating the Cassandra session
      Returns:
      a reference to this, so the API can be used fluently
    • getUsername

      public String getUsername()
      Returns:
      the username if plaintext authentication is used
    • setUsername

      public CassandraClientOptions setUsername(String username)
      Set the username for plaintext authentication. Defaults to null.
      Parameters:
      username - the username for plaintext authentication
      Returns:
      a reference to this, so the API can be used fluently
    • getPassword

      public String getPassword()
      Returns:
      the password if plaintext authentication is used
    • setPassword

      public CassandraClientOptions setPassword(String password)
      Set the password for plaintext authentication. Defaults to null.
      Parameters:
      password - the username for plaintext authentication
      Returns:
      a reference to this, so the API can be used fluently
    • getTracingPolicy

      public TracingPolicy getTracingPolicy()
      Returns:
      the tracing policy
    • setTracingPolicy

      public CassandraClientOptions setTracingPolicy(TracingPolicy tracingPolicy)
      Set the tracing policy for the client behavior when Vert.x has tracing enabled.
      Parameters:
      tracingPolicy - the tracing policy
      Returns:
      a reference to this, so the API can be used fluently