public class HttpClientOptions extends ClientOptionsBase
HttpClient will make connections.| Modifier and Type | Field and Description |
|---|---|
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_KEEP_ALIVE
Default value of whether keep-alive is enabled = true
|
static int |
DEFAULT_MAX_POOL_SIZE
The default maximum number of connections a client will pool = 5
|
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 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_TRUST_ALLDEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_POOLED_BUFFERSDEFAULT_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
|
boolean |
equals(Object o) |
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 |
getMaxPoolSize()
Get the maximum pool size for connections
|
int |
getMaxWebsocketFrameSize()
Get the maximum websocket framesize to use
|
HttpVersion |
getProtocolVersion()
Get the protocol version.
|
int |
hashCode() |
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 |
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 |
setIdleTimeout(int idleTimeout)
Set the idle timeout, in seconds.
|
HttpClientOptions |
setKeepAlive(boolean keepAlive)
Set whether keep alive is enabled on the client
|
HttpClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
HttpClientOptions |
setMaxPoolSize(int maxPoolSize)
Set the maximum pool size for connections
|
HttpClientOptions |
setMaxWebsocketFrameSize(int maxWebsocketFrameSize)
Set the max websocket frame size
|
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 |
setProtocolVersion(HttpVersion protocolVersion)
Set the protocol version.
|
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 |
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 |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java trustore
|
HttpClientOptions |
setTryUseCompression(boolean tryUseCompression)
Set whether compression is enabled
|
HttpClientOptions |
setUsePooledBuffers(boolean usePooledBuffers)
Set whether Netty pooled buffers are enabled
|
HttpClientOptions |
setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled
|
getConnectTimeout, isTrustAllgetCrlPaths, getCrlValues, getEnabledCipherSuites, getIdleTimeout, getKeyCertOptions, getSoLinger, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUsePooledBuffersgetReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddresspublic static final int DEFAULT_MAX_POOL_SIZE
public static final boolean DEFAULT_KEEP_ALIVE
public static final boolean DEFAULT_PIPELINING
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 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 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 setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class TCPSSLOptionsoptions - the options in pem formatpublic HttpClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class TCPSSLOptionsoptions - the options in jks formatpublic HttpClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class TCPSSLOptionsoptions - the options in pfx formatpublic HttpClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class TCPSSLOptionsoptions - the options in pem formatpublic HttpClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class TCPSSLOptionssuite - the suitepublic 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 boolean isKeepAlive()
public HttpClientOptions setKeepAlive(boolean keepAlive)
keepAlive - true if enabledpublic boolean isPipelining()
public HttpClientOptions setPipelining(boolean pipelining)
pipelining - true if enabledpublic 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 boolean equals(Object o)
equals in class ClientOptionsBasepublic int hashCode()
hashCode in class ClientOptionsBaseCopyright © 2015. All rights reserved.