public class WebClientOptions extends HttpClientOptions
Modifier and Type | Field and Description |
---|---|
static ExpandOptions |
DEFAULT_EXPAND_OPTIONS |
static boolean |
DEFAULT_FOLLOW_REDIRECTS
The default value of whether the Web Client should follow redirects = true.
|
static String |
DEFAULT_USER_AGENT
The default user agent string = Vert.x-WebClient/<version>.
|
static boolean |
DEFAULT_USER_AGENT_ENABLED
The default value of whether the Web Client should send a user agent header = true.
|
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_MAX_POOL_SIZE, DEFAULT_HTTP2_MULTIPLEXING_LIMIT, DEFAULT_KEEP_ALIVE, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_HEADER_SIZE, DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_POOL_SIZE, DEFAULT_MAX_REDIRECTS, DEFAULT_MAX_WAIT_QUEUE_SIZE, DEFAULT_MAX_WEBSOCKET_FRAME_SIZE, DEFAULT_MAX_WEBSOCKET_MESSAGE_SIZE, DEFAULT_MAX_WEBSOCKETS, DEFAULT_NAME, DEFAULT_PIPELINING, DEFAULT_PIPELINING_LIMIT, DEFAULT_POOL_CLEANER_PERIOD, DEFAULT_POOL_EVENT_LOOP_SIZE, DEFAULT_PROTOCOL_VERSION, DEFAULT_SEND_UNMASKED_FRAMES, DEFAULT_SHARED, DEFAULT_TRACING_POLICY, DEFAULT_TRY_USE_COMPRESSION, DEFAULT_TRY_USE_PER_FRAME_WEBSOCKET_COMPRESSION, DEFAULT_TRY_USE_PER_MESSAGE_WEBSOCKET_COMPRESSION, DEFAULT_VERIFY_HOST, DEFAULT_WEBSOCKET_ALLOW_CLIENT_NO_CONTEXT, DEFAULT_WEBSOCKET_CLOSING_TIMEOUT, DEFAULT_WEBSOCKET_COMPRESSION_LEVEL, DEFAULT_WEBSOCKET_REQUEST_SERVER_NO_CONTEXT
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_KEEPALIVE_COUNT, DEFAULT_TCP_KEEPALIVE_IDLE_SECONDS, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUT
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 and Description |
---|
WebClientOptions() |
WebClientOptions(HttpClientOptions other)
Copy constructor using
HttpClientOptions . |
WebClientOptions(JsonObject json)
Creates a new instance from JSON.
|
WebClientOptions(WebClientOptions other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
WebClientOptions |
addCrlPath(String crlPath)
Add a CRL path
|
WebClientOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
WebClientOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
WebClientOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
WebClientOptions |
addNonProxyHost(String nonProxyHost)
Add a
host to the ClientOptionsBase.getNonProxyHosts() list. |
ExpandOptions |
getTemplateExpandOptions() |
String |
getUserAgent() |
boolean |
isFollowRedirects() |
boolean |
isUserAgentEnabled() |
static String |
loadUserAgent() |
WebClientOptions |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
WebClientOptions |
setAlpnVersions(List<HttpVersion> alpnVersions)
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.
|
WebClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
WebClientOptions |
setDecoderInitialBufferSize(int decoderInitialBufferSize)
set to
initialBufferSizeHttpDecoder the initial buffer of the HttpDecoder. |
WebClientOptions |
setDecompressionSupported(boolean tryUseCompression)
Whether the client should send requests with an
accepting-encoding header set to a compression algorithm. |
WebClientOptions |
setDefaultHost(String defaultHost)
Set the default host name to be used by this client in requests if none is provided when making the request.
|
WebClientOptions |
setDefaultPort(int defaultPort)
Set the default port to be used by this client in requests if none is provided when making the request.
|
WebClientOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
WebClientOptions |
setFollowRedirects(boolean followRedirects)
Configure the default behavior of the client to follow HTTP
30x redirections. |
WebClientOptions |
setForceSni(boolean forceSni)
By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting
this property to
true forces the server name to be always sent. |
WebClientOptions |
setHttp2ClearTextUpgrade(boolean value)
Set to
true when an h2c connection is established using an HTTP/1.1 upgrade request, and false
when an h2c connection is established directly (with prior knowledge). |
WebClientOptions |
setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size.
|
WebClientOptions |
setHttp2KeepAliveTimeout(int keepAliveTimeout)
Set the keep alive timeout for HTTP/2 connections, in seconds.
|
WebClientOptions |
setHttp2MaxPoolSize(int max)
Set the maximum pool size for HTTP/2 connections
|
WebClientOptions |
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.
|
WebClientOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
WebClientOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
WebClientOptions |
setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediately sent by to the server when the client connects.
|
WebClientOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
WebClientOptions |
setKeepAlive(boolean keepAlive)
Set whether keep alive is enabled on the client
|
WebClientOptions |
setKeepAliveTimeout(int keepAliveTimeout)
Set the keep alive timeout for HTTP/1.x, in seconds.
|
WebClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
WebClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
WebClientOptions |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
WebClientOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
WebClientOptions |
setMaxChunkSize(int maxChunkSize)
Set the maximum HTTP chunk size
|
WebClientOptions |
setMaxHeaderSize(int maxHeaderSize)
Set the maximum length of all headers for HTTP/1.x .
|
WebClientOptions |
setMaxInitialLineLength(int maxInitialLineLength)
Set the maximum length of the initial line for HTTP/1.x (e.g.
|
WebClientOptions |
setMaxPoolSize(int maxPoolSize)
Set the maximum pool size for connections
|
WebClientOptions |
setMaxRedirects(int maxRedirects)
Set to
maxRedirects the maximum number of redirection a request can follow. |
WebClientOptions |
setMaxWaitQueueSize(int maxWaitQueueSize)
Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in
a ConnectionPoolTooBusyException.
|
WebClientOptions |
setMaxWebSocketFrameSize(int maxWebsocketFrameSize)
Set the max WebSocket frame size
|
WebClientOptions |
setMaxWebSocketMessageSize(int maxWebsocketMessageSize)
Set the max WebSocket message size
|
WebClientOptions |
setMaxWebSockets(int maxWebSockets)
Set the max number of WebSockets per endpoint.
|
WebClientOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
WebClientOptions |
setName(String name)
Set the client name, used when the client is shared, otherwise ignored.
|
WebClientOptions |
setNonProxyHosts(List<String> nonProxyHosts)
Set a list of remote hosts that are not proxied when the client is configured to use a proxy.
|
WebClientOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
WebClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
WebClientOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
WebClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
WebClientOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
WebClientOptions |
setPipelining(boolean pipelining)
Set whether pipe-lining is enabled on the client
|
WebClientOptions |
setPipeliningLimit(int limit)
Set the limit of pending requests a pipe-lined HTTP/1 connection can send.
|
WebClientOptions |
setPoolCleanerPeriod(int poolCleanerPeriod)
Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections
will remain in the pool until they are closed.
|
WebClientOptions |
setPoolEventLoopSize(int poolEventLoopSize)
Set the number of event-loop the pool use.
|
WebClientOptions |
setProtocolVersion(HttpVersion protocolVersion)
Set the protocol version.
|
WebClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
WebClientOptions |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
WebClientOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
WebClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
WebClientOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
WebClientOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
WebClientOptions |
setSendUnmaskedFrames(boolean sendUnmaskedFrames)
Set
true when the client wants to skip frame masking. |
WebClientOptions |
setShared(boolean shared)
Set to
true to share the client. |
WebClientOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
WebClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
WebClientOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
WebClientOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
WebClientOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
WebClientOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
WebClientOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
WebClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
WebClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
WebClientOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
WebClientOptions |
setTemplateExpandOptions(ExpandOptions templateExpandOptions) |
WebClientOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.
|
WebClientOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
WebClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
WebClientOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
WebClientOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
WebClientOptions |
setTryUseCompression(boolean tryUseCompression)
Deprecated.
|
WebClientOptions |
setTryUsePerFrameWebSocketCompression(boolean offer)
Set whether the client will offer the WebSocket per-frame deflate compression extension.
|
WebClientOptions |
setTryUsePerMessageWebSocketCompression(boolean offer)
Set whether the client will offer the WebSocket per-message deflate compression extension.
|
WebClientOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
WebClientOptions |
setUserAgent(String userAgent)
Sets the Web Client user agent header.
|
WebClientOptions |
setUserAgentEnabled(boolean userAgentEnabled)
Sets whether the Web Client should send a user agent header.
|
WebClientOptions |
setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled
|
WebClientOptions |
setWebSocketClosingTimeout(int webSocketClosingTimeout)
Set the amount of time a client WebSocket will wait until it closes the TCP connection after receiving a close frame.
|
WebClientOptions |
setWebSocketCompressionAllowClientNoContext(boolean offer)
Set whether the
client_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
WebClientOptions |
setWebSocketCompressionLevel(int compressionLevel)
Set the WebSocket deflate compression level.
|
WebClientOptions |
setWebSocketCompressionRequestServerNoContext(boolean offer)
Set whether the
server_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
WebClientOptions |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getAlpnVersions, getDecoderInitialBufferSize, getDefaultHost, getDefaultPort, getHttp2ConnectionWindowSize, getHttp2KeepAliveTimeout, getHttp2MaxPoolSize, getHttp2MultiplexingLimit, getInitialSettings, getKeepAliveTimeout, getMaxChunkSize, getMaxHeaderSize, getMaxInitialLineLength, getMaxPoolSize, getMaxRedirects, getMaxWaitQueueSize, getMaxWebSocketFrameSize, getMaxWebSocketMessageSize, getMaxWebSockets, getName, getPipeliningLimit, getPoolCleanerPeriod, getPoolEventLoopSize, getPoolOptions, getProtocolVersion, getTracingPolicy, getTryUsePerFrameWebSocketCompression, getTryUsePerMessageWebSocketCompression, getTryWebSocketDeflateFrameCompression, getWebSocketClosingTimeout, getWebSocketCompressionAllowClientNoContext, getWebSocketCompressionLevel, getWebSocketCompressionRequestServerNoContext, isDecompressionSupported, isForceSni, isHttp2ClearTextUpgrade, isHttp2ClearTextUpgradeWithPreflightRequest, isKeepAlive, isPipelining, isSendUnmaskedFrames, isShared, isTryUseCompression, isVerifyHost, removeEnabledCipherSuite, setActivityLogDataFormat, setHttp2ClearTextUpgradeWithPreflightRequest, setTcpUserTimeout
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSeconds
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final boolean DEFAULT_USER_AGENT_ENABLED
public static final String DEFAULT_USER_AGENT
public static final boolean DEFAULT_FOLLOW_REDIRECTS
public static final ExpandOptions DEFAULT_EXPAND_OPTIONS
public WebClientOptions()
public WebClientOptions(WebClientOptions other)
other
- the options to copypublic WebClientOptions(HttpClientOptions other)
HttpClientOptions
.other
- the options to copypublic WebClientOptions(JsonObject json)
json
- the JSON objectpublic JsonObject toJson()
toJson
in class HttpClientOptions
public boolean isUserAgentEnabled()
public WebClientOptions setUserAgentEnabled(boolean userAgentEnabled)
userAgentEnabled
- true to send a user agent header, false otherwisepublic String getUserAgent()
public WebClientOptions setUserAgent(String userAgent)
userAgent
- user agent header valuepublic boolean isFollowRedirects()
30x
redirectionspublic WebClientOptions setFollowRedirects(boolean followRedirects)
30x
redirections.followRedirects
- true when a redirect is followedpublic ExpandOptions getTemplateExpandOptions()
public WebClientOptions setTemplateExpandOptions(ExpandOptions templateExpandOptions)
public WebClientOptions setMaxRedirects(int maxRedirects)
HttpClientOptions
maxRedirects
the maximum number of redirection a request can follow.setMaxRedirects
in class HttpClientOptions
maxRedirects
- the maximum number of redirectionpublic WebClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class HttpClientOptions
sendBufferSize
- the buffers size, in bytespublic WebClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class HttpClientOptions
receiveBufferSize
- the buffers size, in bytespublic WebClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class HttpClientOptions
reuseAddress
- the value of reuse addresspublic WebClientOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class HttpClientOptions
trafficClass
- the value of traffic classpublic WebClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class HttpClientOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public WebClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class HttpClientOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic WebClientOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class HttpClientOptions
soLinger
- true if SO_linger is enabledpublic WebClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class HttpClientOptions
idleTimeout
- the timeoutpublic WebClientOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class HttpClientOptions
idleTimeoutUnit
- specify time unit.public WebClientOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class HttpClientOptions
ssl
- true if enabledpublic WebClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class HttpClientOptions
options
- the key store optionspublic WebClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class HttpClientOptions
options
- the key store in jks formatpublic WebClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class HttpClientOptions
options
- the key cert options in pfx formatpublic WebClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class HttpClientOptions
options
- the trust optionspublic WebClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class HttpClientOptions
options
- the options in pem formatpublic WebClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class HttpClientOptions
options
- the trust options in jks formatpublic WebClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class HttpClientOptions
options
- the trust options in pfx formatpublic WebClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class HttpClientOptions
options
- the trust options in pem formatpublic WebClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class HttpClientOptions
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public WebClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class HttpClientOptions
crlPath
- the pathNullPointerException
public WebClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class HttpClientOptions
crlValue
- the valueNullPointerException
public WebClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBase
setConnectTimeout
in class HttpClientOptions
connectTimeout
- connect timeout, in mspublic WebClientOptions setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class HttpClientOptions
trustAll
- true if all should be trustedpublic WebClientOptions setMaxPoolSize(int maxPoolSize)
HttpClientOptions
setMaxPoolSize
in class HttpClientOptions
maxPoolSize
- the maximum pool sizepublic WebClientOptions setHttp2MultiplexingLimit(int limit)
HttpClientOptions
-1
means to use the value sent by the server's initial settings.
-1
is the default value.setHttp2MultiplexingLimit
in class HttpClientOptions
limit
- the maximum concurrent for an HTTP/2 connectionpublic WebClientOptions setHttp2MaxPoolSize(int max)
HttpClientOptions
setHttp2MaxPoolSize
in class HttpClientOptions
max
- the maximum pool sizepublic WebClientOptions setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
HttpClientOptions
Http2Settings.getInitialWindowSize()
, so the connection window size
is greater than for its streams, in order the data throughput.
A value of -1
reuses the initial window size setting.setHttp2ConnectionWindowSize
in class HttpClientOptions
http2ConnectionWindowSize
- the window size applied to the connectionpublic WebClientOptions setKeepAlive(boolean keepAlive)
HttpClientOptions
setKeepAlive
in class HttpClientOptions
keepAlive
- true
if enabledpublic WebClientOptions setPipelining(boolean pipelining)
HttpClientOptions
setPipelining
in class HttpClientOptions
pipelining
- true
if enabledpublic WebClientOptions setPipeliningLimit(int limit)
HttpClientOptions
setPipeliningLimit
in class HttpClientOptions
limit
- the limit of pending requestspublic WebClientOptions setVerifyHost(boolean verifyHost)
HttpClientOptions
setVerifyHost
in class HttpClientOptions
verifyHost
- true
if enabled@Deprecated public WebClientOptions setTryUseCompression(boolean tryUseCompression)
HttpClientOptions
setTryUseCompression
in class HttpClientOptions
tryUseCompression
- true
if enabledpublic WebClientOptions setDecompressionSupported(boolean tryUseCompression)
HttpClientOptions
accepting-encoding
header set to a compression algorithm.setDecompressionSupported
in class HttpClientOptions
tryUseCompression
- true
if the client should send a request with an accepting-encoding
header set to a compression algorithm, false
otherwisepublic WebClientOptions setSendUnmaskedFrames(boolean sendUnmaskedFrames)
HttpClientOptions
true
when the client wants to skip frame masking.
You may want to set it true
on server by server WebSocket communication: in this case you are by passing
RFC6455 protocol.
It's false
as default.
setSendUnmaskedFrames
in class HttpClientOptions
sendUnmaskedFrames
- true if enabledpublic WebClientOptions setMaxWebSocketFrameSize(int maxWebsocketFrameSize)
HttpClientOptions
setMaxWebSocketFrameSize
in class HttpClientOptions
maxWebsocketFrameSize
- the max frame size, in bytespublic WebClientOptions setDefaultHost(String defaultHost)
HttpClientOptions
setDefaultHost
in class HttpClientOptions
public WebClientOptions setDefaultPort(int defaultPort)
HttpClientOptions
setDefaultPort
in class HttpClientOptions
public WebClientOptions setMaxChunkSize(int maxChunkSize)
HttpClientOptions
setMaxChunkSize
in class HttpClientOptions
maxChunkSize
- the maximum chunk sizepublic WebClientOptions setProtocolVersion(HttpVersion protocolVersion)
HttpClientOptions
setProtocolVersion
in class HttpClientOptions
protocolVersion
- the protocol versionpublic WebClientOptions setMaxHeaderSize(int maxHeaderSize)
HttpClientOptions
setMaxHeaderSize
in class HttpClientOptions
maxHeaderSize
- the new maximum lengthpublic WebClientOptions setMaxWaitQueueSize(int maxWaitQueueSize)
HttpClientOptions
setMaxWaitQueueSize
in class HttpClientOptions
maxWaitQueueSize
- the maximum number of waiting requestspublic WebClientOptions setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class HttpClientOptions
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic WebClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class HttpClientOptions
sslEngineOptions
- the ssl engine to usepublic WebClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class HttpClientOptions
public WebClientOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class HttpClientOptions
public WebClientOptions setHttp2ClearTextUpgrade(boolean value)
HttpClientOptions
true
when an h2c connection is established using an HTTP/1.1 upgrade request, and false
when an h2c connection is established directly (with prior knowledge).setHttp2ClearTextUpgrade
in class HttpClientOptions
value
- the upgrade valuepublic WebClientOptions setAlpnVersions(List<HttpVersion> alpnVersions)
HttpClientOptions
HttpClientOptions.setProtocolVersion(io.vertx.core.http.HttpVersion)
:
HttpVersion.HTTP_2
: [ "h2", "http/1.1" ]HttpClientOptions.getProtocolVersion()
]setAlpnVersions
in class HttpClientOptions
alpnVersions
- the versionspublic WebClientOptions setMetricsName(String metricsName)
ClientOptionsBase
setMetricsName
in class HttpClientOptions
metricsName
- the metrics namepublic WebClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class HttpClientOptions
proxyOptions
- proxy options objectpublic WebClientOptions setLocalAddress(String localAddress)
ClientOptionsBase
setLocalAddress
in class HttpClientOptions
localAddress
- the local addresspublic WebClientOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class HttpClientOptions
logEnabled
- true for logging the network activitypublic WebClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class HttpClientOptions
protocol
- the SSL/TLS protocol to enablepublic WebClientOptions removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class HttpClientOptions
protocol
- the SSL/TLS protocol to disablepublic WebClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptions
setEnabledSecureTransportProtocols
in class HttpClientOptions
enabledSecureTransportProtocols
- the SSL/TLS protocols to enablepublic WebClientOptions setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class HttpClientOptions
reusePort
- the value of reuse portpublic WebClientOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class HttpClientOptions
tcpFastOpen
- the fast open valuepublic WebClientOptions setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class HttpClientOptions
tcpCork
- the cork valuepublic WebClientOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class HttpClientOptions
tcpQuickAck
- the quick ack valuepublic WebClientOptions setHttp2KeepAliveTimeout(int keepAliveTimeout)
HttpClientOptions
0
means there is no timeout.setHttp2KeepAliveTimeout
in class HttpClientOptions
keepAliveTimeout
- the timeout, in secondspublic WebClientOptions setForceSni(boolean forceSni)
HttpClientOptions
true
forces the server name to be always sent.setForceSni
in class HttpClientOptions
forceSni
- true
when the client should always use SNI on TLS/SSL connectionspublic WebClientOptions setDecoderInitialBufferSize(int decoderInitialBufferSize)
HttpClientOptions
initialBufferSizeHttpDecoder
the initial buffer of the HttpDecoder.setDecoderInitialBufferSize
in class HttpClientOptions
decoderInitialBufferSize
- the initial buffer sizepublic WebClientOptions setPoolCleanerPeriod(int poolCleanerPeriod)
HttpClientOptions
setPoolCleanerPeriod
in class HttpClientOptions
poolCleanerPeriod
- the pool cleaner periodpublic WebClientOptions setKeepAliveTimeout(int keepAliveTimeout)
HttpClientOptions
0
means there is no timeout.setKeepAliveTimeout
in class HttpClientOptions
keepAliveTimeout
- the timeout, in secondspublic WebClientOptions setMaxWebSocketMessageSize(int maxWebsocketMessageSize)
HttpClientOptions
setMaxWebSocketMessageSize
in class HttpClientOptions
maxWebsocketMessageSize
- the max message size, in bytespublic WebClientOptions setMaxInitialLineLength(int maxInitialLineLength)
HttpClientOptions
"HTTP/1.1 200 OK"
)setMaxInitialLineLength
in class HttpClientOptions
maxInitialLineLength
- the new maximum initial lengthpublic WebClientOptions setInitialSettings(Http2Settings settings)
HttpClientOptions
setInitialSettings
in class HttpClientOptions
settings
- the settings valuepublic WebClientOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class HttpClientOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic WebClientOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class HttpClientOptions
sslHandshakeTimeoutUnit
- specify time unit.public WebClientOptions setTryUsePerFrameWebSocketCompression(boolean offer)
HttpClientOptions
setTryUsePerFrameWebSocketCompression
in class HttpClientOptions
offer
- true
to offer the per-frame deflate compression extensionpublic WebClientOptions setTryUsePerMessageWebSocketCompression(boolean offer)
HttpClientOptions
setTryUsePerMessageWebSocketCompression
in class HttpClientOptions
offer
- true
to offer the per-message deflate compression extensionpublic WebClientOptions setWebSocketCompressionLevel(int compressionLevel)
HttpClientOptions
setWebSocketCompressionLevel
in class HttpClientOptions
compressionLevel
- the WebSocket deflate compression levelpublic WebClientOptions setWebSocketCompressionAllowClientNoContext(boolean offer)
HttpClientOptions
client_no_context_takeover
parameter of the WebSocket per-message
deflate compression extension will be offered.setWebSocketCompressionAllowClientNoContext
in class HttpClientOptions
offer
- true
to offer the client_no_context_takeover
parameterpublic WebClientOptions setWebSocketCompressionRequestServerNoContext(boolean offer)
HttpClientOptions
server_no_context_takeover
parameter of the WebSocket per-message
deflate compression extension will be offered.setWebSocketCompressionRequestServerNoContext
in class HttpClientOptions
offer
- true
to offer the server_no_context_takeover
parameterpublic WebClientOptions setReadIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setReadIdleTimeout
in class HttpClientOptions
idleTimeout
- the read timeoutpublic WebClientOptions setWriteIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setWriteIdleTimeout
in class HttpClientOptions
idleTimeout
- the write timeoutpublic WebClientOptions setMaxWebSockets(int maxWebSockets)
HttpClientOptions
setMaxWebSockets
in class HttpClientOptions
maxWebSockets
- the max valuepublic WebClientOptions setNonProxyHosts(List<String> nonProxyHosts)
ClientOptionsBase
nonProxyHosts
configuration.
Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
setNonProxyHosts
in class HttpClientOptions
nonProxyHosts
- the list of non proxies hostspublic WebClientOptions addNonProxyHost(String nonProxyHost)
ClientOptionsBase
host
to the ClientOptionsBase.getNonProxyHosts()
list.addNonProxyHost
in class HttpClientOptions
nonProxyHost
- the added hostpublic WebClientOptions setWebSocketClosingTimeout(int webSocketClosingTimeout)
HttpClientOptions
When a WebSocket is closed, the server should close the TCP connection. This timeout will close the TCP connection on the client when it expires.
Set to 0L
closes the TCP connection immediately after receiving the close frame.
Set to a negative value to disable it.
setWebSocketClosingTimeout
in class HttpClientOptions
webSocketClosingTimeout
- the timeout is secondspublic WebClientOptions setTracingPolicy(TracingPolicy tracingPolicy)
HttpClientOptions
setTracingPolicy
in class HttpClientOptions
tracingPolicy
- the tracing policypublic WebClientOptions setPoolEventLoopSize(int poolEventLoopSize)
HttpClientOptions
0
, the client pool will use the current event-loop0
.setPoolEventLoopSize
in class HttpClientOptions
poolEventLoopSize
- the new sizepublic WebClientOptions setShared(boolean shared)
HttpClientOptions
true
to share the client.
There can be multiple shared clients distinguished by HttpClientOptions.getName()
, when no specific
name is set, the HttpClientOptions.DEFAULT_NAME
is used.
setShared
in class HttpClientOptions
shared
- true
to use a shared clientpublic WebClientOptions setName(String name)
HttpClientOptions
setName
in class HttpClientOptions
name
- the new namepublic static String loadUserAgent()
Copyright © 2024 Eclipse. All rights reserved.