public static final class HttpConfiguration.Builder extends Object
HttpConfiguration
Constructor and Description |
---|
HttpConfiguration.Builder() |
Modifier and Type | Method and Description |
---|---|
HttpConfiguration |
getConfig() |
HttpConfiguration.Builder |
setIoThreadCount(int ioThreadCount)
Defines the number of I/O dispatch threads to be used by the I/O
reactor of the third-party HTTP library.
|
HttpConfiguration.Builder |
setKeepAlivePeriod(long keepAlivePeriod)
Sets the maximum time a connection is allowed to be kept alive.
|
HttpConfiguration.Builder |
setLibraryType(HttpConfiguration.LibType libraryType)
Sets the type of the HTTP library.
|
HttpConfiguration.Builder |
setMaxConnections(int maxConnections)
Sets the maximum number of outstanding TCP connections.
|
HttpConfiguration.Builder |
setSoTimeout(int soTimeout)
Sets the amount of time the client should wait for a response before
timing out.
|
HttpConfiguration.Builder |
setSslConfiguration(HttpConfiguration.SslConfiguration sslConfig)
Sets the SSL configuration
|
public HttpConfiguration.Builder setLibraryType(HttpConfiguration.LibType libraryType)
libraryType
- HTTP library flavor; default is
HttpConfiguration.LibType.APACHE_HTTP_CLIENT
;
must not be null
public HttpConfiguration.Builder setSslConfiguration(HttpConfiguration.SslConfiguration sslConfig)
sslConfig
- public HttpConfiguration.Builder setIoThreadCount(int ioThreadCount)
HttpConfiguration.LibType.APACHE_HTTP_ASYNC_CLIENT
.ioThreadCount
- number of I/O threads; defaults to the count of
the processors on the machine; must be larger
than zeropublic HttpConfiguration.Builder setSoTimeout(int soTimeout)
soTimeout
- time in milliseconds; zero timeout means wait
forever; default is zero; must not be negativepublic HttpConfiguration.Builder setMaxConnections(int maxConnections)
maxConnections
- maximum number of connections; must be
positive; default is 20public HttpConfiguration.Builder setKeepAlivePeriod(long keepAlivePeriod)
Non-positive value for this setting means that the connection can be kept alive indefinitely.
This value MUST be lower than max idle time in the server.
Default value is 45 seconds.
keepAlivePeriod
- the time period in milliseconds.public HttpConfiguration getConfig()
HttpConfiguration
IllegalStateException
- if the combination of settings is
invalidCopyright © 2015. All Rights Reserved.