Class Configuration.Builder

  • Enclosing class:
    Configuration

    public static class Configuration.Builder
    extends Object
    A builder to create a new Configuration object.
    • Constructor Detail

      • Builder

        public Builder()
    • 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 (the DRIVER_CONFIG startup option sent by the control connection). Enabled by default; see Configuration.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.
      • 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.