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 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_ALL
DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_POOLED_BUFFERS
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
|
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
|
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 |
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, isTrustAll
getCrlPaths, getCrlValues, getEnabledCipherSuites, getIdleTimeout, getKeyCertOptions, getSoLinger, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUsePooledBuffers
getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress
public 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 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 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 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 options in jks formatpublic HttpClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class TCPSSLOptions
options
- the options in pfx formatpublic HttpClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class TCPSSLOptions
options
- the options in pem formatpublic HttpClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class TCPSSLOptions
suite
- the suitepublic 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 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 boolean equals(Object o)
equals
in class ClientOptionsBase
public int hashCode()
hashCode
in class ClientOptionsBase
Copyright © 2015. All Rights Reserved.