Interface AzureConfigurable<T extends AzureConfigurable<T>>
-
- Type Parameters:
T- the actual type of the interface extending this interface
public interface AzureConfigurable<T extends AzureConfigurable<T>>The base interface for allowing configurations to be made on the HTTP client.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description TuseHttpClientThreadPool(boolean useHttpClientThreadPool)Sets whether to use the thread pool in OkHttp client or RxJava schedulers.TwithCallbackExecutor(Executor executor)Sets the executor for async callbacks to run on.TwithConnectionPool(okhttp3.ConnectionPool connectionPool)Sets the connection pool for the Http client.TwithConnectionTimeout(long timeout, TimeUnit unit)Set the connection timeout on the HTTP client.TwithDispatcher(okhttp3.Dispatcher dispatcher)Sets the dispatcher used in OkHttp client.TwithInterceptor(okhttp3.Interceptor interceptor)Plug in an interceptor into the HTTP pipeline.TwithLogLevel(com.microsoft.rest.LogLevel level)Set the logging level on the HTTP client.TwithMaxIdleConnections(int maxIdleConnections)Deprecated.usewithConnectionPool(ConnectionPool)insteadTwithProxy(Proxy proxy)Sets the proxy for the HTTP client.TwithProxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)Sets the proxy authenticator for the HTTP client.TwithReadTimeout(long timeout, TimeUnit unit)Set the read timeout on the HTTP client.TwithUserAgent(String userAgent)Specify the user agent header.
-
-
-
Method Detail
-
withLogLevel
T withLogLevel(com.microsoft.rest.LogLevel level)
Set the logging level on the HTTP client.- Parameters:
level- the OkHttp logging level- Returns:
- the configurable object itself
-
withInterceptor
T withInterceptor(okhttp3.Interceptor interceptor)
Plug in an interceptor into the HTTP pipeline.- Parameters:
interceptor- the interceptor to plug in- Returns:
- the configurable object itself
-
withUserAgent
T withUserAgent(String userAgent)
Specify the user agent header.- Parameters:
userAgent- the user agent to use- Returns:
- the configurable object itself
-
withReadTimeout
T withReadTimeout(long timeout, TimeUnit unit)
Set the read timeout on the HTTP client. Default is 10 seconds.- Parameters:
timeout- the timeout numeric valueunit- the time unit for the numeric value- Returns:
- the configurable object itself for chaining
-
withConnectionTimeout
T withConnectionTimeout(long timeout, TimeUnit unit)
Set the connection timeout on the HTTP client. Default is 10 seconds.- Parameters:
timeout- the timeout numeric valueunit- the time unit for the numeric value- Returns:
- the configurable object itself for chaining
-
withMaxIdleConnections
@Deprecated T withMaxIdleConnections(int maxIdleConnections)
Deprecated.usewithConnectionPool(ConnectionPool)insteadSet the maximum idle connections for the HTTP client. Default is 5.- Parameters:
maxIdleConnections- the maximum idle connections- Returns:
- the configurable object itself for chaining
-
withConnectionPool
T withConnectionPool(okhttp3.ConnectionPool connectionPool)
Sets the connection pool for the Http client.- Parameters:
connectionPool- the OkHttp 3 connection pool to use- Returns:
- the configurable object itself for chaining
-
useHttpClientThreadPool
T useHttpClientThreadPool(boolean useHttpClientThreadPool)
Sets whether to use the thread pool in OkHttp client or RxJava schedulers. If set to true, the thread pool in OkHttp client will be used. Default is false.- Parameters:
useHttpClientThreadPool- whether to use the thread pool in Okhttp client. Default is false.- Returns:
- the configurable object itself for chaining
-
withDispatcher
T withDispatcher(okhttp3.Dispatcher dispatcher)
Sets the dispatcher used in OkHttp client. This is also where to set the thread pool for executing HTTP requests.- Parameters:
dispatcher- the dispatcher to use- Returns:
- the configurable object itself for chaining
-
withCallbackExecutor
T withCallbackExecutor(Executor executor)
Sets the executor for async callbacks to run on.- Parameters:
executor- the executor to execute the callbacks.- Returns:
- the configurable object itself for chaining
-
withProxy
T withProxy(Proxy proxy)
Sets the proxy for the HTTP client.- Parameters:
proxy- the proxy to use- Returns:
- the configurable object itself for chaining
-
withProxyAuthenticator
T withProxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)
Sets the proxy authenticator for the HTTP client.- Parameters:
proxyAuthenticator- the proxy authenticator to use- Returns:
- the configurable object itself for chaining
-
-