public class NetClientOptions extends ClientOptionsBase
NetClient
.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM
Default value to determine hostname verification algorithm hostname verification (for SSL/TLS) = ""
|
static int |
DEFAULT_RECONNECT_ATTEMPTS
The default value for reconnect attempts = 0
|
static long |
DEFAULT_RECONNECT_INTERVAL
The default value for reconnect interval = 1000 ms
|
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 |
---|
NetClientOptions()
The default constructor
|
NetClientOptions(JsonObject json)
Create options from JSON
|
NetClientOptions(NetClientOptions other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
NetClientOptions |
addCrlPath(String crlPath)
Add a CRL path
|
NetClientOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
NetClientOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
NetClientOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
boolean |
equals(Object o) |
String |
getHostnameVerificationAlgorithm() |
int |
getReconnectAttempts() |
long |
getReconnectInterval() |
int |
hashCode() |
NetClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
NetClientOptions |
setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
Set the hostname verification algorithm interval
To disable hostname verification, set hostnameVerificationAlgorithm to an empty String
|
NetClientOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, in seconds.
|
NetClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
NetClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
NetClientOptions |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
NetClientOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
NetClientOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
NetClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
NetClientOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
NetClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
NetClientOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
NetClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
NetClientOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
NetClientOptions |
setReconnectAttempts(int attempts)
Set the value of reconnect attempts
|
NetClientOptions |
setReconnectInterval(long interval)
Set the reconnect interval
|
NetClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
NetClientOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
NetClientOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
NetClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
NetClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
NetClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
NetClientOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
NetClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
NetClientOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
NetClientOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
NetClientOptions |
setUsePooledBuffers(boolean usePooledBuffers)
Set whether Netty pooled buffers are enabled
|
getConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAll, toJson
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getTrustOptions, getTrustStoreOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffers, setJdkSslEngineOptions, setOpenSslEngineOptions, setSslEngineOptions, setUseAlpn
getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress
public static final int DEFAULT_RECONNECT_ATTEMPTS
public static final long DEFAULT_RECONNECT_INTERVAL
public static final String DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM
public NetClientOptions()
public NetClientOptions(NetClientOptions other)
other
- the options to copypublic NetClientOptions(JsonObject json)
json
- the JSONpublic NetClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class NetworkOptions
sendBufferSize
- the buffers size, in bytespublic NetClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class NetworkOptions
receiveBufferSize
- the buffers size, in bytespublic NetClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class NetworkOptions
reuseAddress
- the value of reuse addresspublic NetClientOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class NetworkOptions
trafficClass
- the value of traffic classpublic NetClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class TCPSSLOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public NetClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class TCPSSLOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic NetClientOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class TCPSSLOptions
soLinger
- true if SO_linger is enabledpublic NetClientOptions setUsePooledBuffers(boolean usePooledBuffers)
TCPSSLOptions
setUsePooledBuffers
in class TCPSSLOptions
usePooledBuffers
- true if pooled buffers enabledpublic NetClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
setIdleTimeout
in class TCPSSLOptions
idleTimeout
- the timeout, in secondspublic NetClientOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class TCPSSLOptions
ssl
- true if enabledpublic NetClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class TCPSSLOptions
options
- the key store optionspublic NetClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class TCPSSLOptions
options
- the key store in jks formatpublic NetClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class TCPSSLOptions
options
- the key cert options in pfx formatpublic NetClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class TCPSSLOptions
options
- the options in pem formatpublic NetClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class TCPSSLOptions
options
- the trust optionspublic NetClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class TCPSSLOptions
options
- the trust options in jks formatpublic NetClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class TCPSSLOptions
options
- the trust options in pem formatpublic NetClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class TCPSSLOptions
options
- the trust options in pfx formatpublic NetClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class TCPSSLOptions
suite
- the suitepublic NetClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class TCPSSLOptions
protocol
- the SSL/TLS protocol do enabledpublic NetClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class TCPSSLOptions
crlPath
- the pathNullPointerException
public NetClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class TCPSSLOptions
crlValue
- the valueNullPointerException
public NetClientOptions setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class ClientOptionsBase
trustAll
- true if all should be trustedpublic NetClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBase
setConnectTimeout
in class ClientOptionsBase
connectTimeout
- connect timeout, in mspublic NetClientOptions setMetricsName(String metricsName)
ClientOptionsBase
setMetricsName
in class ClientOptionsBase
metricsName
- the metrics namepublic NetClientOptions setReconnectAttempts(int attempts)
attempts
- the maximum number of reconnect attemptspublic int getReconnectAttempts()
public NetClientOptions setReconnectInterval(long interval)
interval
- the reconnect interval in mspublic String getHostnameVerificationAlgorithm()
public NetClientOptions setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
hostnameVerificationAlgorithm
- should be HTTPS, LDAPS or an empty Stringpublic long getReconnectInterval()
public NetClientOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class ClientOptionsBase
logEnabled
- true for logging the network activitypublic NetClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class ClientOptionsBase
proxyOptions
- proxy options objectpublic NetClientOptions setLocalAddress(String localAddress)
ClientOptionsBase
setLocalAddress
in class ClientOptionsBase
localAddress
- the local addresspublic boolean equals(Object o)
equals
in class ClientOptionsBase
public int hashCode()
hashCode
in class ClientOptionsBase
Copyright © 2017. All rights reserved.