public static class EtcdClient.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
EtcdClient |
build() |
EtcdClient.Builder |
overrideAuthority(String authority)
Override the authority used for TLS hostname verification.
|
EtcdClient.Builder |
sendViaEventLoop(boolean sendViaEventLoop)
Control whether all RPC requests are sent via the underlying
IO event loop.
|
EtcdClient.Builder |
withCaCert(com.google.common.io.ByteSource certSource)
Provide CA certificate to use for TLS connection
|
EtcdClient.Builder |
withCredentials(com.google.protobuf.ByteString name,
com.google.protobuf.ByteString password)
Set etcd credentials to use from
ByteStrings |
EtcdClient.Builder |
withCredentials(String name,
String password)
Set etcd credentials to use from
Strings as UTF-8. |
EtcdClient.Builder |
withDefaultTimeout(long value,
TimeUnit unit)
Provide a default timeout to use for requests made by this client.
|
EtcdClient.Builder |
withImmediateAuth()
Attempt authentication immediately rather than if/when required.
|
EtcdClient.Builder |
withMaxInboundMessageSize(int sizeInBytes)
Set the maximum inbound message size in bytes
|
EtcdClient.Builder |
withPlainText()
Disable TLS - to connect to insecure servers in development contexts
|
EtcdClient.Builder |
withSessionTimeoutSecs(int timeoutSecs)
Set the session timeout in seconds - this corresponds to the TTL of the
session lease, see
EtcdClient.getSessionLease(). |
EtcdClient.Builder |
withThreadCount(int threads)
subject to change - threads to use for internal executor
|
EtcdClient.Builder |
withTlsConfig(Consumer<io.netty.handler.ssl.SslContextBuilder> contextBuilder)
Configure the netty
SslContext to be used by this client. |
EtcdClient.Builder |
withTrustManager(TrustManagerFactory tmf)
Provide custom
TrustManagerFactory to use for this
client's TLS connection. |
EtcdClient.Builder |
withUserExecutor(Executor executor)
Provide executor to use for user call-backs.
|
public EtcdClient.Builder withCredentials(com.google.protobuf.ByteString name, com.google.protobuf.ByteString password)
ByteStringsname - password - public EtcdClient.Builder withCredentials(String name, String password)
Strings as UTF-8.name - password - public EtcdClient.Builder withImmediateAuth()
public EtcdClient.Builder withThreadCount(int threads)
public EtcdClient.Builder sendViaEventLoop(boolean sendViaEventLoop)
Default is true
sendViaEventLoop - public EtcdClient.Builder withUserExecutor(Executor executor)
executor - public EtcdClient.Builder withDefaultTimeout(long value, TimeUnit unit)
Deadlines
used per-call which also cover any/all retry attempts.
The default for this default is 10 secondsvalue - unit - public EtcdClient.Builder withPlainText()
public EtcdClient.Builder overrideAuthority(String authority)
public EtcdClient.Builder withCaCert(com.google.common.io.ByteSource certSource) throws IOException, SSLException
certSource - IOException - if there is an error reading from the provided ByteSourceSSLExceptionpublic EtcdClient.Builder withTrustManager(TrustManagerFactory tmf) throws SSLException
TrustManagerFactory to use for this
client's TLS connection.tmf - SSLExceptionpublic EtcdClient.Builder withTlsConfig(Consumer<io.netty.handler.ssl.SslContextBuilder> contextBuilder) throws SSLException
SslContext to be used by this client.
The provided Consumer should make updates to the passed
SslContextBuilder as needed, but should not call build().contextBuilder - SSLExceptionpublic EtcdClient.Builder withSessionTimeoutSecs(int timeoutSecs)
EtcdClient.getSessionLease().timeoutSecs - public EtcdClient.Builder withMaxInboundMessageSize(int sizeInBytes)
sizeInBytes - public EtcdClient build()
EtcdClient instanceCopyright © 2022. All rights reserved.