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_ALLDEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_ALPN, DEFAULT_USE_POOLED_BUFFERSDEFAULT_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, isTrustAllgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getKeyCertOptions, getSoLinger, getSslEngineOptions, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffersgetLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddresspublic 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)
NetworkOptionssetSendBufferSize in class NetworkOptionssendBufferSize - the buffers size, in bytespublic HttpClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptionssetReceiveBufferSize in class NetworkOptionsreceiveBufferSize - the buffers size, in bytespublic HttpClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptionssetReuseAddress in class NetworkOptionsreuseAddress - the value of reuse addresspublic HttpClientOptions setTrafficClass(int trafficClass)
NetworkOptionssetTrafficClass in class NetworkOptionstrafficClass - the value of traffic classpublic HttpClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptionssetTcpNoDelay in class TCPSSLOptionstcpNoDelay - true if TCP no delay is enabled (Nagle disabled)public HttpClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptionssetTcpKeepAlive in class TCPSSLOptionstcpKeepAlive - true if TCP keep alive is enabledpublic HttpClientOptions setSoLinger(int soLinger)
TCPSSLOptionssetSoLinger in class TCPSSLOptionssoLinger - true if SO_linger is enabledpublic HttpClientOptions setUsePooledBuffers(boolean usePooledBuffers)
TCPSSLOptionssetUsePooledBuffers in class TCPSSLOptionsusePooledBuffers - true if pooled buffers enabledpublic HttpClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptionssetIdleTimeout in class TCPSSLOptionsidleTimeout - the timeout, in secondspublic HttpClientOptions setSsl(boolean ssl)
TCPSSLOptionssetSsl in class TCPSSLOptionsssl - true if enabledpublic HttpClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptionssetKeyCertOptions in class TCPSSLOptionsoptions - the key store optionspublic HttpClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptionssetKeyStoreOptions in class TCPSSLOptionsoptions - the key store in jks formatpublic HttpClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptionssetPfxKeyCertOptions in class TCPSSLOptionsoptions - the key cert options in pfx formatpublic HttpClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptionssetTrustOptions in class TCPSSLOptionsoptions - the trust optionspublic HttpClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class TCPSSLOptionsoptions - the options in pem formatpublic HttpClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class TCPSSLOptionsoptions - the trust options in jks formatpublic HttpClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class TCPSSLOptionsoptions - the trust options in pfx formatpublic HttpClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class TCPSSLOptionsoptions - the trust options in pem formatpublic HttpClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class TCPSSLOptionssuite - the suitepublic HttpClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsaddEnabledSecureTransportProtocol in class TCPSSLOptionsprotocol - the SSL/TLS protocol do enabledpublic HttpClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptionsaddCrlPath in class TCPSSLOptionscrlPath - the pathNullPointerExceptionpublic HttpClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptionsaddCrlValue in class TCPSSLOptionscrlValue - the valueNullPointerExceptionpublic HttpClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBasesetConnectTimeout in class ClientOptionsBaseconnectTimeout - connect timeout, in mspublic HttpClientOptions setTrustAll(boolean trustAll)
ClientOptionsBasesetTrustAll in class ClientOptionsBasetrustAll - 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)
TCPSSLOptionssetUseAlpn in class TCPSSLOptionsuseAlpn - true when Application-Layer Protocol Negotiation should be usedpublic HttpClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptionssetSslEngineOptions in class TCPSSLOptionssslEngineOptions - the ssl engine to usepublic HttpClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions in class TCPSSLOptionspublic HttpClientOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions in class TCPSSLOptionspublic 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)
ClientOptionsBasesetMetricsName in class ClientOptionsBasemetricsName - the metrics namepublic HttpClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBasesetProxyOptions in class ClientOptionsBaseproxyOptions - proxy options objectpublic HttpClientOptions setLogActivity(boolean logEnabled)
NetworkOptionssetLogActivity in class ClientOptionsBaselogEnabled - true for logging the network activitypublic boolean equals(Object o)
equals in class ClientOptionsBasepublic int hashCode()
hashCode in class ClientOptionsBaseCopyright © 2016. All rights reserved.