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) = null
|
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
|
static boolean |
DEFAULT_REGISTER_WRITE_HANDLER
Whether a write-handler should be registered by default = false.
|
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_KEEPALIVE_COUNT, DEFAULT_TCP_KEEPALIVE_IDLE_SECONDS, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUT
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
NetClientOptions()
The default constructor
|
NetClientOptions(ClientOptionsBase other)
Create an instance copying the values from
other and using the defaults of NetClientOptions . |
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.
|
NetClientOptions |
addNonProxyHost(String nonProxyHost)
Add a
host to the ClientOptionsBase.getNonProxyHosts() list. |
List<String> |
getApplicationLayerProtocols() |
String |
getHostnameVerificationAlgorithm() |
int |
getReconnectAttempts() |
long |
getReconnectInterval() |
boolean |
isRegisterWriteHandler() |
NetClientOptions |
removeEnabledCipherSuite(String suite)
Removes an enabled cipher suite from the ordered suites.
|
NetClientOptions |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
NetClientOptions |
setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.
|
NetClientOptions |
setApplicationLayerProtocols(List<String> protocols)
Set the list of application-layer protocols to provide to the server during the Application-Layer Protocol Negotiation.
|
NetClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
NetClientOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
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, default time unit is seconds.
|
NetClientOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
NetClientOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
Deprecated.
|
NetClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
NetClientOptions |
setKeyStoreOptions(JksOptions options)
Deprecated.
|
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 |
setNonProxyHosts(List<String> nonProxyHosts)
Set a list of remote hosts that are not proxied when the client is configured to use a proxy.
|
ClientOptionsBase |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
Deprecated.
|
NetClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Deprecated.
|
NetClientOptions |
setPemTrustOptions(PemTrustOptions options)
Deprecated.
|
NetClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Deprecated.
|
NetClientOptions |
setPfxTrustOptions(PfxOptions options)
Deprecated.
|
NetClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
NetClientOptions |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
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 |
setRegisterWriteHandler(boolean registerWriteHandler)
Whether a write-handler should be registered on the
EventBus . |
NetClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
NetClientOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
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 |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
NetClientOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
NetClientOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
NetClientOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
NetClientOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
NetClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
NetClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
NetClientOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
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)
Deprecated.
|
NetClientOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
NetClientOptions |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, setTcpUserTimeout
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSeconds
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final int DEFAULT_RECONNECT_ATTEMPTS
public static final long DEFAULT_RECONNECT_INTERVAL
public static final String DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM
public static final boolean DEFAULT_REGISTER_WRITE_HANDLER
public NetClientOptions()
public NetClientOptions(NetClientOptions other)
other
- the options to copypublic NetClientOptions(ClientOptionsBase other)
other
and using the defaults of NetClientOptions
.other
- the options to copypublic NetClientOptions(JsonObject json)
json
- the JSONpublic NetClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class ClientOptionsBase
sendBufferSize
- the buffers size, in bytespublic NetClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class ClientOptionsBase
receiveBufferSize
- the buffers size, in bytespublic NetClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class ClientOptionsBase
reuseAddress
- the value of reuse addresspublic NetClientOptions setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class ClientOptionsBase
reusePort
- the value of reuse portpublic NetClientOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class ClientOptionsBase
trafficClass
- the value of traffic classpublic NetClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class ClientOptionsBase
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public NetClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class ClientOptionsBase
tcpKeepAlive
- true if TCP keep alive is enabledpublic NetClientOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class ClientOptionsBase
soLinger
- true if SO_linger is enabledpublic NetClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class ClientOptionsBase
idleTimeout
- the timeoutpublic NetClientOptions setReadIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setReadIdleTimeout
in class ClientOptionsBase
idleTimeout
- the read timeoutpublic NetClientOptions setWriteIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setWriteIdleTimeout
in class ClientOptionsBase
idleTimeout
- the write timeoutpublic NetClientOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class ClientOptionsBase
idleTimeoutUnit
- specify time unit.public NetClientOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class ClientOptionsBase
ssl
- true if enabledpublic NetClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class ClientOptionsBase
options
- the key store options@Deprecated public NetClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class ClientOptionsBase
options
- the key store in jks format@Deprecated public NetClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class ClientOptionsBase
options
- the key cert options in pfx format@Deprecated public NetClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class ClientOptionsBase
options
- the options in pem formatpublic NetClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class ClientOptionsBase
options
- the trust options@Deprecated public NetClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class ClientOptionsBase
options
- the trust options in jks format@Deprecated public NetClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class ClientOptionsBase
options
- the trust options in pem format@Deprecated public NetClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class ClientOptionsBase
options
- the trust options in pfx formatpublic NetClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class ClientOptionsBase
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public NetClientOptions removeEnabledCipherSuite(String suite)
TCPSSLOptions
removeEnabledCipherSuite
in class ClientOptionsBase
suite
- the suitepublic NetClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class ClientOptionsBase
protocol
- the SSL/TLS protocol to enablepublic NetClientOptions removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class ClientOptionsBase
protocol
- the SSL/TLS protocol to disablepublic NetClientOptions setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class ClientOptionsBase
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic NetClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class ClientOptionsBase
sslEngineOptions
- the ssl engine to use@Deprecated public NetClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class ClientOptionsBase
public NetClientOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class ClientOptionsBase
tcpFastOpen
- the fast open valuepublic NetClientOptions setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class ClientOptionsBase
tcpCork
- the cork valuepublic NetClientOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class ClientOptionsBase
tcpQuickAck
- the quick ack value@Deprecated public ClientOptionsBase setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class ClientOptionsBase
public NetClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class ClientOptionsBase
crlPath
- the pathNullPointerException
public NetClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class ClientOptionsBase
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 List<String> getApplicationLayerProtocols()
public NetClientOptions setApplicationLayerProtocols(List<String> protocols)
protocols
- the protocolspublic long getReconnectInterval()
public NetClientOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class ClientOptionsBase
logEnabled
- true for logging the network activitypublic NetClientOptions setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptions
setActivityLogDataFormat
in class ClientOptionsBase
activityLogDataFormat
- the format to usepublic NetClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class ClientOptionsBase
proxyOptions
- proxy options objectpublic NetClientOptions setNonProxyHosts(List<String> nonProxyHosts)
ClientOptionsBase
nonProxyHosts
configuration.
Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
setNonProxyHosts
in class ClientOptionsBase
nonProxyHosts
- the list of non proxies hostspublic NetClientOptions addNonProxyHost(String nonProxyHost)
ClientOptionsBase
host
to the ClientOptionsBase.getNonProxyHosts()
list.addNonProxyHost
in class ClientOptionsBase
nonProxyHost
- the added hostpublic NetClientOptions setLocalAddress(String localAddress)
ClientOptionsBase
setLocalAddress
in class ClientOptionsBase
localAddress
- the local addresspublic NetClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptions
setEnabledSecureTransportProtocols
in class TCPSSLOptions
enabledSecureTransportProtocols
- the SSL/TLS protocols to enablepublic NetClientOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class TCPSSLOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic NetClientOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class TCPSSLOptions
sslHandshakeTimeoutUnit
- specify time unit.public JsonObject toJson()
ClientOptionsBase
toJson
in class ClientOptionsBase
public boolean isRegisterWriteHandler()
true
if a write-handler should be registered on the EventBus
, otherwise false
public NetClientOptions setRegisterWriteHandler(boolean registerWriteHandler)
EventBus
.
Defaults to false
.
registerWriteHandler
- true to register a write-handlerNetSocket.writeHandlerID()
Copyright © 2024 Eclipse. All rights reserved.