public class ClientOptions
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientOptions.Builder
Builds immutable instances of client options.
|
| Modifier and Type | Field and Description |
|---|---|
int |
connectionTimeoutMillis
The maximum amount of time to wait to establish a connection (5s).
|
boolean |
followRedirects
Should redirects be followed (true).
|
static ClientOptions |
IMPLEMENTATION_DEFAULT
Indicates that implementation defaults should be used.
|
int |
maxConnectionsPerDestination
The maximum number of connections per destination (1024).
|
int |
maxConnectionsTotal
The maximum number of connections for all destinations (4096).
|
java.lang.String |
proxyHost
A proxy server.
|
int |
proxyPort
The proxy server port.
|
int |
requestBufferSize
The request buffer size (4096).
|
int |
requestTimeoutMillis
The maximum amount of time to wait for a response after sending a request (5s).
|
int |
responseBufferSize
The response buffer size (16384).
|
int |
socketTimeoutMillis
The maximum amount of time to wait for a (blocking) socket read to return (5s).
|
java.lang.String |
userAgent
The user agent ('Attribyte/1.0').
|
| Constructor and Description |
|---|
ClientOptions(java.lang.String prefix,
java.util.Properties props)
Creates options from properties.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanProperty(java.lang.String name,
boolean defaultValue)
Gets a boolean property.
|
int |
getIntProperty(java.lang.String name,
int defaultValue)
Gets an integer property.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Gets a property.
|
int |
getTimeProperty(java.lang.String name,
int defaultValue)
Gets a time (string) property as milliseconds.
|
public static final ClientOptions IMPLEMENTATION_DEFAULT
public final java.lang.String userAgent
public final int connectionTimeoutMillis
public final int requestTimeoutMillis
public final int socketTimeoutMillis
public final java.lang.String proxyHost
public final int proxyPort
public final boolean followRedirects
public final int maxConnectionsPerDestination
public final int maxConnectionsTotal
public final int requestBufferSize
public final int responseBufferSize
public ClientOptions(java.lang.String prefix,
java.util.Properties props)
throws InitializationException
prefix - A prefix applied to all property names.props - The properties.InitializationException - on invalid property.public java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
name - The property name.defaultValue - The default value.public int getIntProperty(java.lang.String name,
int defaultValue)
name - The property name.defaultValue - The default value.public boolean getBooleanProperty(java.lang.String name,
boolean defaultValue)
name - The property name.defaultValue - The default value.public int getTimeProperty(java.lang.String name,
int defaultValue)
name - The property name.defaultValue - The default value.