Class CassandraClientOptions
java.lang.Object
io.vertx.cassandra.CassandraClientOptions
Eclipse Vert.x Cassandra client options.
- Author:
- Pavel Drankou, Thomas Segismont
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault host for connecting with Cassandra service.static final intDefault port for connecting with Cassandra service. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CassandraClientOptions(com.datastax.oss.driver.api.core.CqlSessionBuilder builder) Constructor using an existingCqlSessionBuilderinstance.Copy constructor.Constructor to create options from JSON. -
Method Summary
Modifier and TypeMethodDescriptionaddContactPoint(String host, int port) Adds a contact point to use for the initial connection to the clusteraddContactPoint(InetSocketAddress address) Adds a contact point to use for the initial connection to the clustercom.datastax.oss.driver.api.core.CqlSessionBuildersetKeyspace(String keyspace) Set the keyspace to use when creating the Cassandra session.setPassword(String password) Set the password for plaintext authentication.setTracingPolicy(TracingPolicy tracingPolicy) Set the tracing policy for the client behavior when Vert.x has tracing enabled.setUsername(String username) Set the username for plaintext authentication.toJson()
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTDefault port for connecting with Cassandra service.- See Also:
-
DEFAULT_HOST
Default host for connecting with Cassandra service.- See Also:
-
-
Constructor Details
-
CassandraClientOptions
public CassandraClientOptions()Default constructor. -
CassandraClientOptions
Copy constructor.- Parameters:
other- The other client to copy from.
-
CassandraClientOptions
public CassandraClientOptions(com.datastax.oss.driver.api.core.CqlSessionBuilder builder) Constructor using an existingCqlSessionBuilderinstance. -
CassandraClientOptions
Constructor to create options from JSON.- Parameters:
json- the JSON
-
-
Method Details
-
toJson
- Returns:
- a JSON representation of these options
-
addContactPoint
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
Adds a contact point to use for the initial connection to the cluster- Parameters:
host- the addressport- 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
- Returns:
- the keyspace to use when creating the Cassandra session
-
setKeyspace
Set the keyspace to use when creating the Cassandra session. Defaults tonull.- Parameters:
keyspace- the keyspace to use when creating the Cassandra session- Returns:
- a reference to this, so the API can be used fluently
-
getUsername
- Returns:
- the username if plaintext authentication is used
-
setUsername
Set the username for plaintext authentication. Defaults tonull.- Parameters:
username- the username for plaintext authentication- Returns:
- a reference to this, so the API can be used fluently
-
getPassword
- Returns:
- the password if plaintext authentication is used
-
setPassword
Set the password for plaintext authentication. Defaults tonull.- Parameters:
password- the username for plaintext authentication- Returns:
- a reference to this, so the API can be used fluently
-
getTracingPolicy
- Returns:
- the tracing policy
-
setTracingPolicy
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
-