Package com.algolia.utils
Interface Requester
- All Known Implementing Classes:
HttpRequester
public interface Requester
-
Method Summary
Modifier and TypeMethodDescriptionintGet connection timeout (in milliseconds).intGet read timeout (in milliseconds).intGet write timeout (in milliseconds).<T> ThandleResponse(okhttp3.Response response, com.fasterxml.jackson.databind.JavaType returnType) okhttp3.CallnewCall(okhttp3.Request request) voidsetConnectTimeout(int connectionTimeout) Sets the connect timeout (in milliseconds).voidsetHosts(List<StatefulHost> hosts) voidsetLogLevel(LogLevel level) Enable/disable debugging for this API client.voidsetReadTimeout(int readTimeout) Sets the read timeout (in milliseconds).voidsetWriteTimeout(int writeTimeout) Sets the write timeout (in milliseconds).
-
Method Details
-
newCall
okhttp3.Call newCall(okhttp3.Request request) -
handleResponse
<T> T handleResponse(okhttp3.Response response, com.fasterxml.jackson.databind.JavaType returnType) throws AlgoliaRuntimeException - Throws:
AlgoliaRuntimeException
-
setLogLevel
Enable/disable debugging for this API client.- Parameters:
level- LogLevel the level of log to output
-
getConnectTimeout
int getConnectTimeout()Get connection timeout (in milliseconds).- Returns:
- Timeout in milliseconds
-
setConnectTimeout
void setConnectTimeout(int connectionTimeout) Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 andInteger.MAX_VALUE.- Parameters:
connectionTimeout- connection timeout in milliseconds
-
getReadTimeout
int getReadTimeout()Get read timeout (in milliseconds).- Returns:
- Timeout in milliseconds
-
setReadTimeout
void setReadTimeout(int readTimeout) Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 andInteger.MAX_VALUE.- Parameters:
readTimeout- read timeout in milliseconds
-
getWriteTimeout
int getWriteTimeout()Get write timeout (in milliseconds).- Returns:
- Timeout in milliseconds
-
setWriteTimeout
void setWriteTimeout(int writeTimeout) Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 andInteger.MAX_VALUE.- Parameters:
writeTimeout- connection timeout in milliseconds
-
setHosts
-