Package org.apache.hc.core5.reactor
Class IOReactorConfig.Builder
- java.lang.Object
-
- org.apache.hc.core5.reactor.IOReactorConfig.Builder
-
- Enclosing class:
- IOReactorConfig
public static class IOReactorConfig.Builder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private intbacklogSizeprivate static intdefaultMaxIOThreadCountprivate intioThreadCountprivate intrcvBufSizeprivate TimeValueselectIntervalprivate intsndBufSizeprivate java.net.SocketAddresssocksProxyAddressprivate java.lang.StringsocksProxyPasswordprivate java.lang.StringsocksProxyUsernameprivate booleansoKeepAliveprivate TimeValuesoLingerprivate booleansoReuseAddressprivate TimeoutsoTimeoutprivate booleantcpNoDelayprivate inttrafficClass
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IOReactorConfigbuild()static intgetDefaultMaxIOThreadCount()Gets the default value forioThreadCount.IOReactorConfig.BuildersetBacklogSize(int backlogSize)Determines the default backlog size value for server sockets binds.static voidsetDefaultMaxIOThreadCount(int defaultMaxIOThreadCount)Sets the default value forioThreadCount.IOReactorConfig.BuildersetIoThreadCount(int ioThreadCount)Determines the number of I/O dispatch threads to be used by the I/O reactor.IOReactorConfig.BuildersetRcvBufSize(int rcvBufSize)Determines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.IOReactorConfig.BuildersetSelectInterval(TimeValue selectInterval)Determines time interval at which the I/O reactor wakes up to check for timed out sessions and session requests.IOReactorConfig.BuildersetSndBufSize(int sndBufSize)Determines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.IOReactorConfig.BuildersetSocksProxyAddress(java.net.SocketAddress socksProxyAddress)The address of the SOCKS proxy to use.IOReactorConfig.BuildersetSocksProxyPassword(java.lang.String socksProxyPassword)The password to provide to the SOCKS proxy for username/password authentication.IOReactorConfig.BuildersetSocksProxyUsername(java.lang.String socksProxyUsername)The username to provide to the SOCKS proxy for username/password authentication.IOReactorConfig.BuildersetSoKeepAlive(boolean soKeepAlive)Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.IOReactorConfig.BuildersetSoLinger(int soLinger, java.util.concurrent.TimeUnit timeUnit)Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.IOReactorConfig.BuildersetSoLinger(TimeValue soLinger)Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.IOReactorConfig.BuildersetSoReuseAddress(boolean soReuseAddress)Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.IOReactorConfig.BuildersetSoTimeout(int soTimeout, java.util.concurrent.TimeUnit timeUnit)Determines the default socket timeout value for non-blocking I/O operations.IOReactorConfig.BuildersetSoTimeout(Timeout soTimeout)Determines the default socket timeout value for non-blocking I/O operations.IOReactorConfig.BuildersetTcpNoDelay(boolean tcpNoDelay)Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.IOReactorConfig.BuildersetTrafficClass(int trafficClass)Determines the default value of theSocketOptions.IP_TOSparameter for newly created sockets.
-
-
-
Field Detail
-
defaultMaxIOThreadCount
private static int defaultMaxIOThreadCount
-
selectInterval
private TimeValue selectInterval
-
ioThreadCount
private int ioThreadCount
-
soTimeout
private Timeout soTimeout
-
soReuseAddress
private boolean soReuseAddress
-
soLinger
private TimeValue soLinger
-
soKeepAlive
private boolean soKeepAlive
-
tcpNoDelay
private boolean tcpNoDelay
-
trafficClass
private int trafficClass
-
sndBufSize
private int sndBufSize
-
rcvBufSize
private int rcvBufSize
-
backlogSize
private int backlogSize
-
socksProxyAddress
private java.net.SocketAddress socksProxyAddress
-
socksProxyUsername
private java.lang.String socksProxyUsername
-
socksProxyPassword
private java.lang.String socksProxyPassword
-
-
Method Detail
-
getDefaultMaxIOThreadCount
public static int getDefaultMaxIOThreadCount()
Gets the default value forioThreadCount. ReturnsRuntime.availableProcessors()ifsetDefaultMaxIOThreadCount(int)was called with a value less <= 0.- Returns:
- the default value for ioThreadCount.
- Since:
- 4.4.10
-
setDefaultMaxIOThreadCount
public static void setDefaultMaxIOThreadCount(int defaultMaxIOThreadCount)
Sets the default value forioThreadCount. Use a value <= 0 to causegetDefaultMaxIOThreadCount()to returnRuntime.availableProcessors().- Parameters:
defaultMaxIOThreadCount- the default value for ioThreadCount.- Since:
- 4.4.10
-
setSelectInterval
public IOReactorConfig.Builder setSelectInterval(TimeValue selectInterval)
Determines time interval at which the I/O reactor wakes up to check for timed out sessions and session requests.Default:
1000milliseconds.
-
setIoThreadCount
public IOReactorConfig.Builder setIoThreadCount(int ioThreadCount)
Determines the number of I/O dispatch threads to be used by the I/O reactor.Default:
2
-
setSoTimeout
public IOReactorConfig.Builder setSoTimeout(int soTimeout, java.util.concurrent.TimeUnit timeUnit)
Determines the default socket timeout value for non-blocking I/O operations.Default:
0(no timeout)- See Also:
SocketOptions.SO_TIMEOUT
-
setSoTimeout
public IOReactorConfig.Builder setSoTimeout(Timeout soTimeout)
Determines the default socket timeout value for non-blocking I/O operations.Default:
0(no timeout)- See Also:
SocketOptions.SO_TIMEOUT
-
setSoReuseAddress
public IOReactorConfig.Builder setSoReuseAddress(boolean soReuseAddress)
Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.Default:
false- See Also:
SocketOptions.SO_REUSEADDR
-
setSoLinger
public IOReactorConfig.Builder setSoLinger(int soLinger, java.util.concurrent.TimeUnit timeUnit)
Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.Default:
-1- See Also:
SocketOptions.SO_LINGER
-
setSoLinger
public IOReactorConfig.Builder setSoLinger(TimeValue soLinger)
Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.Default:
-1- See Also:
SocketOptions.SO_LINGER
-
setSoKeepAlive
public IOReactorConfig.Builder setSoKeepAlive(boolean soKeepAlive)
Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.Default:
-1- See Also:
SocketOptions.SO_KEEPALIVE
-
setTcpNoDelay
public IOReactorConfig.Builder setTcpNoDelay(boolean tcpNoDelay)
Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.Default:
false- See Also:
SocketOptions.TCP_NODELAY
-
setTrafficClass
public IOReactorConfig.Builder setTrafficClass(int trafficClass)
Determines the default value of theSocketOptions.IP_TOSparameter for newly created sockets.Default:
0- Since:
- 5.1
- See Also:
SocketOptions.IP_TOS
-
setSndBufSize
public IOReactorConfig.Builder setSndBufSize(int sndBufSize)
Determines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.Default:
0(system default)- See Also:
SocketOptions.SO_SNDBUF
-
setRcvBufSize
public IOReactorConfig.Builder setRcvBufSize(int rcvBufSize)
Determines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.Default:
0(system default)- See Also:
SocketOptions.SO_RCVBUF
-
setBacklogSize
public IOReactorConfig.Builder setBacklogSize(int backlogSize)
Determines the default backlog size value for server sockets binds.Default:
0(system default)- Since:
- 4.4
-
setSocksProxyAddress
public IOReactorConfig.Builder setSocksProxyAddress(java.net.SocketAddress socksProxyAddress)
The address of the SOCKS proxy to use.
-
setSocksProxyUsername
public IOReactorConfig.Builder setSocksProxyUsername(java.lang.String socksProxyUsername)
The username to provide to the SOCKS proxy for username/password authentication.
-
setSocksProxyPassword
public IOReactorConfig.Builder setSocksProxyPassword(java.lang.String socksProxyPassword)
The password to provide to the SOCKS proxy for username/password authentication.
-
build
public IOReactorConfig build()
-
-