public class HttpClientOptions extends ClientOptionsBase
HttpClient
will make connections.Modifier and Type | Field and Description |
---|---|
static List<HttpVersion> |
DEFAULT_ALPN_VERSIONS
Default Application-Layer Protocol Negotiation versions = [] (automatic according to protocol version)
|
static String |
DEFAULT_DEFAULT_HOST
The default value for host name = "localhost"
|
static int |
DEFAULT_DEFAULT_PORT
The default value for port = 80
|
static boolean |
DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE
Default using HTTP/1.1 upgrade for establishing an h2C connection = true
|
static int |
DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
The default connection window size for HTTP/2 = -1
|
static int |
DEFAULT_HTTP2_MAX_POOL_SIZE
The default maximum number of connections an HTTP/2 client will pool = 1
|
static int |
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
The default maximum number of concurrent streams per connection for HTTP/2 = -1
|
static boolean |
DEFAULT_KEEP_ALIVE
Default value of whether keep-alive is enabled = true
|
static int |
DEFAULT_MAX_CHUNK_SIZE
Default max HTTP chunk size = 8192
|
static int |
DEFAULT_MAX_POOL_SIZE
The default maximum number of HTTP/1 connections a client will pool = 5
|
static int |
DEFAULT_MAX_WAIT_QUEUE_SIZE
Default max wait queue size = -1 (unbounded)
|
static int |
DEFAULT_MAX_WEBSOCKET_FRAME_SIZE
The default value for maximum websocket frame size = 65536 bytes
|
static boolean |
DEFAULT_PIPELINING
Default value of whether pipe-lining is enabled = false
|
static int |
DEFAULT_PIPELINING_LIMIT
The default maximum number of requests an HTTP/1.1 pipe-lined connection can send = 10
|
static HttpVersion |
DEFAULT_PROTOCOL_VERSION
The default protocol version = HTTP/1.1
|
static boolean |
DEFAULT_TRY_USE_COMPRESSION
Default value of whether the client will attempt to use compression = false
|
static boolean |
DEFAULT_VERIFY_HOST
Default value of whether hostname verification (for SSL/TLS) is enabled = true
|
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_ALPN, DEFAULT_USE_POOLED_BUFFERS
DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
HttpClientOptions()
Default constructor
|
HttpClientOptions(HttpClientOptions other)
Copy constructor
|
HttpClientOptions(JsonObject json)
Constructor to create an options from JSON
|
Modifier and Type | Method and Description |
---|---|
HttpClientOptions |
addCrlPath(String crlPath)
Add a CRL path
|
HttpClientOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
HttpClientOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite
|
HttpClientOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols
|
boolean |
equals(Object o) |
List<HttpVersion> |
getAlpnVersions() |
String |
getDefaultHost()
Get the default host name to be used by this client in requests if none is provided when making the request.
|
int |
getDefaultPort()
Get the default port to be used by this client in requests if none is provided when making the request.
|
int |
getHttp2ConnectionWindowSize() |
int |
getHttp2MaxPoolSize()
Get the maximum pool size for HTTP/2 connections
|
int |
getHttp2MultiplexingLimit() |
Http2Settings |
getInitialSettings() |
int |
getMaxChunkSize()
Returns the maximum HTTP chunk size
|
int |
getMaxPoolSize()
Get the maximum pool size for connections
|
int |
getMaxWaitQueueSize()
Returns the maximum wait queue size
|
int |
getMaxWebsocketFrameSize()
Get the maximum websocket framesize to use
|
int |
getPipeliningLimit() |
HttpVersion |
getProtocolVersion()
Get the protocol version.
|
int |
hashCode() |
boolean |
isHttp2ClearTextUpgrade() |
boolean |
isKeepAlive()
Is keep alive enabled on the client?
|
boolean |
isPipelining()
Is pipe-lining enabled on the client
|
boolean |
isTryUseCompression()
Is compression enabled on the client?
|
boolean |
isVerifyHost()
Is hostname verification (for SSL/TLS) enabled?
|
HttpClientOptions |
setAlpnVersions(List<HttpVersion> alpnVersions)
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.
|
HttpClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
HttpClientOptions |
setDefaultHost(String defaultHost)
Set the default host name to be used by this client in requests if none is provided when making the request.
|
HttpClientOptions |
setDefaultPort(int defaultPort)
Set the default port to be used by this client in requests if none is provided when making the request.
|
HttpClientOptions |
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). |
HttpClientOptions |
setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size.
|
HttpClientOptions |
setHttp2MaxPoolSize(int max)
Set the maximum pool size for HTTP/2 connections
|
HttpClientOptions |
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.
|
HttpClientOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, in seconds.
|
HttpClientOptions |
setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediately sent by to the server when the client connects.
|
HttpClientOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
HttpClientOptions |
setKeepAlive(boolean keepAlive)
Set whether keep alive is enabled on the client
|
HttpClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
HttpClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
HttpClientOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
HttpClientOptions |
setMaxChunkSize(int maxChunkSize)
Set the maximum HTTP chunk size
|
HttpClientOptions |
setMaxPoolSize(int maxPoolSize)
Set the maximum pool size for connections
|
HttpClientOptions |
setMaxWaitQueueSize(int maxWaitQueueSize)
Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in
a ConnectionPoolTooBusyException.
|
HttpClientOptions |
setMaxWebsocketFrameSize(int maxWebsocketFrameSize)
Set the max websocket frame size
|
HttpClientOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
HttpClientOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
HttpClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
HttpClientOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
HttpClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
HttpClientOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
HttpClientOptions |
setPipelining(boolean pipelining)
Set whether pipe-lining is enabled on the client
|
HttpClientOptions |
setPipeliningLimit(int limit)
Set the limit of pending requests a pipe-lined HTTP/1 connection can send.
|
HttpClientOptions |
setProtocolVersion(HttpVersion protocolVersion)
Set the protocol version.
|
HttpClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
HttpClientOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
HttpClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
HttpClientOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
HttpClientOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
HttpClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
HttpClientOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
HttpClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
HttpClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
HttpClientOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
HttpClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
HttpClientOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
HttpClientOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java trustore
|
HttpClientOptions |
setTryUseCompression(boolean tryUseCompression)
Set whether compression is enabled
|
HttpClientOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
HttpClientOptions |
setUsePooledBuffers(boolean usePooledBuffers)
Set whether Netty pooled buffers are enabled
|
HttpClientOptions |
setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled
|
getConnectTimeout, getMetricsName, getProxyOptions, isTrustAll
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getKeyCertOptions, getSoLinger, getSslEngineOptions, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffers
getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress
public static final int DEFAULT_MAX_POOL_SIZE
public static final int DEFAULT_HTTP2_MAX_POOL_SIZE
public static final int DEFAULT_HTTP2_MULTIPLEXING_LIMIT
public static final int DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
public static final boolean DEFAULT_KEEP_ALIVE
public static final boolean DEFAULT_PIPELINING
public static final int DEFAULT_PIPELINING_LIMIT
public static final boolean DEFAULT_TRY_USE_COMPRESSION
public static final boolean DEFAULT_VERIFY_HOST
public static final int DEFAULT_MAX_WEBSOCKET_FRAME_SIZE
public static final String DEFAULT_DEFAULT_HOST
public static final int DEFAULT_DEFAULT_PORT
public static final HttpVersion DEFAULT_PROTOCOL_VERSION
public static final int DEFAULT_MAX_CHUNK_SIZE
public static final int DEFAULT_MAX_WAIT_QUEUE_SIZE
public static final List<HttpVersion> DEFAULT_ALPN_VERSIONS
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE
public HttpClientOptions()
public HttpClientOptions(HttpClientOptions other)
other
- the options to copypublic HttpClientOptions(JsonObject json)
json
- the JSONpublic HttpClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class NetworkOptions
sendBufferSize
- the buffers size, in bytespublic HttpClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class NetworkOptions
receiveBufferSize
- the buffers size, in bytespublic HttpClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class NetworkOptions
reuseAddress
- the value of reuse addresspublic HttpClientOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class NetworkOptions
trafficClass
- the value of traffic classpublic HttpClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class TCPSSLOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public HttpClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class TCPSSLOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic HttpClientOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class TCPSSLOptions
soLinger
- true if SO_linger is enabledpublic HttpClientOptions setUsePooledBuffers(boolean usePooledBuffers)
TCPSSLOptions
setUsePooledBuffers
in class TCPSSLOptions
usePooledBuffers
- true if pooled buffers enabledpublic HttpClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
setIdleTimeout
in class TCPSSLOptions
idleTimeout
- the timeout, in secondspublic HttpClientOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class TCPSSLOptions
ssl
- true if enabledpublic HttpClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class TCPSSLOptions
options
- the key store optionspublic HttpClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class TCPSSLOptions
options
- the key store in jks formatpublic HttpClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class TCPSSLOptions
options
- the key cert options in pfx formatpublic HttpClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class TCPSSLOptions
options
- the trust optionspublic HttpClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class TCPSSLOptions
options
- the options in pem formatpublic HttpClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class TCPSSLOptions
options
- the trust options in jks formatpublic HttpClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class TCPSSLOptions
options
- the trust options in pfx formatpublic HttpClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class TCPSSLOptions
options
- the trust options in pem formatpublic HttpClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class TCPSSLOptions
suite
- the suitepublic HttpClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class TCPSSLOptions
protocol
- the SSL/TLS protocol do enabledpublic HttpClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class TCPSSLOptions
crlPath
- the pathNullPointerException
public HttpClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class TCPSSLOptions
crlValue
- the valueNullPointerException
public HttpClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBase
setConnectTimeout
in class ClientOptionsBase
connectTimeout
- connect timeout, in mspublic HttpClientOptions setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class ClientOptionsBase
trustAll
- true if all should be trustedpublic int getMaxPoolSize()
public HttpClientOptions setMaxPoolSize(int maxPoolSize)
maxPoolSize
- the maximum pool sizepublic int getHttp2MultiplexingLimit()
-1
means
the value sent by the serverpublic HttpClientOptions setHttp2MultiplexingLimit(int limit)
-1
means to use the value sent by the server's initial settings.
-1
is the default value.limit
- the maximum concurrent for an HTTP/2 connectionpublic int getHttp2MaxPoolSize()
public HttpClientOptions setHttp2MaxPoolSize(int max)
max
- the maximum pool sizepublic int getHttp2ConnectionWindowSize()
public HttpClientOptions setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
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.http2ConnectionWindowSize
- the window size applied to the connectionpublic boolean isKeepAlive()
public HttpClientOptions setKeepAlive(boolean keepAlive)
keepAlive
- true if enabledpublic boolean isPipelining()
public HttpClientOptions setPipelining(boolean pipelining)
pipelining
- true if enabledpublic int getPipeliningLimit()
public HttpClientOptions setPipeliningLimit(int limit)
limit
- the limit of pending requestspublic boolean isVerifyHost()
public HttpClientOptions setVerifyHost(boolean verifyHost)
verifyHost
- true if enabledpublic boolean isTryUseCompression()
public HttpClientOptions setTryUseCompression(boolean tryUseCompression)
tryUseCompression
- true if enabledpublic int getMaxWebsocketFrameSize()
public HttpClientOptions setMaxWebsocketFrameSize(int maxWebsocketFrameSize)
maxWebsocketFrameSize
- the max frame size, in bytespublic String getDefaultHost()
public HttpClientOptions setDefaultHost(String defaultHost)
public int getDefaultPort()
public HttpClientOptions setDefaultPort(int defaultPort)
public HttpVersion getProtocolVersion()
public HttpClientOptions setProtocolVersion(HttpVersion protocolVersion)
protocolVersion
- the protocol versionpublic HttpClientOptions setMaxChunkSize(int maxChunkSize)
maxChunkSize
- the maximum chunk sizepublic int getMaxChunkSize()
public HttpClientOptions setMaxWaitQueueSize(int maxWaitQueueSize)
maxWaitQueueSize
- the maximum number of waiting requestspublic int getMaxWaitQueueSize()
public Http2Settings getInitialSettings()
public HttpClientOptions setInitialSettings(Http2Settings settings)
settings
- the settings valuepublic HttpClientOptions setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class TCPSSLOptions
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic HttpClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class TCPSSLOptions
sslEngineOptions
- the ssl engine to usepublic HttpClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class TCPSSLOptions
public HttpClientOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class TCPSSLOptions
public List<HttpVersion> getAlpnVersions()
setProtocolVersion(io.vertx.core.http.HttpVersion)
public HttpClientOptions setAlpnVersions(List<HttpVersion> alpnVersions)
setProtocolVersion(io.vertx.core.http.HttpVersion)
:
HttpVersion.HTTP_2
: [ "h2", "http/1.1" ]getProtocolVersion()
]alpnVersions
- the versionspublic boolean isHttp2ClearTextUpgrade()
public HttpClientOptions setHttp2ClearTextUpgrade(boolean value)
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).value
- the upgrade valuepublic HttpClientOptions setMetricsName(String metricsName)
ClientOptionsBase
setMetricsName
in class ClientOptionsBase
metricsName
- the metrics namepublic HttpClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class ClientOptionsBase
proxyOptions
- proxy options objectpublic HttpClientOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class ClientOptionsBase
logEnabled
- true for logging the network activitypublic boolean equals(Object o)
equals
in class ClientOptionsBase
public int hashCode()
hashCode
in class ClientOptionsBase
Copyright © 2016. All rights reserved.