Interface AzureConfigurable<T extends AzureConfigurable<T>>
- Type Parameters:
T
- the actual type of the interface extending this interface
- All Known Subinterfaces:
Azure.Configurable
public interface AzureConfigurable<T extends AzureConfigurable<T>>
The base interface for allowing configurations to be made on the HTTP client.
-
Method Summary
Modifier and TypeMethodDescriptionuseHttpClientThreadPool
(boolean useHttpClientThreadPool) Sets whether to use the thread pool in OkHttp client or RxJava schedulers.withAuxiliaryCredentials
(com.microsoft.azure.credentials.AzureTokenCredentials... tokens) Set the cross-tenant auxiliary credentials for Azure which can hold up to three.withCallbackExecutor
(Executor executor) Sets the executor for async callbacks to run on.withConnectionPool
(okhttp3.ConnectionPool connectionPool) Sets the connection pool for the Http client.withConnectionTimeout
(long timeout, TimeUnit unit) Set the connection timeout on the HTTP client.withDispatcher
(okhttp3.Dispatcher dispatcher) Sets the dispatcher used in OkHttp client.withInterceptor
(okhttp3.Interceptor interceptor) Plug in an interceptor into the HTTP pipeline.withLogLevel
(com.microsoft.rest.LogLevel level) Set the logging level on the HTTP client.withMaxIdleConnections
(int maxIdleConnections) Deprecated.withProtocols
(List<okhttp3.Protocol> protocols) Sets the HTTP network protocols for HTTP client.Sets the proxy for the HTTP client.withProxyAuthenticator
(okhttp3.Authenticator proxyAuthenticator) Sets the proxy authenticator for the HTTP client.withReadTimeout
(long timeout, TimeUnit unit) Set the read timeout on the HTTP client.withUserAgent
(String userAgent) Specify the user agent header.
-
Method Details
-
withLogLevel
Set the logging level on the HTTP client.- Parameters:
level
- the OkHttp logging level- Returns:
- the configurable object itself
-
withInterceptor
Plug in an interceptor into the HTTP pipeline.- Parameters:
interceptor
- the interceptor to plug in- Returns:
- the configurable object itself
-
withAuxiliaryCredentials
Set the cross-tenant auxiliary credentials for Azure which can hold up to three.- Parameters:
tokens
- the AzureTokenCredentials list- Returns:
- the configurable object itself
-
withUserAgent
Specify the user agent header.- Parameters:
userAgent
- the user agent to use- Returns:
- the configurable object itself
-
withReadTimeout
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
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.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
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
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
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
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
Sets the proxy for the HTTP client.- Parameters:
proxy
- the proxy to use- Returns:
- the configurable object itself for chaining
-
withProxyAuthenticator
Sets the proxy authenticator for the HTTP client.- Parameters:
proxyAuthenticator
- the proxy authenticator to use- Returns:
- the configurable object itself for chaining
-
withProtocols
Sets the HTTP network protocols for HTTP client.HTTP2 multiplexing could result in a single TCP connection to ARM instance. It could cause an undesirable side-effect that ARM throttling happens earlier than with HTTP1.1 with a connection pool.
- Parameters:
protocols
- the HTTP network protocols to use- Returns:
- the configurable object itself for chaining
-
withConnectionPool(ConnectionPool)
instead