|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datastax.driver.core.ProtocolOptions
public class ProtocolOptions
Options of the Cassandra native binary protocol.
Nested Class Summary | |
---|---|
static class |
ProtocolOptions.Compression
Compression supported by the Cassandra binary protocol. |
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default port for Cassandra native binary protocol: 9042. |
Constructor Summary | |
---|---|
ProtocolOptions()
Creates a new ProtocolOptions instance using the DEFAULT_PORT
(and without SSL). |
|
ProtocolOptions(int port)
Creates a new ProtocolOptions instance using the provided port
(without SSL nor authentication). |
|
ProtocolOptions(int port,
SSLOptions sslOptions,
AuthProvider authProvider)
Creates a new ProtocolOptions instance using the provided port
and SSL context. |
Method Summary | |
---|---|
AuthProvider |
getAuthProvider()
The AuthProvider used by this cluster. |
ProtocolOptions.Compression |
getCompression()
Returns the compression used by the protocol. |
int |
getPort()
Returns the port used to connect to the Cassandra hosts. |
SSLOptions |
getSSLOptions()
The SSLOptions used by this cluster. |
ProtocolOptions |
setCompression(ProtocolOptions.Compression compression)
Sets the compression to use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public ProtocolOptions()
ProtocolOptions
instance using the DEFAULT_PORT
(and without SSL).
public ProtocolOptions(int port)
ProtocolOptions
instance using the provided port
(without SSL nor authentication).
This is a shortcut for new ProtocolOptions(port, null, AuthProvider.NONE)
.
port
- the port to use for the binary protocol.public ProtocolOptions(int port, SSLOptions sslOptions, AuthProvider authProvider)
ProtocolOptions
instance using the provided port
and SSL context.
port
- the port to use for the binary protocol.sslOptions
- the SSL options to use. Use null
if SSL is not
to be used.authProvider
- the AuthProvider
to use for authentication against
the Cassandra nodes.Method Detail |
---|
public int getPort()
public ProtocolOptions.Compression getCompression()
By default, compression is not used.
public ProtocolOptions setCompression(ProtocolOptions.Compression compression)
Note that while this setting can be changed at any time, it will only apply to newly created connections.
compression
- the compression algorithm to use (or Compression.NONE
to disable compression).
ProtocolOptions
object.
IllegalStateException
- if the compression requested is not
available. Most compression algorithms require that the relevant be
present in the classpath. If not, the compression will be
unavailable.public SSLOptions getSSLOptions()
SSLOptions
used by this cluster.
SSLOptions
used by this cluster (set at the cluster creation time)
or null
if SSL is not in use.public AuthProvider getAuthProvider()
AuthProvider
used by this cluster.
AuthProvided
used by this cluster (set at the cluster creation
time). If no authentication mechanism is in use (the default), AuthProvided.NONE
will be returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |