public abstract class ClientOptionsBase extends TCPSSLOptions
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECT_TIMEOUT
The default value of connect timeout = 60000 ms
|
static String |
DEFAULT_METRICS_NAME
The default value of the client metrics = "":
|
static boolean |
DEFAULT_TRUST_ALL
The default value of whether all servers (SSL/TLS) should be trusted = false
|
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_KEEP_ALIVE, 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 |
---|
ClientOptionsBase()
Default constructor
|
ClientOptionsBase(ClientOptionsBase other)
Copy constructor
|
ClientOptionsBase(JsonObject json)
Create options from some JSON
|
Modifier and Type | Method and Description |
---|---|
ClientOptionsBase |
addCrlPath(String crlPath)
Add a CRL path
|
ClientOptionsBase |
addCrlValue(Buffer crlValue)
Add a CRL value
|
ClientOptionsBase |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
ClientOptionsBase |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
ClientOptionsBase |
addNonProxyHost(String host)
Add a
host to the getNonProxyHosts() list. |
int |
getConnectTimeout() |
String |
getLocalAddress() |
String |
getMetricsName() |
List<String> |
getNonProxyHosts() |
ProxyOptions |
getProxyOptions()
Get proxy options for connections
|
boolean |
isTrustAll() |
ClientOptionsBase |
removeEnabledCipherSuite(String suite)
Removes an enabled cipher suite from the ordered suites.
|
ClientOptionsBase |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
ClientOptionsBase |
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.
|
ClientOptionsBase |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
ClientOptionsBase |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
ClientOptionsBase |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
ClientOptionsBase |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
ClientOptionsBase |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
ClientOptionsBase |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
ClientOptionsBase |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
ClientOptionsBase |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
ClientOptionsBase |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
ClientOptionsBase |
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) |
ClientOptionsBase |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
ClientOptionsBase |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
ClientOptionsBase |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
ClientOptionsBase |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
ClientOptionsBase |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
ClientOptionsBase |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
ClientOptionsBase |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
ClientOptionsBase |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
ClientOptionsBase |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
ClientOptionsBase |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
ClientOptionsBase |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
ClientOptionsBase |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
ClientOptionsBase |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
ClientOptionsBase |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
ClientOptionsBase |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
ClientOptionsBase |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
ClientOptionsBase |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
ClientOptionsBase |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
ClientOptionsBase |
setTcpUserTimeout(int tcpUserTimeout)
Sets the
TCP_USER_TIMEOUT option - only with linux native transport. |
ClientOptionsBase |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
ClientOptionsBase |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
ClientOptionsBase |
setTrustOptions(TrustOptions options)
Set the trust options.
|
ClientOptionsBase |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
ClientOptionsBase |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
ClientOptionsBase |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setEnabledSecureTransportProtocols, setSslHandshakeTimeout, setSslHandshakeTimeoutUnit
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final int DEFAULT_CONNECT_TIMEOUT
public static final boolean DEFAULT_TRUST_ALL
public static final String DEFAULT_METRICS_NAME
public ClientOptionsBase()
public ClientOptionsBase(ClientOptionsBase other)
other
- the options to copypublic ClientOptionsBase(JsonObject json)
json
- the JSONpublic JsonObject toJson()
toJson
in class TCPSSLOptions
public boolean isTrustAll()
public ClientOptionsBase setTrustAll(boolean trustAll)
trustAll
- true if all should be trustedpublic int getConnectTimeout()
public ClientOptionsBase setConnectTimeout(int connectTimeout)
connectTimeout
- connect timeout, in mspublic String getMetricsName()
public ClientOptionsBase setMetricsName(String metricsName)
metricsName
- the metrics namepublic ClientOptionsBase setProxyOptions(ProxyOptions proxyOptions)
proxyOptions
- proxy options objectpublic ProxyOptions getProxyOptions()
public ClientOptionsBase setNonProxyHosts(List<String> nonProxyHosts)
nonProxyHosts
configuration.
Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
nonProxyHosts
- the list of non proxies hostspublic ClientOptionsBase addNonProxyHost(String host)
host
to the getNonProxyHosts()
list.host
- the added hostpublic String getLocalAddress()
public ClientOptionsBase setLocalAddress(String localAddress)
localAddress
- the local addresspublic ClientOptionsBase setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class TCPSSLOptions
logEnabled
- true for logging the network activitypublic ClientOptionsBase setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptions
setActivityLogDataFormat
in class TCPSSLOptions
activityLogDataFormat
- the format to usepublic ClientOptionsBase setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class TCPSSLOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public ClientOptionsBase setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class TCPSSLOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic ClientOptionsBase setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class TCPSSLOptions
soLinger
- true if SO_linger is enabledpublic ClientOptionsBase setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class TCPSSLOptions
idleTimeout
- the timeoutpublic ClientOptionsBase setReadIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setReadIdleTimeout
in class TCPSSLOptions
idleTimeout
- the read timeoutpublic ClientOptionsBase setWriteIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setWriteIdleTimeout
in class TCPSSLOptions
idleTimeout
- the write timeoutpublic ClientOptionsBase setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class TCPSSLOptions
idleTimeoutUnit
- specify time unit.public ClientOptionsBase setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class TCPSSLOptions
ssl
- true if enabledpublic ClientOptionsBase setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class TCPSSLOptions
options
- the key store optionspublic ClientOptionsBase setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class TCPSSLOptions
options
- the key store in jks formatpublic ClientOptionsBase setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class TCPSSLOptions
options
- the key cert options in pfx formatpublic ClientOptionsBase setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class TCPSSLOptions
options
- the options in pem formatpublic ClientOptionsBase setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class TCPSSLOptions
options
- the trust optionspublic ClientOptionsBase setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class TCPSSLOptions
options
- the trust options in jks formatpublic ClientOptionsBase setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class TCPSSLOptions
options
- the trust options in pfx formatpublic ClientOptionsBase setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class TCPSSLOptions
options
- the trust options in pem formatpublic ClientOptionsBase setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class TCPSSLOptions
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic ClientOptionsBase setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class TCPSSLOptions
sslEngineOptions
- the ssl engine to usepublic ClientOptionsBase setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class TCPSSLOptions
public ClientOptionsBase setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class TCPSSLOptions
public ClientOptionsBase setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class TCPSSLOptions
sendBufferSize
- the buffers size, in bytespublic ClientOptionsBase setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class TCPSSLOptions
receiveBufferSize
- the buffers size, in bytespublic ClientOptionsBase setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class TCPSSLOptions
reuseAddress
- the value of reuse addresspublic ClientOptionsBase setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class TCPSSLOptions
reusePort
- the value of reuse portpublic ClientOptionsBase setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class TCPSSLOptions
trafficClass
- the value of traffic classpublic ClientOptionsBase addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class TCPSSLOptions
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public ClientOptionsBase removeEnabledCipherSuite(String suite)
TCPSSLOptions
removeEnabledCipherSuite
in class TCPSSLOptions
suite
- the suitepublic ClientOptionsBase addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class TCPSSLOptions
crlPath
- the pathNullPointerException
public ClientOptionsBase addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class TCPSSLOptions
crlValue
- the valueNullPointerException
public ClientOptionsBase addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class TCPSSLOptions
protocol
- the SSL/TLS protocol to enablepublic ClientOptionsBase removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class TCPSSLOptions
protocol
- the SSL/TLS protocol to disablepublic ClientOptionsBase setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class TCPSSLOptions
tcpFastOpen
- the fast open valuepublic ClientOptionsBase setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class TCPSSLOptions
tcpCork
- the cork valuepublic ClientOptionsBase setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class TCPSSLOptions
tcpQuickAck
- the quick ack valuepublic ClientOptionsBase setTcpUserTimeout(int tcpUserTimeout)
TCPSSLOptions
TCP_USER_TIMEOUT
option - only with linux native transport.setTcpUserTimeout
in class TCPSSLOptions
tcpUserTimeout
- the tcp user timeout valueCopyright © 2024 Eclipse. All rights reserved.