Package com.eventstore.dbclient
Class ConnectionSettingsBuilder
- java.lang.Object
-
- com.eventstore.dbclient.ConnectionSettingsBuilder
-
public class ConnectionSettingsBuilder extends java.lang.Object
Utility to create client settings programmatically.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionSettingsBuilder
addHost(java.lang.String host, int port)
Adds an endpoint the client will use to connect.ConnectionSettingsBuilder
addHost(java.net.InetSocketAddress host)
Adds an endpoint the client will use to connect.ConnectionSettingsBuilder
addInterceptor(io.grpc.ClientInterceptor interceptor)
Register a gRPC interceptor every time a new gRPC channel is created.EventStoreDBClientSettings
buildConnectionSettings()
Returns configured connection settings.ConnectionSettingsBuilder
defaultClientCertificate(ClientCertificate defaultClientCertificate)
Client certificate used for user authentication.ConnectionSettingsBuilder
defaultClientCertificate(java.lang.String clientCertFile, java.lang.String clientKeyFile)
Client certificate used for user authentication.ConnectionSettingsBuilder
defaultCredentials(UserCredentials defaultCredentials)
Default credentials used to authenticate requests.ConnectionSettingsBuilder
defaultCredentials(java.lang.String username, java.lang.String password)
Default credentials used to authenticate requests.ConnectionSettingsBuilder
defaultDeadline(long value)
An optional length of time (in milliseconds) to use for gRPC deadlines.ConnectionSettingsBuilder
discoveryInterval(int discoveryInterval)
How long to wait before retrying a new discovery process (in milliseconds).ConnectionSettingsBuilder
dnsDiscover(boolean dnsDiscover)
If DNS node discovery is enabled.ConnectionSettingsBuilder
gossipTimeout(int gossipTimeout)
How long to wait for the gossip request to timeout (in seconds).ConnectionSettingsBuilder
keepAliveInterval(long value)
The amount of time (in milliseconds) to wait after which a keepalive ping is sent on the transport.ConnectionSettingsBuilder
keepAliveTimeout(long value)
The amount of time (in milliseconds) the sender of the keepalive ping waits for an acknowledgement.ConnectionSettingsBuilder
maxDiscoverAttempts(int maxDiscoverAttempts)
How many times to attempt connection before throwing.ConnectionSettingsBuilder
nodePreference(NodePreference nodePreference)
Preferred node type when picking a node within a cluster.ConnectionSettingsBuilder
tls(boolean tls)
If secure mode is enabled.ConnectionSettingsBuilder
tlsCaFile(java.lang.String filepath)
Client certificate for secure connection.ConnectionSettingsBuilder
tlsVerifyCert(boolean tlsVerifyCert)
If secure mode is enabled, is certificate verification enabled.
-
-
-
Method Detail
-
buildConnectionSettings
public EventStoreDBClientSettings buildConnectionSettings()
Returns configured connection settings.- Returns:
- configured settings.
- See Also:
EventStoreDBClientSettings
-
dnsDiscover
public ConnectionSettingsBuilder dnsDiscover(boolean dnsDiscover)
If DNS node discovery is enabled.
-
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).
-
nodePreference
public ConnectionSettingsBuilder nodePreference(NodePreference nodePreference)
Preferred node type when picking a node within a cluster.
-
tls
public ConnectionSettingsBuilder tls(boolean tls)
If secure mode is enabled.
-
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.
-
defaultCredentials
public ConnectionSettingsBuilder defaultCredentials(UserCredentials defaultCredentials)
Default credentials used to authenticate requests.
-
defaultClientCertificate
public ConnectionSettingsBuilder defaultClientCertificate(java.lang.String clientCertFile, java.lang.String clientKeyFile)
Client certificate used for user authentication.
-
defaultClientCertificate
public ConnectionSettingsBuilder defaultClientCertificate(ClientCertificate defaultClientCertificate)
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.
-
-