public class RestClientFactory extends Object
JestClientFactory
to provide instances of
JestClient
.Constructor and Description |
---|
RestClientFactory(String elasticSearchURL,
String esusername,
String espassword)
Create a RestClientFactory.
|
Modifier and Type | Method and Description |
---|---|
io.searchbox.client.JestClient |
getJestClient() |
int |
getRetries() |
int |
getSocketTimeout() |
int |
getTimeout() |
void |
setRetries(int retries)
Set the number of times the REST operation will be retried if
an exception is thrown during the operation.
|
void |
setSocketTimeout(int timeout)
Set the socket timeout (SO_TIMEOUT) for the REST connections.
|
void |
setTimeout(int timeout)
Set the connection timeout for the REST connections.
|
public RestClientFactory(String elasticSearchURL, String esusername, String espassword) throws MalformedURLException
elasticSearchURL
- Elasticsearch URL, either a single URL or
multiple URLs that are comma-separated without spacesesusername
- Optional HTTP usernameespassword
- Optional HTTP passwordMalformedURLException
public int getRetries()
public void setRetries(int retries)
retries
- Number of retries.public int getSocketTimeout()
public void setSocketTimeout(int timeout)
io.searchbox.client.config.ClientConfig.AbstractBuilder
.timeout
- Timeout in milliseconds.public int getTimeout()
public void setTimeout(int timeout)
io.searchbox.client.config.ClientConfig.AbstractBuilder
.
This is also used as the minimum interval between successive retries
if the connection is refused in a shorter amount of time.timeout
- Timeout in milliseconds.public io.searchbox.client.JestClient getJestClient()
Copyright © 2018. All rights reserved.