Package io.vertx.ext.consul
Class ConsulClientOptions
- java.lang.Object
-
- io.vertx.core.net.NetworkOptions
-
- io.vertx.core.net.TCPSSLOptions
-
- io.vertx.core.net.ClientOptionsBase
-
- io.vertx.core.http.HttpClientOptions
-
- io.vertx.ext.web.client.WebClientOptions
-
- io.vertx.ext.consul.ConsulClientOptions
-
public class ConsulClientOptions extends WebClientOptions
Options used to create Consul client.- Author:
- Ruslan Sennov
-
-
Field Summary
-
Fields inherited from class io.vertx.ext.web.client.WebClientOptions
DEFAULT_EXPAND_OPTIONS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_USER_AGENT, DEFAULT_USER_AGENT_ENABLED
-
Fields inherited from class io.vertx.core.http.HttpClientOptions
DEFAULT_ALPN_VERSIONS, DEFAULT_DECODER_INITIAL_BUFFER_SIZE, DEFAULT_DECOMPRESSION_SUPPORTED, DEFAULT_DEFAULT_HOST, DEFAULT_DEFAULT_PORT, DEFAULT_FORCE_SNI, DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE, DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE_WITH_PREFLIGHT_REQUEST, DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE, DEFAULT_HTTP2_KEEP_ALIVE_TIMEOUT, DEFAULT_HTTP2_MULTIPLEXING_LIMIT, DEFAULT_HTTP2_UPGRADE_MAX_CONTENT_LENGTH, DEFAULT_KEEP_ALIVE, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_HEADER_SIZE, DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_REDIRECTS, DEFAULT_NAME, DEFAULT_PIPELINING, DEFAULT_PIPELINING_LIMIT, DEFAULT_PROTOCOL_VERSION, DEFAULT_SHARED, DEFAULT_TRACING_POLICY, DEFAULT_VERIFY_HOST
-
Fields inherited from class io.vertx.core.net.ClientOptionsBase
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME
-
Fields inherited from class io.vertx.core.net.TCPSSLOptions
DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_WRITE_IDLE_TIMEOUT
-
Fields inherited from class io.vertx.core.net.NetworkOptions
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
-
-
Constructor Summary
Constructors Constructor Description ConsulClientOptions()Default constructorConsulClientOptions(JsonObject json)Constructor from JSONConsulClientOptions(ConsulClientOptions options)Copy constructorConsulClientOptions(URI uri)Constructor fromURI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsulClientOptionsaddCrlPath(String crlPath)Add a CRL pathConsulClientOptionsaddCrlValue(Buffer crlValue)Add a CRL valueConsulClientOptionsaddEnabledCipherSuite(String suite)Add an enabled cipher suite, appended to the ordered suites.ConsulClientOptionsaddEnabledSecureTransportProtocol(String protocol)Add an enabled SSL/TLS protocols, appended to the ordered protocols.StringgetAclToken()Get the ACL token.StringgetDc()Get the datacenter nameStringgetHost()Get Consul host.intgetPort()Get Consul HTTP API port.longgetTimeout()Get timeout in millisecondsConsulClientOptionsremoveEnabledSecureTransportProtocol(String protocol)Removes an enabled SSL/TLS protocol from the ordered protocols.ConsulClientOptionssetAclToken(String aclToken)Set the ACL token.ConsulClientOptionssetAlpnVersions(List<HttpVersion> alpnVersions)Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.ConsulClientOptionssetConnectTimeout(int connectTimeout)Set the connect timeoutConsulClientOptionssetDc(String dc)Set the datacenter name.ConsulClientOptionssetDecoderInitialBufferSize(int decoderInitialBufferSize)set toinitialBufferSizeHttpDecoderthe initial buffer of the HttpDecoder.WebClientOptionssetDecompressionSupported(boolean tryUseCompression)Set whether compression is enabledConsulClientOptionssetDefaultHost(String defaultHost)Set the default host name to be used by this client in requests if none is provided when making the request.ConsulClientOptionssetDefaultPort(int defaultPort)Set the default port to be used by this client in requests if none is provided when making the request.ConsulClientOptionssetEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)Sets the list of enabled SSL/TLS protocols.ConsulClientOptionssetFollowRedirects(boolean followRedirects)Configure the default behavior of the client to follow HTTP30xredirections.ConsulClientOptionssetForceSni(boolean forceSni)By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting this property totrueforces the server name to be always sent.ConsulClientOptionssetHost(String host)Set Consul host.ConsulClientOptionssetHttp2ClearTextUpgrade(boolean value)Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen an h2c connection is established directly (with prior knowledge).ConsulClientOptionssetHttp2ConnectionWindowSize(int http2ConnectionWindowSize)Set the default HTTP/2 connection window size.ConsulClientOptionssetHttp2KeepAliveTimeout(int keepAliveTimeout)Set the keep alive timeout for HTTP/2 connections, in seconds.ConsulClientOptionssetHttp2MultiplexingLimit(int limit)Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number of streams the client can create for a connection.ConsulClientOptionssetIdleTimeout(int idleTimeout)Set the idle timeout, in seconds. zero means don't timeout.ConsulClientOptionssetIdleTimeoutUnit(TimeUnit idleTimeoutUnit)Set the idle timeout unit.ConsulClientOptionssetInitialSettings(Http2Settings settings)Set the HTTP/2 connection settings immediately sent by to the server when the client connects.ConsulClientOptionssetKeepAlive(boolean keepAlive)Set whether keep alive is enabled on the clientConsulClientOptionssetKeepAliveTimeout(int keepAliveTimeout)Set the keep alive timeout for HTTP/1.x, in seconds.ConsulClientOptionssetKeyCertOptions(KeyCertOptions options)Set the key/cert options.ConsulClientOptionssetLocalAddress(String localAddress)Set the local interface to bind for network connections.ConsulClientOptionssetLogActivity(boolean logActivity)Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.ConsulClientOptionssetMaxChunkSize(int maxChunkSize)Set the maximum HTTP chunk sizeConsulClientOptionssetMaxHeaderSize(int maxHeaderSize)Set the maximum length of all headers for HTTP/1.x .ConsulClientOptionssetMaxInitialLineLength(int maxInitialLineLength)Set the maximum length of the initial line for HTTP/1.x (e.g.ConsulClientOptionssetMaxRedirects(int maxRedirects)Set tomaxRedirectsthe maximum number of redirection a request can follow.ConsulClientOptionssetMetricsName(String metricsName)Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.ConsulClientOptionssetPipelining(boolean pipelining)Set whether pipe-lining is enabled on the clientConsulClientOptionssetPipeliningLimit(int limit)Set the limit of pending requests a pipe-lined HTTP/1 connection can send.ConsulClientOptionssetPort(int port)Set Consul HTTP API port.ConsulClientOptionssetProtocolVersion(HttpVersion protocolVersion)Set the protocol version.ConsulClientOptionssetProxyOptions(ProxyOptions proxyOptions)Set proxy options for connections via CONNECT proxy (e.g.ConsulClientOptionssetReceiveBufferSize(int receiveBufferSize)Set the TCP receive buffer sizeConsulClientOptionssetReuseAddress(boolean reuseAddress)Set the value of reuse addressConsulClientOptionssetReusePort(boolean reusePort)Set the value of reuse port.ConsulClientOptionssetSendBufferSize(int sendBufferSize)Set the TCP send buffer sizeConsulClientOptionssetSoLinger(int soLinger)Set whether SO_linger keep alive is enabledConsulClientOptionssetSsl(boolean ssl)Set whether SSL/TLS is enabledConsulClientOptionssetSslEngineOptions(SSLEngineOptions sslEngineOptions)Set to use SSL engine implementation to use.ConsulClientOptionssetSslHandshakeTimeout(long sslHandshakeTimeout)Set the SSL handshake timeout, default time unit is seconds.ConsulClientOptionssetSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)Set the SSL handshake timeout unit.ConsulClientOptionssetTcpCork(boolean tcpCork)Enable theTCP_CORKoption - only with linux native transport.ConsulClientOptionssetTcpFastOpen(boolean tcpFastOpen)Enable theTCP_FASTOPENoption - only with linux native transport.ConsulClientOptionssetTcpKeepAlive(boolean tcpKeepAlive)Set whether TCP keep alive is enabledConsulClientOptionssetTcpNoDelay(boolean tcpNoDelay)Set whether TCP no delay is enabledConsulClientOptionssetTcpQuickAck(boolean tcpQuickAck)Enable theTCP_QUICKACKoption - only with linux native transport.ConsulClientOptionssetTimeout(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.ConsulClientOptionssetTrafficClass(int trafficClass)Set the value of traffic classConsulClientOptionssetTrustAll(boolean trustAll)Set whether all server certificates should be trustedConsulClientOptionssetTrustOptions(TrustOptions options)Set the trust options.ConsulClientOptionssetUseAlpn(boolean useAlpn)Set the ALPN usage.ConsulClientOptionssetUserAgent(String userAgent)Sets the Web Client user agent header.ConsulClientOptionssetUserAgentEnabled(boolean userAgentEnabled)Sets whether the Web Client should send a user agent header.ConsulClientOptionssetVerifyHost(boolean verifyHost)Set whether hostname verification is enabledJsonObjecttoJson()Convert to JSON-
Methods inherited from class io.vertx.ext.web.client.WebClientOptions
addNonProxyHost, getTemplateExpandOptions, getUserAgent, isFollowRedirects, isUserAgentEnabled, loadUserAgent, setName, setNonProxyHosts, setReadIdleTimeout, setShared, setTemplateExpandOptions, setTracingPolicy, setWriteIdleTimeout
-
Methods inherited from class io.vertx.core.http.HttpClientOptions
getAlpnVersions, getDecoderInitialBufferSize, getDefaultHost, getDefaultPort, getHttp2ConnectionWindowSize, getHttp2KeepAliveTimeout, getHttp2MultiplexingLimit, getHttp2UpgradeMaxContentLength, getInitialSettings, getKeepAliveTimeout, getMaxChunkSize, getMaxHeaderSize, getMaxInitialLineLength, getMaxRedirects, getName, getPipeliningLimit, getProtocolVersion, getTracingPolicy, isDecompressionSupported, isForceSni, isHttp2ClearTextUpgrade, isHttp2ClearTextUpgradeWithPreflightRequest, isKeepAlive, isPipelining, isShared, isVerifyHost, removeEnabledCipherSuite, setActivityLogDataFormat, setHttp2ClearTextUpgradeWithPreflightRequest, setHttp2UpgradeMaxContentLength, setTcpUserTimeout
-
Methods inherited from class io.vertx.core.net.ClientOptionsBase
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getOrCreateSSLOptions, getProxyOptions, getSslOptions, isTrustAll
-
Methods inherited from class io.vertx.core.net.TCPSSLOptions
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getKeyCertOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTcpUserTimeout, getTrustOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn
-
Methods inherited from class io.vertx.core.net.NetworkOptions
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
-
-
-
-
Constructor Detail
-
ConsulClientOptions
public ConsulClientOptions()
Default constructor
-
ConsulClientOptions
public ConsulClientOptions(ConsulClientOptions options)
Copy constructor- Parameters:
options- the one to copy
-
ConsulClientOptions
public ConsulClientOptions(JsonObject json)
Constructor from JSON- Parameters:
json- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Overrides:
toJsonin classWebClientOptions- Returns:
- the JSON
-
getHost
public String getHost()
Get Consul host.- Returns:
- consul host
-
getPort
public int getPort()
Get Consul HTTP API port.- Returns:
- consul port
-
getAclToken
public String getAclToken()
Get the ACL token.- Returns:
- the ACL token.
-
getDc
public String getDc()
Get the datacenter name- Returns:
- the datacenter name
-
getTimeout
public long getTimeout()
Get timeout in milliseconds- Returns:
- timeout in milliseconds
-
setHost
public ConsulClientOptions setHost(String host)
Set Consul host. Defaults to `localhost`- Parameters:
host- consul host- Returns:
- reference to this, for fluency
-
setPort
public ConsulClientOptions setPort(int port)
Set Consul HTTP API port. Defaults to `8500`- Parameters:
port- Consul HTTP API port- Returns:
- reference to this, for fluency
-
setAclToken
public ConsulClientOptions setAclToken(String aclToken)
Set the ACL token. When provided, the client will use this token when making requests to the Consul by providing the "?token" query parameter. When not provided, the empty token, which maps to the 'anonymous' ACL policy, is used.- Parameters:
aclToken- the ACL token- Returns:
- reference to this, for fluency
-
setDc
public ConsulClientOptions setDc(String dc)
Set the datacenter name. When provided, the client will use it when making requests to the Consul by providing the "?dc" query parameter. When not provided, the datacenter of the consul agent is queried.- Parameters:
dc- the datacenter name- Returns:
- reference to this, for fluency
-
setTimeout
public ConsulClientOptions setTimeout(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.- Parameters:
timeoutMs- timeout in milliseconds- Returns:
- reference to this, for fluency
-
setSendBufferSize
public ConsulClientOptions setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size- Overrides:
setSendBufferSizein classWebClientOptions- Parameters:
sendBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReceiveBufferSize
public ConsulClientOptions setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size- Overrides:
setReceiveBufferSizein classWebClientOptions- Parameters:
receiveBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReuseAddress
public ConsulClientOptions setReuseAddress(boolean reuseAddress)
Set the value of reuse address- Overrides:
setReuseAddressin classWebClientOptions- Parameters:
reuseAddress- the value of reuse address- Returns:
- a reference to this, so the API can be used fluently
-
setReusePort
public ConsulClientOptions setReusePort(boolean reusePort)
Set the value of reuse port. This is only supported by native transports.- Overrides:
setReusePortin classWebClientOptions- Parameters:
reusePort- the value of reuse port- Returns:
- a reference to this, so the API can be used fluently
-
setTrafficClass
public ConsulClientOptions setTrafficClass(int trafficClass)
Set the value of traffic class- Overrides:
setTrafficClassin classWebClientOptions- Parameters:
trafficClass- the value of traffic class- Returns:
- a reference to this, so the API can be used fluently
-
setTcpNoDelay
public ConsulClientOptions setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled- Overrides:
setTcpNoDelayin classWebClientOptions- Parameters:
tcpNoDelay- true if TCP no delay is enabled (Nagle disabled)- Returns:
- a reference to this, so the API can be used fluently
-
setTcpKeepAlive
public ConsulClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled- Overrides:
setTcpKeepAlivein classWebClientOptions- Parameters:
tcpKeepAlive- true if TCP keep alive is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setTcpCork
public ConsulClientOptions setTcpCork(boolean tcpCork)
Enable theTCP_CORKoption - only with linux native transport.- Overrides:
setTcpCorkin classWebClientOptions- Parameters:
tcpCork- the cork value- Returns:
- a reference to this, so the API can be used fluently
-
setTcpQuickAck
public ConsulClientOptions setTcpQuickAck(boolean tcpQuickAck)
Enable theTCP_QUICKACKoption - only with linux native transport.- Overrides:
setTcpQuickAckin classWebClientOptions- Parameters:
tcpQuickAck- the quick ack value- Returns:
- a reference to this, so the API can be used fluently
-
setTcpFastOpen
public ConsulClientOptions setTcpFastOpen(boolean tcpFastOpen)
Enable theTCP_FASTOPENoption - only with linux native transport.- Overrides:
setTcpFastOpenin classWebClientOptions- Parameters:
tcpFastOpen- the fast open value- Returns:
- a reference to this, so the API can be used fluently
-
setSoLinger
public ConsulClientOptions setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled- Overrides:
setSoLingerin classWebClientOptions- Parameters:
soLinger- true if SO_linger is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeout
public ConsulClientOptions setIdleTimeout(int idleTimeout)
Set the idle timeout, in seconds. zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout.- Overrides:
setIdleTimeoutin classWebClientOptions- Parameters:
idleTimeout- the timeout, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeoutUnit
public ConsulClientOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit. If not specified, default is seconds.- Overrides:
setIdleTimeoutUnitin classWebClientOptions- Parameters:
idleTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
setSsl
public ConsulClientOptions setSsl(boolean ssl)
Set whether SSL/TLS is enabled- Overrides:
setSslin classWebClientOptions- Parameters:
ssl- true if enabled- Returns:
- reference to this, for fluency
-
setKeyCertOptions
public ConsulClientOptions setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.- Overrides:
setKeyCertOptionsin classWebClientOptions- Parameters:
options- the key store options- Returns:
- a reference to this, so the API can be used fluently
-
setTrustOptions
public ConsulClientOptions setTrustOptions(TrustOptions options)
Set the trust options.- Overrides:
setTrustOptionsin classWebClientOptions- Parameters:
options- the trust options- Returns:
- a reference to this, so the API can be used fluently
-
setTrustAll
public ConsulClientOptions setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted- Overrides:
setTrustAllin classWebClientOptions- Parameters:
trustAll- true if all should be trusted- Returns:
- reference to this, for fluency
-
setConnectTimeout
public ConsulClientOptions setConnectTimeout(int connectTimeout)
Set the connect timeout- Overrides:
setConnectTimeoutin classWebClientOptions- Parameters:
connectTimeout- connect timeout, in ms- Returns:
- a reference to this, so the API can be used fluently
-
setHttp2MultiplexingLimit
public ConsulClientOptions setHttp2MultiplexingLimit(int limit)
Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number of streams the client can create for a connection. The effective number of streams for a connection is the min of this value and the server's initial settings. Setting the value to-1means to use the value sent by the server's initial settings.-1is the default value.- Overrides:
setHttp2MultiplexingLimitin classWebClientOptions- Parameters:
limit- the maximum concurrent for an HTTP/2 connection- Returns:
- a reference to this, so the API can be used fluently
-
setHttp2ConnectionWindowSize
public ConsulClientOptions setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size. It overrides the initial window size set byHttp2Settings.getInitialWindowSize(), so the connection window size is greater than for its streams, in order the data throughput. A value of-1reuses the initial window size setting.- Overrides:
setHttp2ConnectionWindowSizein classWebClientOptions- Parameters:
http2ConnectionWindowSize- the window size applied to the connection- Returns:
- a reference to this, so the API can be used fluently
-
setKeepAlive
public ConsulClientOptions setKeepAlive(boolean keepAlive)
Set whether keep alive is enabled on the client- Overrides:
setKeepAlivein classWebClientOptions- Parameters:
keepAlive- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setPipelining
public ConsulClientOptions setPipelining(boolean pipelining)
Set whether pipe-lining is enabled on the client- Overrides:
setPipeliningin classWebClientOptions- Parameters:
pipelining- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setPipeliningLimit
public ConsulClientOptions setPipeliningLimit(int limit)
Set the limit of pending requests a pipe-lined HTTP/1 connection can send.- Overrides:
setPipeliningLimitin classWebClientOptions- Parameters:
limit- the limit of pending requests- Returns:
- a reference to this, so the API can be used fluently
-
setVerifyHost
public ConsulClientOptions setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled- Overrides:
setVerifyHostin classWebClientOptions- Parameters:
verifyHost- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setDecompressionSupported
public WebClientOptions setDecompressionSupported(boolean tryUseCompression)
Set whether compression is enabled- Overrides:
setDecompressionSupportedin classWebClientOptions- Parameters:
tryUseCompression- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setDefaultHost
public ConsulClientOptions setDefaultHost(String defaultHost)
Set the default host name to be used by this client in requests if none is provided when making the request.- Overrides:
setDefaultHostin classWebClientOptions- Returns:
- a reference to this, so the API can be used fluently
-
setDefaultPort
public ConsulClientOptions setDefaultPort(int defaultPort)
Set the default port to be used by this client in requests if none is provided when making the request.- Overrides:
setDefaultPortin classWebClientOptions- Returns:
- a reference to this, so the API can be used fluently
-
setProtocolVersion
public ConsulClientOptions setProtocolVersion(HttpVersion protocolVersion)
Set the protocol version.- Overrides:
setProtocolVersionin classWebClientOptions- Parameters:
protocolVersion- the protocol version- Returns:
- a reference to this, so the API can be used fluently
-
setMaxChunkSize
public ConsulClientOptions setMaxChunkSize(int maxChunkSize)
Set the maximum HTTP chunk size- Overrides:
setMaxChunkSizein classWebClientOptions- Parameters:
maxChunkSize- the maximum chunk size- Returns:
- a reference to this, so the API can be used fluently
-
setMaxInitialLineLength
public ConsulClientOptions setMaxInitialLineLength(int maxInitialLineLength)
Set the maximum length of the initial line for HTTP/1.x (e.g."HTTP/1.1 200 OK")- Overrides:
setMaxInitialLineLengthin classWebClientOptions- Parameters:
maxInitialLineLength- the new maximum initial length- Returns:
- a reference to this, so the API can be used fluently
-
setMaxHeaderSize
public ConsulClientOptions setMaxHeaderSize(int maxHeaderSize)
Set the maximum length of all headers for HTTP/1.x .- Overrides:
setMaxHeaderSizein classWebClientOptions- Parameters:
maxHeaderSize- the new maximum length- Returns:
- a reference to this, so the API can be used fluently
-
setInitialSettings
public ConsulClientOptions setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediately sent by to the server when the client connects.- Overrides:
setInitialSettingsin classWebClientOptions- Parameters:
settings- the settings value- Returns:
- a reference to this, so the API can be used fluently
-
setUseAlpn
public ConsulClientOptions setUseAlpn(boolean useAlpn)
Set the ALPN usage.- Overrides:
setUseAlpnin classWebClientOptions- Parameters:
useAlpn- true when Application-Layer Protocol Negotiation should be used
-
setSslEngineOptions
public ConsulClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.- Overrides:
setSslEngineOptionsin classWebClientOptions- Parameters:
sslEngineOptions- the ssl engine to use- Returns:
- a reference to this, so the API can be used fluently
-
setAlpnVersions
public ConsulClientOptions setAlpnVersions(List<HttpVersion> alpnVersions)
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation. When the list is empty, the client provides a best effort list according tosetProtocolVersion(io.vertx.core.http.HttpVersion):HttpVersion.HTTP_2: [ "h2", "http/1.1" ]- otherwise: [
HttpClientOptions.getProtocolVersion()]
- Overrides:
setAlpnVersionsin classWebClientOptions- Parameters:
alpnVersions- the versions- Returns:
- a reference to this, so the API can be used fluently
-
setHttp2ClearTextUpgrade
public ConsulClientOptions setHttp2ClearTextUpgrade(boolean value)
Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen an h2c connection is established directly (with prior knowledge).- Overrides:
setHttp2ClearTextUpgradein classWebClientOptions- Parameters:
value- the upgrade value- Returns:
- a reference to this, so the API can be used fluently
-
setMaxRedirects
public ConsulClientOptions setMaxRedirects(int maxRedirects)
Set tomaxRedirectsthe maximum number of redirection a request can follow.- Overrides:
setMaxRedirectsin classWebClientOptions- Parameters:
maxRedirects- the maximum number of redirection- Returns:
- a reference to this, so the API can be used fluently
-
setMetricsName
public ConsulClientOptions setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.- Overrides:
setMetricsNamein classWebClientOptions- Parameters:
metricsName- the metrics name- Returns:
- a reference to this, so the API can be used fluently
-
setProxyOptions
public ConsulClientOptions setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g. Squid) or a SOCKS proxy.- Overrides:
setProxyOptionsin classWebClientOptions- Parameters:
proxyOptions- proxy options object- Returns:
- a reference to this, so the API can be used fluently
-
setLocalAddress
public ConsulClientOptions setLocalAddress(String localAddress)
Set the local interface to bind for network connections. When the local address is null, it will pick any local address, the default local address is null.- Overrides:
setLocalAddressin classWebClientOptions- Parameters:
localAddress- the local address- Returns:
- a reference to this, so the API can be used fluently
-
setLogActivity
public ConsulClientOptions setLogActivity(boolean logActivity)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setLogActivityin classWebClientOptions- Parameters:
logActivity- true for logging the network activity- Returns:
- a reference to this, so the API can be used fluently
-
setUserAgentEnabled
public ConsulClientOptions setUserAgentEnabled(boolean userAgentEnabled)
Sets whether the Web Client should send a user agent header. Defaults to true.- Overrides:
setUserAgentEnabledin classWebClientOptions- Parameters:
userAgentEnabled- true to send a user agent header, false otherwise- Returns:
- a reference to this, so the API can be used fluently
-
setUserAgent
public ConsulClientOptions setUserAgent(String userAgent)
Sets the Web Client user agent header. Defaults to Vert.x-WebClient/<version>.- Overrides:
setUserAgentin classWebClientOptions- Parameters:
userAgent- user agent header value- Returns:
- a reference to this, so the API can be used fluently
-
setFollowRedirects
public ConsulClientOptions setFollowRedirects(boolean followRedirects)
Configure the default behavior of the client to follow HTTP30xredirections.- Overrides:
setFollowRedirectsin classWebClientOptions- Parameters:
followRedirects- true when a redirect is followed- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledCipherSuite
public ConsulClientOptions addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.- Overrides:
addEnabledCipherSuitein classWebClientOptions- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
- See Also:
TCPSSLOptions.getEnabledCipherSuites()
-
addEnabledSecureTransportProtocol
public ConsulClientOptions addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.- Overrides:
addEnabledSecureTransportProtocolin classWebClientOptions- Parameters:
protocol- the SSL/TLS protocol do enabled- Returns:
- a reference to this, so the API can be used fluently
-
addCrlPath
public ConsulClientOptions addCrlPath(String crlPath) throws NullPointerException
Add a CRL path- Overrides:
addCrlPathin classWebClientOptions- Parameters:
crlPath- the path- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
addCrlValue
public ConsulClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
Add a CRL value- Overrides:
addCrlValuein classWebClientOptions- Parameters:
crlValue- the value- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
setForceSni
public ConsulClientOptions setForceSni(boolean forceSni)
By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting this property totrueforces the server name to be always sent.- Overrides:
setForceSniin classWebClientOptions- Parameters:
forceSni- true when the client should always use SNI on TLS/SSL connections- Returns:
- a reference to this, so the API can be used fluently
-
setDecoderInitialBufferSize
public ConsulClientOptions setDecoderInitialBufferSize(int decoderInitialBufferSize)
set toinitialBufferSizeHttpDecoderthe initial buffer of the HttpDecoder.- Overrides:
setDecoderInitialBufferSizein classWebClientOptions- Parameters:
decoderInitialBufferSize- the initial buffer size- Returns:
- a reference to this, so the API can be used fluently
-
removeEnabledSecureTransportProtocol
public ConsulClientOptions removeEnabledSecureTransportProtocol(String protocol)
Description copied from class:TCPSSLOptionsRemoves an enabled SSL/TLS protocol from the ordered protocols.- Overrides:
removeEnabledSecureTransportProtocolin classWebClientOptions- Parameters:
protocol- the SSL/TLS protocol to disable- Returns:
- a reference to this, so the API can be used fluently
-
setHttp2KeepAliveTimeout
public ConsulClientOptions setHttp2KeepAliveTimeout(int keepAliveTimeout)
Description copied from class:HttpClientOptionsSet the keep alive timeout for HTTP/2 connections, in seconds. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of0means there is no timeout.- Overrides:
setHttp2KeepAliveTimeoutin classWebClientOptions- Parameters:
keepAliveTimeout- the timeout, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
setKeepAliveTimeout
public ConsulClientOptions setKeepAliveTimeout(int keepAliveTimeout)
Description copied from class:HttpClientOptionsSet the keep alive timeout for HTTP/1.x, in seconds. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of0means there is no timeout.- Overrides:
setKeepAliveTimeoutin classWebClientOptions- Parameters:
keepAliveTimeout- the timeout, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
setEnabledSecureTransportProtocols
public ConsulClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Description copied from class:TCPSSLOptionsSets the list of enabled SSL/TLS protocols.- Overrides:
setEnabledSecureTransportProtocolsin classWebClientOptions- Parameters:
enabledSecureTransportProtocols- the SSL/TLS protocols to enable- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeout
public ConsulClientOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout, default time unit is seconds.- Overrides:
setSslHandshakeTimeoutin classWebClientOptions- Parameters:
sslHandshakeTimeout- the SSL handshake timeout to set, in milliseconds- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeoutUnit
public ConsulClientOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout unit. If not specified, default is seconds.- Overrides:
setSslHandshakeTimeoutUnitin classWebClientOptions- Parameters:
sslHandshakeTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
-