AzureConfigurable<T> Interface

Type Parameters

T

the actual type of the interface extending this interface

public interface AzureConfigurable<T extends AzureConfigurable>

The base interface for allowing configurations to be made on the HTTP client.

Method Summary

Modifier and Type Method and Description
T withCallbackExecutor(Executor executor)

Sets the executor for async callbacks to run on.

T withConnectionTimeout(long timeout, TimeUnit unit)

Set the connection timeout on the HTTP client. Default is 10 seconds.

T withInterceptor(Interceptor interceptor)

Plug in an interceptor into the HTTP pipeline.

T withLogLevel(LogLevel level)

Set the logging level on the HTTP client.

T withMaxIdleConnections(int maxIdleConnections)

Set the maximum idle connections for the HTTP client. Default is 5.

T withProxy(Proxy proxy)

Sets the proxy for the HTTP client.

T withProxyAuthenticator(Authenticator proxyAuthenticator)

Sets the proxy authenticator for the HTTP client.

T withReadTimeout(long timeout, TimeUnit unit)

Set the read timeout on the HTTP client. Default is 10 seconds.

T withUserAgent(String userAgent)

Specify the user agent header.

Method Details

withCallbackExecutor

public 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

withConnectionTimeout

public T withConnectionTimeout(long timeout, TimeUnit unit)

Set the connection timeout on the HTTP client. Default is 10 seconds.

Parameters:

timeout - the timeout numeric value
unit - the time unit for the numeric value

Returns:

the configurable object itself for chaining

withInterceptor

public T withInterceptor(Interceptor interceptor)

Plug in an interceptor into the HTTP pipeline.

Parameters:

interceptor - the interceptor to plug in

Returns:

the configurable object itself

withLogLevel

public T withLogLevel(LogLevel level)

Set the logging level on the HTTP client.

Parameters:

level - the OkHttp logging level

Returns:

the configurable object itself

withMaxIdleConnections

public T withMaxIdleConnections(int maxIdleConnections)

Set the maximum idle connections for the HTTP client. Default is 5.

Parameters:

maxIdleConnections - the maximum idle connections

Returns:

the configurable object itself for chaining

withProxy

public 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

public T withProxyAuthenticator(Authenticator proxyAuthenticator)

Sets the proxy authenticator for the HTTP client.

Parameters:

proxyAuthenticator - the proxy authenticator to use

Returns:

the configurable object itself for chaining

withReadTimeout

public T withReadTimeout(long timeout, TimeUnit unit)

Set the read timeout on the HTTP client. Default is 10 seconds.

Parameters:

timeout - the timeout numeric value
unit - the time unit for the numeric value

Returns:

the configurable object itself for chaining

withUserAgent

public T withUserAgent(String userAgent)

Specify the user agent header.

Parameters:

userAgent - the user agent to use

Returns:

the configurable object itself

Applies to