| Modifier and Type | Method and Description |
|---|---|
Consul |
build()
Constructs a new
Consul client. |
Consul.Builder |
withAclToken(String token)
Sets the ACL token to be used with Consul
|
Consul.Builder |
withBasicAuth(String username,
String password)
Sets the username and password to be used for basic authentication
|
Consul.Builder |
withConnectTimeoutMillis(long timeoutMillis)
Connect timeout for OkHttpClient
|
Consul.Builder |
withHostAndPort(com.google.common.net.HostAndPort hostAndPort)
Sets the URL from a
HostAndPort object. |
Consul.Builder |
withPing(boolean ping)
Instructs the builder that the AgentClient should attempt a ping before returning the Consul instance
|
Consul.Builder |
withReadTimeoutMillis(long timeoutMillis)
Read timeout for OkHttpClient
|
Consul.Builder |
withSslContext(SSLContext sslContext)
Sets the
SSLContext for the client. |
Consul.Builder |
withUrl(String url)
Sets the URL from a string.
|
Consul.Builder |
withUrl(URL url)
Sets the URL from a
URL object. |
Consul.Builder |
withWriteTimeoutMillis(long timeoutMillis)
Write timeout for OkHttpClient
|
public Consul.Builder withUrl(URL url)
URL object.url - The Consul agent URL.public Consul.Builder withPing(boolean ping)
ping - Whether the ping should be done or notpublic Consul.Builder withBasicAuth(String username, String password)
username - the value of the usernamepassword - the value of the passwordpublic Consul.Builder withAclToken(String token)
token - the value of the tokenpublic Consul.Builder withHostAndPort(com.google.common.net.HostAndPort hostAndPort)
HostAndPort object.hostAndPort - The Consul agent host and port.public Consul.Builder withUrl(String url)
url - The Consul agent URL.public Consul.Builder withSslContext(SSLContext sslContext)
SSLContext for the client.sslContext - The SSL context for HTTPS agents.public Consul.Builder withConnectTimeoutMillis(long timeoutMillis)
timeoutMillis - timeout values in millisecondspublic Consul.Builder withReadTimeoutMillis(long timeoutMillis)
timeoutMillis - timeout value in millisecondspublic Consul.Builder withWriteTimeoutMillis(long timeoutMillis)
timeoutMillis - timeout value in millisecondsCopyright © 2016. All rights reserved.