|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.basho.riak.client.raw.http.HTTPClientConfig.Builder
public static final class HTTPClientConfig.Builder
Use the builder to create a new instance of HTTPClientConfig
.
The defaults are as follows:
field | default value |
---|---|
url | http://127.0.0.1:8098/riak (derived from defaults for scheme://host:port/path) |
scheme | http |
host | 127.0.0.1 |
port | 8098 |
path | riak |
mapreducePath | /mapred |
httpClient | null (IE the library creates one) |
timeout | null (will then use HttpClient default which is 0 (for infinite)) |
maxConnections | null (will then use the HttpClient default which is a max of *2*) |
httpRequestRetryHandler | null (will use the HttpClient default) |
Constructor Summary | |
---|---|
HTTPClientConfig.Builder()
|
Method Summary | |
---|---|
HTTPClientConfig |
build()
|
static HTTPClientConfig.Builder |
from(HTTPClientConfig copyConfig)
Create a new builder with values all copied from copyConfig |
HTTPClientConfig.Builder |
withHost(String host)
Set the host. |
HTTPClientConfig.Builder |
withHttpClient(org.apache.http.client.HttpClient client)
You can supply a preconfigured HttpClient that you want the RawClient to delegate to. |
HTTPClientConfig.Builder |
withMapreducePath(String path)
The location of Riak's map reduce resource |
HTTPClientConfig.Builder |
withMaxConnctions(int maxConnections)
Maximum number of connections this client may have open at any time. |
HTTPClientConfig.Builder |
withPort(int port)
Set the port. |
HTTPClientConfig.Builder |
withRetryHandler(org.apache.http.client.HttpRequestRetryHandler retryHandler)
Apache HttpClient treats some HTTP methods as retry-able, and provides a default implementation of HttpRequestRetryHandler
to be called when a request fails. |
HTTPClientConfig.Builder |
withRiakPath(String path)
Set the path to the base Riak REST resource. |
HTTPClientConfig.Builder |
withScheme(String scheme)
Set the scheme. |
HTTPClientConfig.Builder |
withTimeout(int timeout)
The connection, socket read and pooled connection acquisition timeout in milliseconds |
HTTPClientConfig.Builder |
withUrl(String url)
The URL Riak REST interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTTPClientConfig.Builder()
Method Detail |
---|
public HTTPClientConfig build()
HTTPClientConfig
public static HTTPClientConfig.Builder from(HTTPClientConfig copyConfig)
copyConfig
copyConfig
- the HTTPClientConfig
to copy values from
HTTPClientConfig.Builder
populated with copyConfig
's values.public HTTPClientConfig.Builder withUrl(String url)
NOTE: Setting this take precedence over setting scheme
,
host
, port
and path
url
- the Riak REST URL
public HTTPClientConfig.Builder withScheme(String scheme)
NOTE: setting the url
takes precedence.
scheme
- HTTP or HTTPS
public HTTPClientConfig.Builder withHost(String host)
NOTE: setting the url
takes precedence.
host
-
public HTTPClientConfig.Builder withPort(int port)
NOTE: setting the url
takes precedence.
port
-
public HTTPClientConfig.Builder withRiakPath(String path)
NOTE: setting the url
takes precedence.
path
- e.g. /riak
public HTTPClientConfig.Builder withMapreducePath(String path)
path
- e.g. /mapreduce
public HTTPClientConfig.Builder withHttpClient(org.apache.http.client.HttpClient client)
RawClient
to delegate to.
client
- a implementation of HttpClient
public HTTPClientConfig.Builder withTimeout(int timeout)
timeout
- in milliseconds
public HTTPClientConfig.Builder withMaxConnctions(int maxConnections)
maxConnections
-
public HTTPClientConfig.Builder withRetryHandler(org.apache.http.client.HttpRequestRetryHandler retryHandler)
HttpRequestRetryHandler
to be called when a request fails. Provide an implementation here to
override the default behaviour.
retryHandler
- an HttpRequestRetryHandler
implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |