Package com.datastax.driver.core
Class Configuration.Builder
- java.lang.Object
-
- com.datastax.driver.core.Configuration.Builder
-
- Enclosing class:
- Configuration
public static class Configuration.Builder extends Object
A builder to create a newConfigurationobject.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configurationbuild()Builds the final object from this builder.QueryOptionsgetQueryOptions()Configuration.BuilderwithApplicationInfo(ApplicationInfo applicationInfo)Sets application information provider.Configuration.BuilderwithCodecRegistry(CodecRegistry codecRegistry)Sets the codec registry for this cluster.Configuration.BuilderwithDefaultKeyspace(String keyspace)Configuration.BuilderwithDriverConfigReporting(boolean driverConfigReportingEnabled)Enables or disables driver configuration reporting (theDRIVER_CONFIGstartup option sent by the control connection).Configuration.BuilderwithMetricsOptions(MetricsOptions metricsOptions)Sets the metrics options for this cluster.Configuration.BuilderwithNettyOptions(NettyOptions nettyOptions)Sets the Netty options for this cluster.Configuration.BuilderwithPolicies(Policies policies)Sets the policies for this cluster.Configuration.BuilderwithPoolingOptions(PoolingOptions poolingOptions)Sets the pooling options for this cluster.Configuration.BuilderwithProtocolOptions(ProtocolOptions protocolOptions)Sets the protocol options for this cluster.Configuration.BuilderwithQueryOptions(QueryOptions queryOptions)Sets the query options for this cluster.Configuration.BuilderwithSocketOptions(SocketOptions socketOptions)Sets the socket options for this cluster.Configuration.BuilderwithThreadingOptions(ThreadingOptions threadingOptions)Sets the threading options for this cluster.
-
-
-
Method Detail
-
withApplicationInfo
public Configuration.Builder withApplicationInfo(ApplicationInfo applicationInfo)
Sets application information provider.- Parameters:
applicationInfo- application information provider.- Returns:
- this builder.
-
withDriverConfigReporting
@Beta public Configuration.Builder withDriverConfigReporting(boolean driverConfigReportingEnabled)
Enables or disables driver configuration reporting (theDRIVER_CONFIGstartup option sent by the control connection). Enabled by default; seeConfiguration.isDriverConfigReportingEnabled().- Parameters:
driverConfigReportingEnabled- whether driver configuration reporting is enabled.- Returns:
- this builder.
-
withPolicies
public Configuration.Builder withPolicies(Policies policies)
Sets the policies for this cluster.- Parameters:
policies- the policies.- Returns:
- this builder.
-
withProtocolOptions
public Configuration.Builder withProtocolOptions(ProtocolOptions protocolOptions)
Sets the protocol options for this cluster.- Parameters:
protocolOptions- the protocol options.- Returns:
- this builder.
-
withPoolingOptions
public Configuration.Builder withPoolingOptions(PoolingOptions poolingOptions)
Sets the pooling options for this cluster.- Parameters:
poolingOptions- the pooling options.- Returns:
- this builder.
-
withSocketOptions
public Configuration.Builder withSocketOptions(SocketOptions socketOptions)
Sets the socket options for this cluster.- Parameters:
socketOptions- the socket options.- Returns:
- this builder.
-
withMetricsOptions
public Configuration.Builder withMetricsOptions(MetricsOptions metricsOptions)
Sets the metrics options for this cluster.If this method doesn't get called, the configuration will use the defaults: metrics enabled with JMX reporting enabled. To disable metrics, call this method with an instance where
isEnabled()returns false.- Parameters:
metricsOptions- the metrics options.- Returns:
- this builder.
-
withQueryOptions
public Configuration.Builder withQueryOptions(QueryOptions queryOptions)
Sets the query options for this cluster.- Parameters:
queryOptions- the query options.- Returns:
- this builder.
-
withThreadingOptions
public Configuration.Builder withThreadingOptions(ThreadingOptions threadingOptions)
Sets the threading options for this cluster.- Parameters:
threadingOptions- the threading options to set.- Returns:
- this builder.
-
withNettyOptions
public Configuration.Builder withNettyOptions(NettyOptions nettyOptions)
Sets the Netty options for this cluster.- Parameters:
nettyOptions- the Netty options.- Returns:
- this builder.
-
withCodecRegistry
public Configuration.Builder withCodecRegistry(CodecRegistry codecRegistry)
Sets the codec registry for this cluster.- Parameters:
codecRegistry- the codec registry.- Returns:
- this builder.
-
withDefaultKeyspace
public Configuration.Builder withDefaultKeyspace(String keyspace)
-
getQueryOptions
public QueryOptions getQueryOptions()
-
build
public Configuration build()
Builds the final object from this builder.Any field that hasn't been set explicitly will get its default value.
- Returns:
- the object.
-
-