public abstract class AsyncAPIClientBuilder extends GenericAPIClientBuilder
apiKey, applicationId, buildHosts, connectTimeout, customAgent, customAgentVersion, customHeaders, hostDownTimeout, maxConnTotal, objectMapper, queryHosts, random, readTimeout| Constructor | Description |
|---|---|
AsyncAPIClientBuilder(String applicationId,
String apiKey) |
Initialize this builder with the applicationId and apiKey
|
| Modifier and Type | Method | Description |
|---|---|---|
GenericAPIClientBuilder |
addExtraHeader(String key,
String value) |
Add extra headers to the requests
|
AsyncAPIClient |
build() |
Build an AsyncAPIClient with a default executor of 10 threads
|
protected abstract AsyncAPIClient |
build(AsyncAPIClientConfiguration configuration) |
|
AsyncAPIClient |
build(ExecutorService executor) |
Build an AsyncAPIClient
|
AsyncAPIClientBuilder |
setBuildHosts(List<String> buildHosts) |
Set the hosts for indexing & building
|
AsyncAPIClientBuilder |
setConnectTimeout(int connectTimeout) |
Set the connect timeout of the HTTP client
|
AsyncAPIClientBuilder |
setExtraHeader(String key,
String value) |
Deprecated.
|
AsyncAPIClientBuilder |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Set the Jackson ObjectMapper
|
AsyncAPIClientBuilder |
setQueryHosts(List<String> queryHosts) |
Set the hosts for search & queries
|
AsyncAPIClientBuilder |
setReadTimeout(int readTimeout) |
Set the read timeout of the HTTP client
|
AsyncAPIClientBuilder |
setUserAgent(String customAgent,
String customAgentVersion) |
Customize the user agent
|
generateBuildHosts, generateHeaders, generateQueryHosts, setHostDownTimeout, setMaxConnTotalpublic AsyncAPIClientBuilder(@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 AsyncAPIClientBuilder 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 agent@Deprecated public AsyncAPIClientBuilder setExtraHeader(@Nonnull String key, String value)
GenericAPIClientBuilderGenericAPIClientBuilder.addExtraHeader(String, String)setExtraHeader in class GenericAPIClientBuilderpublic GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value)
GenericAPIClientBuilderaddExtraHeader in class GenericAPIClientBuilderkey - name of the headervalue - value of the headerpublic AsyncAPIClientBuilder setConnectTimeout(int connectTimeout)
setConnectTimeout in class GenericAPIClientBuilderconnectTimeout - the value in mspublic AsyncAPIClientBuilder setReadTimeout(int readTimeout)
setReadTimeout in class GenericAPIClientBuilderreadTimeout - the value in mspublic AsyncAPIClientBuilder setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper objectMapper)
setObjectMapper in class GenericAPIClientBuilderobjectMapper - the mapperpublic AsyncAPIClientBuilder setQueryHosts(List<String> queryHosts)
GenericAPIClientBuildersetQueryHosts in class GenericAPIClientBuilderqueryHosts - the list of hosts for searchpublic AsyncAPIClientBuilder setBuildHosts(List<String> buildHosts)
GenericAPIClientBuildersetBuildHosts in class GenericAPIClientBuilderbuildHosts - the list of hosts for indexing/buildingprotected abstract AsyncAPIClient build(@Nonnull AsyncAPIClientConfiguration configuration)
public AsyncAPIClient build()
public AsyncAPIClient build(ExecutorService executor)
executor - the executor to useCopyright © 2018. All rights reserved.