CredentialBuilderBase<T> Class
- java.
lang. Object - com.
azure. identity. CredentialBuilderBase<T>
- com.
Type Parameters
- T
the type of the credential builder
Implements
public abstract class CredentialBuilderBase
implements HttpTrait<T>
The base class for all the credential builders.
Method Summary
Modifier and Type | Method and Description |
---|---|
T |
addPolicy(HttpPipelinePolicy policy)
Adds a HttpPipelinePolicy to apply on each request sent. |
T |
clientOptions(ClientOptions clientOptions)
Allows for setting common properties such as application ID, headers, proxy configuration, etc. |
T |
configuration(Configuration configuration)
Sets the configuration store that is used during construction of the credential. |
T |
enableAccountIdentifierLogging()
Enables account identifiers to be logged on client side for debugging/monitoring purposes. |
T |
httpClient(HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service. |
T |
httpLogOptions(HttpLogOptions logOptions)
Sets the HttpLogOptions to use when sending and receiving requests to and from the service. |
T |
httpPipeline(HttpPipeline httpPipeline)
Deprecated
This method is deprecated.
Use pipeline(HttpPipeline pipeline) instead
Specifies the Http |
T |
maxRetry(int maxRetry)
Specifies the max number of retries when an authentication request fails. |
T |
pipeline(HttpPipeline pipeline)
Sets the HttpPipeline to use for the service client. |
T |
proxyOptions(ProxyOptions proxyOptions)
Deprecated
Configure the proxy options on the HttpClient instead and then set that client on the credential using httpClient(HttpClient client).
Specifies the options for proxy configuration. |
T |
retryOptions(RetryOptions retryOptions)
Sets the RetryOptions for all the requests made through the client. |
T |
retryPolicy(RetryPolicy retryPolicy)
Sets the RetryPolicy that is used when each request is sent. |
T |
retryTimeout(Function<Duration,Duration> retryTimeout)
Specifies a Function to calculate seconds of timeout on every retried request. |
Methods inherited from java.lang.Object
Method Details
addPolicy
public T addPolicy(HttpPipelinePolicy policy)
Adds a HttpPipelinePolicy to apply on each request sent.
Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a HttpPipeline is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no HttpPipeline is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an HttpPipeline is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.
Parameters:
Returns:
clientOptions
public T clientOptions(ClientOptions clientOptions)
Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is recommended that this method be called with an instance of the HttpClientOptions class (a subclass of the ClientOptions base class). The HttpClientOptions subclass provides more configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait interface.
Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a HttpPipeline is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no HttpPipeline is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an HttpPipeline is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.
Parameters:
Returns:
configuration
public T configuration(Configuration configuration)
Sets the configuration store that is used during construction of the credential. The default configuration store is a clone of the global configuration store.
Parameters:
Returns:
enableAccountIdentifierLogging
public T enableAccountIdentifierLogging()
Enables account identifiers to be logged on client side for debugging/monitoring purposes. By default, it is disabled.
The Account Identifier logs can contain sensitive information and should be enabled on protected machines only. Enabling this logs Application ID, Object ID, Tenant ID and User Principal Name at INFO level when an access token is successfully retrieved. Ensure that INFO level logs are enabled to see the account identifier logs.
Returns:
httpClient
public T httpClient(HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.
Parameters:
Returns:
httpLogOptions
public T httpLogOptions(HttpLogOptions logOptions)
Sets the HttpLogOptions to use when sending and receiving requests to and from the service. If a logLevel
is not provided, default value of HttpLogDetailLevel#NONE is set.
Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a HttpPipeline is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no HttpPipeline is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an HttpPipeline is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.
Parameters:
Returns:
httpPipeline
@Deprecated
public T httpPipeline(HttpPipeline httpPipeline)
Deprecated
Specifies the HttpPipeline to send all requests. This setting overrides the others.
Parameters:
Returns:
maxRetry
public T maxRetry(int maxRetry)
Specifies the max number of retries when an authentication request fails.
Parameters:
Returns:
pipeline
public T pipeline(HttpPipeline pipeline)
Sets the HttpPipeline to use for the service client.
Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a HttpPipeline is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no HttpPipeline is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an HttpPipeline is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.
Parameters:
Returns:
proxyOptions
@Deprecated
public T proxyOptions(ProxyOptions proxyOptions)
Deprecated
Specifies the options for proxy configuration.
Parameters:
Returns:
retryOptions
public T retryOptions(RetryOptions retryOptions)
Sets the RetryOptions for all the requests made through the client.
Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a HttpPipeline is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no HttpPipeline is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an HttpPipeline is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.
Setting this is mutually exclusive with using retryPolicy(RetryPolicy retryPolicy).
Parameters:
Returns:
retryPolicy
public T retryPolicy(RetryPolicy retryPolicy)
Sets the RetryPolicy that is used when each request is sent. Setting this is mutually exclusive with using retryOptions(RetryOptions retryOptions). The default retry policy will be used in the pipeline, if not provided.
Parameters:
Returns:
retryTimeout
public T retryTimeout(Function
Specifies a Function to calculate seconds of timeout on every retried request.
Parameters:
Returns:
Applies to
Azure SDK for Java