Package io.vertx.cassandra

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

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `DEFAULT_HOST` | Default host for connecting with Cassandra service.
    `static int` | `DEFAULT_PORT` | Default port for connecting with Cassandra service.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CassandraClientOptions()` | Default constructor.
    `CassandraClientOptions​(com.datastax.oss.driver.api.core.CqlSessionBuilder builder)` | Constructor using an existing `CqlSessionBuilder` instance.
    `CassandraClientOptions​(CassandraClientOptions other)` | Copy constructor.
    `CassandraClientOptions​(JsonObject json)` | Constructor to create options from JSON.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CassandraClientOptions` | `addContactPoint​(String host, int port)` | Adds a contact point to use for the initial connection to the cluster
    `CassandraClientOptions` | `addContactPoint​(InetSocketAddress address)` | Adds a contact point to use for the initial connection to the cluster
    `com.datastax.oss.driver.api.core.CqlSessionBuilder` | `dataStaxClusterBuilder()` |
    `String` | `getKeyspace()` |
    `String` | `getPassword()` |
    `TracingPolicy` | `getTracingPolicy()` |
    `String` | `getUsername()` |
    `CassandraClientOptions` | `setKeyspace​(String keyspace)` | Set the keyspace to use when creating the Cassandra session.
    `CassandraClientOptions` | `setPassword​(String password)` | Set the password for plaintext authentication.
    `CassandraClientOptions` | `setTracingPolicy​(TracingPolicy tracingPolicy)` | Set the tracing policy for the client behavior when Vert.x has tracing enabled.
    `CassandraClientOptions` | `setUsername​(String username)` | Set the username for plaintext authentication.
    `JsonObject` | `toJson()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      Default port for connecting with Cassandra service.
      See Also:
        Constant Field Values

    - #### DEFAULT_HOST

          public static final String DEFAULT_HOST

      Default host for connecting with Cassandra service.
      See Also:
        Constant Field Values

  - ### Constructor Detail

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

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