public class ConsulClientOptions extends Object
Constructor and Description |
---|
ConsulClientOptions()
Default constructor
|
ConsulClientOptions(ConsulClientOptions options)
Copy constructor
|
ConsulClientOptions(JsonObject options)
Constructor from JSON
|
Modifier and Type | Method and Description |
---|---|
String |
getAclToken()
Get the ACL token.
|
String |
getDc()
Get the datacenter name
|
String |
getHost()
Get Consul host.
|
PemTrustOptions |
getPemTrustOptions()
Get the trust options.
|
int |
getPort()
Get Consul HTTP API port.
|
long |
getTimeoutMs()
Get timeout in milliseconds
|
boolean |
isSsl()
Return true if SSL/TLS enabled
|
boolean |
isTrustAll()
Return true if all server certificates should be trusted
|
ConsulClientOptions |
setAclToken(String aclToken)
Set the ACL token.
|
ConsulClientOptions |
setDc(String dc)
Set the datacenter name.
|
ConsulClientOptions |
setHost(String host)
Set Consul host.
|
ConsulClientOptions |
setPemTrustOptions(PemTrustOptions pemTrustOptions)
Set the trust options.
|
ConsulClientOptions |
setPort(int port)
Set Consul HTTP API port.
|
ConsulClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
ConsulClientOptions |
setTimeoutMs(long timeoutMs)
Sets the amount of time (in milliseconds) after which if the request does not return any data
within the timeout period an failure will be passed to the handler and the request will be closed.
|
ConsulClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
JsonObject |
toJson()
Convert to JSON
|
public ConsulClientOptions()
public ConsulClientOptions(ConsulClientOptions options)
options
- the one to copypublic ConsulClientOptions(JsonObject options)
options
- the JSONpublic JsonObject toJson()
public String getHost()
public int getPort()
public String getAclToken()
public String getDc()
public long getTimeoutMs()
public boolean isSsl()
public boolean isTrustAll()
public PemTrustOptions getPemTrustOptions()
public ConsulClientOptions setHost(String host)
host
- consul hostpublic ConsulClientOptions setPort(int port)
port
- Consul HTTP API portpublic ConsulClientOptions setAclToken(String aclToken)
aclToken
- the ACL tokenpublic ConsulClientOptions setDc(String dc)
dc
- the datacenter namepublic ConsulClientOptions setTimeoutMs(long timeoutMs)
timeoutMs
- timeout in millisecondspublic ConsulClientOptions setSsl(boolean ssl)
ssl
- true if enabledpublic ConsulClientOptions setTrustAll(boolean trustAll)
trustAll
- true if all should be trustedpublic ConsulClientOptions setPemTrustOptions(PemTrustOptions pemTrustOptions)
pemTrustOptions
- the trust optionsCopyright © 2017. All rights reserved.