Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information.
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. */
package com.microsoft.azure.arm.resources; import com.microsoft.rest.LogLevel; import okhttp3.Authenticator; import okhttp3.Interceptor; import java.net.Proxy; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit;
The base interface for allowing configurations to be made on the HTTP client.
Type parameters:
  • <T> – the actual type of the interface extending this interface
/** * The base interface for allowing configurations to be made on the HTTP client. * * @param <T> the actual type of the interface extending this interface */
public interface AzureConfigurable<T extends AzureConfigurable<T>> {
Set the logging level on the HTTP client.
Params:
  • level – the OkHttp logging level
Returns:the configurable object itself
/** * Set the logging level on the HTTP client. * * @param level the OkHttp logging level * @return the configurable object itself */
T withLogLevel(LogLevel level);
Plug in an interceptor into the HTTP pipeline.
Params:
  • interceptor – the interceptor to plug in
Returns:the configurable object itself
/** * Plug in an interceptor into the HTTP pipeline. * * @param interceptor the interceptor to plug in * @return the configurable object itself */
T withInterceptor(Interceptor interceptor);
Specify the user agent header.
Params:
  • userAgent – the user agent to use
Returns:the configurable object itself
/** * Specify the user agent header. * * @param userAgent the user agent to use * @return the configurable object itself */
T withUserAgent(String userAgent);
Set the read timeout on the HTTP client. Default is 10 seconds.
Params:
  • timeout – the timeout numeric value
  • unit – the time unit for the numeric value
Returns:the configurable object itself for chaining
/** * Set the read timeout on the HTTP client. Default is 10 seconds. * * @param timeout the timeout numeric value * @param unit the time unit for the numeric value * @return the configurable object itself for chaining */
T withReadTimeout(long timeout, TimeUnit unit);
Set the connection timeout on the HTTP client. Default is 10 seconds.
Params:
  • timeout – the timeout numeric value
  • unit – the time unit for the numeric value
Returns:the configurable object itself for chaining
/** * Set the connection timeout on the HTTP client. Default is 10 seconds. * * @param timeout the timeout numeric value * @param unit the time unit for the numeric value * @return the configurable object itself for chaining */
T withConnectionTimeout(long timeout, TimeUnit unit);
Set the maximum idle connections for the HTTP client. Default is 5.
Params:
  • maxIdleConnections – the maximum idle connections
Returns:the configurable object itself for chaining
/** * Set the maximum idle connections for the HTTP client. Default is 5. * * @param maxIdleConnections the maximum idle connections * @return the configurable object itself for chaining */
T withMaxIdleConnections(int maxIdleConnections);
Sets the executor for async callbacks to run on.
Params:
  • executor – the executor to execute the callbacks.
Returns:the configurable object itself for chaining
/** * Sets the executor for async callbacks to run on. * * @param executor the executor to execute the callbacks. * @return the configurable object itself for chaining */
T withCallbackExecutor(Executor executor);
Sets the proxy for the HTTP client.
Params:
  • proxy – the proxy to use
Returns:the configurable object itself for chaining
/** * Sets the proxy for the HTTP client. * * @param proxy the proxy to use * @return the configurable object itself for chaining */
T withProxy(Proxy proxy);
Sets the proxy authenticator for the HTTP client.
Params:
  • proxyAuthenticator – the proxy authenticator to use
Returns:the configurable object itself for chaining
/** * Sets the proxy authenticator for the HTTP client. * * @param proxyAuthenticator the proxy authenticator to use * @return the configurable object itself for chaining */
T withProxyAuthenticator(Authenticator proxyAuthenticator); }