public final class KeyVaultBackupClientBuilder extends Object
KeyVaultBackupAsyncClient
and KeyVaultBackupClient
, by calling
KeyVaultBackupClientBuilder.buildAsyncClient()
and KeyVaultBackupClientBuilder.buildClient()
respectively. It constructs an instance of the desired client.
The minimal configuration options required by KeyVaultBackupClientBuilder
to build an
an KeyVaultBackupAsyncClient
are vaultUrl
and credential
.
The HttpLogDetailLevel
, multiple custom policies
and custom
HttpClient
can be optionally configured in the KeyVaultBackupClientBuilder
.
Alternatively, a custom HttpPipeline
with custom HttpPipelinePolicy
policies and vaultUrl
can be specified. It provides finer control over the construction of KeyVaultBackupAsyncClient
and KeyVaultBackupClient
instances.
The minimal configuration options required by KeyVaultBackupClientBuilder
to build an
KeyVaultBackupClient
are vaultUrl
and credential
.
KeyVaultBackupAsyncClient
,
KeyVaultBackupClient
Constructor and Description |
---|
KeyVaultBackupClientBuilder()
Creates a
KeyVaultBackupClientBuilder instance that is able to configure and construct instances of
KeyVaultBackupClient and KeyVaultBackupAsyncClient . |
Modifier and Type | Method and Description |
---|---|
KeyVaultBackupClientBuilder |
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
Adds a policy to the set of existing policies that are executed after and
KeyVaultBackupClient
KeyVaultBackupAsyncClient required policies. |
KeyVaultBackupAsyncClient |
buildAsyncClient()
Creates a
KeyVaultBackupAsyncClient based on options set in the Builder. |
KeyVaultBackupClient |
buildClient()
Creates an
KeyVaultBackupClient based on options set in the Builder. |
KeyVaultBackupClientBuilder |
clientOptions(com.azure.core.util.ClientOptions clientOptions)
Sets the
ClientOptions which enables various options to be set on the client. |
KeyVaultBackupClientBuilder |
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration store that is used during construction of the service client.
|
KeyVaultBackupClientBuilder |
credential(com.azure.core.credential.TokenCredential credential)
Sets the credential to use when authenticating HTTP requests.
|
KeyVaultBackupClientBuilder |
httpClient(com.azure.core.http.HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.
|
KeyVaultBackupClientBuilder |
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets the logging configuration for HTTP requests and responses.
|
KeyVaultBackupClientBuilder |
pipeline(com.azure.core.http.HttpPipeline pipeline)
Sets the HTTP pipeline to use for the service client.
|
KeyVaultBackupClientBuilder |
retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
Sets the
RetryPolicy that is used when each request is sent. |
KeyVaultBackupClientBuilder |
serviceVersion(KeyVaultAdministrationServiceVersion serviceVersion)
Sets the
KeyVaultAdministrationServiceVersion that is used when making API requests. |
KeyVaultBackupClientBuilder |
vaultUrl(String vaultUrl)
Sets the URL to the Key Vault on which the client operates.
|
public KeyVaultBackupClientBuilder()
KeyVaultBackupClientBuilder
instance that is able to configure and construct instances of
KeyVaultBackupClient
and KeyVaultBackupAsyncClient
.public KeyVaultBackupClient buildClient()
KeyVaultBackupClient
based on options set in the Builder. Every time buildClient()
is called a new instance of KeyVaultBackupClient
is created.
If pipeline
is set, then only the pipeline
and
vaultUrl
are used to create the client
. All other
builder settings are ignored.
KeyVaultBackupClient
with the options set from the builder.NullPointerException
- If vaultUrl
is null
.public KeyVaultBackupAsyncClient buildAsyncClient()
KeyVaultBackupAsyncClient
based on options set in the Builder. Every time buildAsyncClient()
is called a new instance of KeyVaultBackupAsyncClient
is created.
If pipeline
is set, then only the pipeline
and
endpoint
are used to create the client
. All other
builder settings are ignored.
KeyVaultBackupAsyncClient
with the options set from the builder.NullPointerException
- If vaultUrl
is null
.public KeyVaultBackupClientBuilder vaultUrl(String vaultUrl)
vaultUrl
- The vault URL is used as destination on Azure to send requests to.KeyVaultBackupClientBuilder
object.IllegalArgumentException
- If vaultUrl
is null or it cannot be parsed into a valid URL.NullPointerException
- If credential
is null
.public KeyVaultBackupClientBuilder credential(com.azure.core.credential.TokenCredential credential)
credential
- The credential to use for authenticating HTTP requests.KeyVaultBackupClientBuilder
object.NullPointerException
- If credential
is null
.public KeyVaultBackupClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
If logLevel is not provided, default value of HttpLogDetailLevel.NONE
is set.
logOptions
- The logging configuration to use when sending and receiving HTTP requests/responses.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
KeyVaultBackupClient
KeyVaultBackupAsyncClient
required policies.policy
- The policy
to be added.KeyVaultBackupClientBuilder
object.NullPointerException
- If policy
is null
.public KeyVaultBackupClientBuilder httpClient(com.azure.core.http.HttpClient client)
client
- The HTTP client to use for requests.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder pipeline(com.azure.core.http.HttpPipeline pipeline)
If pipeline
is set, all other settings are ignored, aside from
vaultUrl
to build KeyVaultBackupClient
or
KeyVaultBackupAsyncClient
.
pipeline
- The HTTP pipeline to use for sending service requests and receiving responses.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder configuration(com.azure.core.util.Configuration configuration)
The default configuration store is a clone of the global
configuration store
, use Configuration.NONE
to bypass using configuration settings during construction.
configuration
- The configuration store used to get configuration details.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
RetryPolicy
that is used when each request is sent.
The default retry policy will be used in the pipeline, if not provided.
retryPolicy
- User's retry policy applied to each request.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions)
ClientOptions
which enables various options to be set on the client. For example setting an
applicationId
using ClientOptions.setApplicationId(String)
to configure
the UserAgentPolicy
for telemetry/monitoring purposes.
More About Azure Core: Telemetry policy
clientOptions
- the ClientOptions
to be set on the client.KeyVaultBackupClientBuilder
object.public KeyVaultBackupClientBuilder serviceVersion(KeyVaultAdministrationServiceVersion serviceVersion)
KeyVaultAdministrationServiceVersion
that is used when making API requests.
If a service version is not provided, the service version that will be used will be the latest known service version based on the version of the client library being used. If no service version is specified, updating to a newer version the client library will have the result of potentially moving to a newer service version.
serviceVersion
- KeyVaultAdministrationServiceVersion
of the service API used when making requests.KeyVaultBackupClientBuilder
object.Copyright © 2021 Microsoft Corporation. All rights reserved.