Class ConnectionSettingsBuilder


  • public class ConnectionSettingsBuilder
    extends java.lang.Object
    Utility to create client settings programmatically.
    • Method Detail

      • maxDiscoverAttempts

        public ConnectionSettingsBuilder maxDiscoverAttempts​(int maxDiscoverAttempts)
        How many times to attempt connection before throwing.
      • discoveryInterval

        public ConnectionSettingsBuilder discoveryInterval​(int discoveryInterval)
        How long to wait before retrying a new discovery process (in milliseconds).
      • gossipTimeout

        public ConnectionSettingsBuilder gossipTimeout​(int gossipTimeout)
        How long to wait for the gossip request to timeout (in seconds).
      • tlsVerifyCert

        public ConnectionSettingsBuilder tlsVerifyCert​(boolean tlsVerifyCert)
        If secure mode is enabled, is certificate verification enabled.
      • defaultCredentials

        public ConnectionSettingsBuilder defaultCredentials​(java.lang.String username,
                                                            java.lang.String password)
        Default credentials used to authenticate requests.
      • defaultClientCertificate

        public ConnectionSettingsBuilder defaultClientCertificate​(java.lang.String clientCertFile,
                                                                  java.lang.String clientKeyFile)
        Client certificate used for user authentication.
      • addHost

        public ConnectionSettingsBuilder addHost​(java.lang.String host,
                                                 int port)
        Adds an endpoint the client will use to connect.
      • addHost

        public ConnectionSettingsBuilder addHost​(java.net.InetSocketAddress host)
        Adds an endpoint the client will use to connect.
      • keepAliveTimeout

        public ConnectionSettingsBuilder keepAliveTimeout​(long value)
        The amount of time (in milliseconds) the sender of the keepalive ping waits for an acknowledgement.
      • keepAliveInterval

        public ConnectionSettingsBuilder keepAliveInterval​(long value)
        The amount of time (in milliseconds) to wait after which a keepalive ping is sent on the transport.
      • defaultDeadline

        public ConnectionSettingsBuilder defaultDeadline​(long value)
        An optional length of time (in milliseconds) to use for gRPC deadlines.
      • addInterceptor

        public ConnectionSettingsBuilder addInterceptor​(io.grpc.ClientInterceptor interceptor)
        Register a gRPC interceptor every time a new gRPC channel is created.
        Parameters:
        interceptor -
      • tlsCaFile

        public ConnectionSettingsBuilder tlsCaFile​(java.lang.String filepath)
        Client certificate for secure connection. Not required for enabling secure connection. Useful for self-signed certificate that are not installed on the system trust store.
        Parameters:
        filepath - path to a certificate file.