public abstract class APIClientBuilder extends GenericAPIClientBuilder
apiKey, applicationId, buildHosts, connectTimeout, customAgent, customAgentVersion, customHeaders, hostDownTimeout, maxConnTotal, objectMapper, queryHosts, random, readTimeout| Constructor | Description |
|---|---|
APIClientBuilder(String applicationId,
String apiKey) |
Initialize this builder with the applicationId and apiKey
|
| Modifier and Type | Method | Description |
|---|---|---|
APIClient |
build() |
Build the APIClient
|
protected abstract APIClient |
build(APIClientConfiguration configuration) |
|
APIClientBuilder |
setBuildHosts(List<String> buildHosts) |
Set the hosts for indexing & building
|
APIClientBuilder |
setConnectTimeout(int connectTimeout) |
Set the connect timeout of the HTTP client
|
APIClientBuilder |
setExtraHeader(String key,
String value) |
Set extra headers to the requests
|
APIClientBuilder |
setHostDownTimeout(int hostDownTimeout) |
Set the retry timeout to detect if a host is down
|
APIClientBuilder |
setMaxConnTotal(int maxConnTotal) |
Set the maximum of connection, only available for
ApacheAPIClientBuilder and AsyncAPIClientBuilder |
APIClientBuilder |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Set the Jackson ObjectMapper
|
APIClientBuilder |
setQueryHosts(List<String> queryHosts) |
Set the hosts for search & queries
|
APIClientBuilder |
setReadTimeout(int readTimeout) |
Set the read timeout of the HTTP client
|
APIClientBuilder |
setUserAgent(String customAgent,
String customAgentVersion) |
Customize the user agent
|
generateBuildHosts, generateHeaders, generateQueryHostspublic APIClientBuilder(@Nonnull String applicationId, @Nonnull String apiKey)
applicationId - APP_ID can be found on https://www.algolia.com/api-keysapiKey - Algolia API_KEY can also be found on https://www.algolia.com/api-keyspublic APIClientBuilder setUserAgent(@Nonnull String customAgent, @Nonnull String customAgentVersion)
setUserAgent in class GenericAPIClientBuildercustomAgent - key to add to the user agentcustomAgentVersion - value of this key to add to the user agentpublic APIClientBuilder setExtraHeader(@Nonnull String key, String value)
setExtraHeader in class GenericAPIClientBuilderkey - name of the headervalue - value of the headerpublic APIClientBuilder setConnectTimeout(int connectTimeout)
setConnectTimeout in class GenericAPIClientBuilderconnectTimeout - the value in mspublic APIClientBuilder setReadTimeout(int readTimeout)
setReadTimeout in class GenericAPIClientBuilderreadTimeout - the value in mspublic APIClientBuilder setHostDownTimeout(int hostDownTimeout)
setHostDownTimeout in class GenericAPIClientBuilderhostDownTimeout - the value in mspublic APIClientBuilder setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper objectMapper)
setObjectMapper in class GenericAPIClientBuilderobjectMapper - the mapperpublic APIClientBuilder setQueryHosts(List<String> queryHosts)
GenericAPIClientBuildersetQueryHosts in class GenericAPIClientBuilderqueryHosts - the list of hosts for searchpublic APIClientBuilder setBuildHosts(List<String> buildHosts)
GenericAPIClientBuildersetBuildHosts in class GenericAPIClientBuilderbuildHosts - the list of hosts for indexing/buildingpublic APIClientBuilder setMaxConnTotal(int maxConnTotal)
GenericAPIClientBuilderApacheAPIClientBuilder and AsyncAPIClientBuildersetMaxConnTotal in class GenericAPIClientBuildermaxConnTotal - the max number of connectionsprotected abstract APIClient build(@Nonnull APIClientConfiguration configuration)
public APIClient build()
Copyright © 2017. All rights reserved.