Package org.attribyte.api.http
Class ClientOptions.Builder
java.lang.Object
org.attribyte.api.http.ClientOptions.Builder
- Enclosing class:
ClientOptions
Builds immutable instances of client options.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Create an empty builder.Builder(ClientOptions options) Create a builder with defaults from options. -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates the options.intGets the connection timeout in milliseconds.Gets the cookie store.booleanGets the follow redirects setting.intGets the maximum number of connections per destination.intGets the maximum total number of connections.getProps()Gets the extra properties.Gets the proxy host.intGets the proxy port.intGets the request buffer size.intGets the request timeout in milliseconds.intGets the response buffer size.intGets the socket timeout in milliseconds.booleanAre all (even invalid) certificates trusted?Gets the user agent.setConnectionTimeoutMillis(int connectionTimeoutMillis) Sets the connection timeout in milliseconds.setCookieStore(CookieStore cookieStore) Sets the cookie store.setFollowRedirects(boolean followRedirects) Sets if redirects are followed.setMaxConnectionsPerDestination(int maxConnectionsPerDestination) Sets the maximum number of connections per destination.setMaxConnectionsTotal(int maxConnectionsTotal) Sets the maximum total number of connections.setProps(Properties props) Sets the extra properties.setProxyHost(String proxyHost) Sets the proxy host.setProxyPort(int proxyPort) Sets the proxy port.setRequestBufferSize(int requestBufferSize) Sets the request buffer size.setRequestTimeoutMillis(int requestTimeoutMillis) Sets the request timeout in milliseconds.setResponseBufferSize(int responseBufferSize) Sets the response buffer size.setSocketTimeoutMillis(int socketTimeoutMillis) Sets the socket timeout in milliseconds.setTrustAllCertificates(boolean trustAllCertificates) Sets if all (even invalid) certificates are trusted.setUserAgent(String userAgent) Sets the user agent.
-
Constructor Details
-
Builder
public Builder()Create an empty builder. -
Builder
Create a builder with defaults from options.- Parameters:
options- The options.
-
-
Method Details
-
getUserAgent
Gets the user agent.- Returns:
- The user agent.
-
setUserAgent
Sets the user agent.- Parameters:
userAgent- The user agent.- Returns:
- A self-reference.
-
getConnectionTimeoutMillis
public int getConnectionTimeoutMillis()Gets the connection timeout in milliseconds.- Returns:
- The timeout in milliseconds.
-
setConnectionTimeoutMillis
Sets the connection timeout in milliseconds.- Parameters:
connectionTimeoutMillis- The connection timeout in milliseconds.- Returns:
- A self-reference.
-
getRequestTimeoutMillis
public int getRequestTimeoutMillis()Gets the request timeout in milliseconds.- Returns:
- The request timeout in milliseconds.
-
setRequestTimeoutMillis
Sets the request timeout in milliseconds.- Parameters:
requestTimeoutMillis- The request timeout in milliseconds.- Returns:
- A self-reference.
-
getSocketTimeoutMillis
public int getSocketTimeoutMillis()Gets the socket timeout in milliseconds.- Returns:
- The socket timeout in milliseconds.
-
setSocketTimeoutMillis
Sets the socket timeout in milliseconds.- Parameters:
socketTimeoutMillis- The socket timeout in milliseconds.- Returns:
- A self-reference.
-
getProxyHost
Gets the proxy host.- Returns:
- The proxy host.
-
setProxyHost
Sets the proxy host.- Parameters:
proxyHost- The proxy host.- Returns:
- A self-reference.
-
getProxyPort
public int getProxyPort()Gets the proxy port.- Returns:
- The proxy port.
-
setProxyPort
Sets the proxy port.- Parameters:
proxyPort- The proxy port.- Returns:
- A self-reference.
-
getFollowRedirects
public boolean getFollowRedirects()Gets the follow redirects setting.- Returns:
- Are redirects followed?
-
setFollowRedirects
Sets if redirects are followed.- Parameters:
followRedirects- Are redirects followed?- Returns:
- A self-reference.
-
getMaxConnectionsPerDestination
public int getMaxConnectionsPerDestination()Gets the maximum number of connections per destination.- Returns:
- The number of connections.
-
setMaxConnectionsPerDestination
Sets the maximum number of connections per destination.- Parameters:
maxConnectionsPerDestination- The number of connections.- Returns:
- A self-reference.
-
getMaxConnectionsTotal
public int getMaxConnectionsTotal()Gets the maximum total number of connections.- Returns:
- The number of connections.
-
setMaxConnectionsTotal
Sets the maximum total number of connections.- Parameters:
maxConnectionsTotal- The number of connections.- Returns:
- A self-reference.
-
getRequestBufferSize
public int getRequestBufferSize()Gets the request buffer size.- Returns:
- The request buffer size.
-
setRequestBufferSize
Sets the request buffer size.- Parameters:
requestBufferSize- The request buffer size.- Returns:
- A self-reference.
-
getResponseBufferSize
public int getResponseBufferSize()Gets the response buffer size.- Returns:
- The response buffer size.
-
setResponseBufferSize
Sets the response buffer size.- Parameters:
responseBufferSize- The response buffer size.- Returns:
- A self-reference.
-
getProps
Gets the extra properties.- Returns:
- The properties.
-
setProps
Sets the extra properties.- Parameters:
props- The properties.- Returns:
- A self-reference.
-
getTrustAllCertificates
public boolean getTrustAllCertificates()Are all (even invalid) certificates trusted?- Returns:
- Are all certificates trusted.
-
setTrustAllCertificates
Sets if all (even invalid) certificates are trusted.- Parameters:
trustAllCertificates- Are all certificates trusted?- Returns:
- A self-reference.
-
getCookieStore
Gets the cookie store.- Returns:
- The cookie store.
-
setCookieStore
Sets the cookie store.- Parameters:
cookieStore- The cookie store.- Returns:
- A self-reference.
-
create
Creates the options.- Returns:
- The options.
-