Package com.azure.identity
Class CredentialBuilderBase<T extends CredentialBuilderBase<T>>
- java.lang.Object
-
- com.azure.identity.CredentialBuilderBase<T>
-
- Type Parameters:
T
- the type of the credential builder
- Direct Known Subclasses:
AadCredentialBuilderBase
,AzureCliCredentialBuilder
,AzurePowerShellCredentialBuilder
,DefaultAzureCredentialBuilder
,EnvironmentCredentialBuilder
,IntelliJCredentialBuilder
,ManagedIdentityCredentialBuilder
,VisualStudioCodeCredentialBuilder
public abstract class CredentialBuilderBase<T extends CredentialBuilderBase<T>> extends Object
The base class for all the credential builders.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description T
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration store that is used during construction of the credential.T
httpClient(com.azure.core.http.HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.T
httpPipeline(com.azure.core.http.HttpPipeline httpPipeline)
Specifies the HttpPipeline to send all requests.T
maxRetry(int maxRetry)
Specifies the max number of retries when an authentication request fails.T
proxyOptions(com.azure.core.http.ProxyOptions proxyOptions)
Deprecated.Configure the proxy options on theHttpClient
instead and then set that client on the credential usinghttpClient(HttpClient)
.T
retryTimeout(Function<Duration,Duration> retryTimeout)
Specifies a Function to calculate seconds of timeout on every retried request.
-
-
-
Method Detail
-
maxRetry
public T maxRetry(int maxRetry)
Specifies the max number of retries when an authentication request fails.- Parameters:
maxRetry
- the number of retries- Returns:
- An updated instance of this builder with the max retry set as specified.
-
retryTimeout
public T retryTimeout(Function<Duration,Duration> retryTimeout)
Specifies a Function to calculate seconds of timeout on every retried request.- Parameters:
retryTimeout
- the Function that returns a timeout in seconds given the number of retry- Returns:
- An updated instance of this builder with the retry timeout set as specified.
-
proxyOptions
@Deprecated public T proxyOptions(com.azure.core.http.ProxyOptions proxyOptions)
Deprecated.Configure the proxy options on theHttpClient
instead and then set that client on the credential usinghttpClient(HttpClient)
.Specifies the options for proxy configuration.- Parameters:
proxyOptions
- the options for proxy configuration- Returns:
- An updated instance of this builder with the proxy options set as specified.
-
httpPipeline
public T httpPipeline(com.azure.core.http.HttpPipeline httpPipeline)
Specifies the HttpPipeline to send all requests. This setting overrides the others.- Parameters:
httpPipeline
- the HttpPipeline to send all requests- Returns:
- An updated instance of this builder with the http pipeline set as specified.
-
httpClient
public T httpClient(com.azure.core.http.HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.- Parameters:
client
- The HTTP client to use for requests.- Returns:
- An updated instance of this builder with the http client set as specified.
- Throws:
NullPointerException
- Ifclient
isnull
.
-
configuration
public T configuration(com.azure.core.util.Configuration configuration)
Sets the configuration store that is used during construction of the credential. The default configuration store is a clone of theglobal configuration store
.- Parameters:
configuration
- The configuration store used to load Env variables and/or properties from.- Returns:
- An updated instance of this builder with the configuration store set as specified.
-
-