public final class KeyEncryptionKeyClientBuilder extends Object implements com.azure.core.cryptography.KeyEncryptionKeyResolver, com.azure.core.cryptography.AsyncKeyEncryptionKeyResolver
KeyEncryptionKey async client and KeyEncryptionKey sync client,
by calling KeyEncryptionKeyClientBuilder.buildAsyncKeyEncryptionKey(String) and KeyEncryptionKeyClientBuilder.buildKeyEncryptionKey(String) respectively
It constructs an instance of the desired client.
The minimal configuration options required by KeyEncryptionKeyClientBuilder to
build AsyncKeyEncryptionKey are identifier) and
credential).
The log detail level, multiple custom policies and custom
http client can be optionally configured in the KeyEncryptionKeyClientBuilder.
Alternatively, custom http pipeline with custom HttpPipelinePolicy policies
can be specified. It provides finer control over the construction of AsyncKeyEncryptionKey and KeyEncryptionKey
The minimal configuration options required by keyEncryptionKeyClientBuilder
to build KeyEncryptionKey are key identifier) and
credential).
| Constructor and Description |
|---|
KeyEncryptionKeyClientBuilder()
The constructor with defaults.
|
| Modifier and Type | Method and Description |
|---|---|
KeyEncryptionKeyClientBuilder |
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
Adds a policy to the set of existing policies that are executed after the client required policies.
|
Mono<? extends com.azure.core.cryptography.AsyncKeyEncryptionKey> |
buildAsyncKeyEncryptionKey(String keyId)
Creates a
KeyEncryptionKeyAsyncClient based on options set in the builder. |
com.azure.core.cryptography.KeyEncryptionKey |
buildKeyEncryptionKey(String keyId)
Creates a
KeyEncryptionKey based on options set in the builder. |
KeyEncryptionKeyClientBuilder |
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration store that is used during construction of the service client.
|
KeyEncryptionKeyClientBuilder |
credential(com.azure.core.credential.TokenCredential credential)
Sets the credential to use when authenticating HTTP requests.
|
KeyEncryptionKeyClientBuilder |
httpClient(com.azure.core.http.HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.
|
KeyEncryptionKeyClientBuilder |
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets the logging configuration for HTTP requests and responses.
|
KeyEncryptionKeyClientBuilder |
pipeline(com.azure.core.http.HttpPipeline pipeline)
Sets the HTTP pipeline to use for the service client.
|
KeyEncryptionKeyClientBuilder |
retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
Sets the
RetryPolicy that is used when each request is sent. |
KeyEncryptionKeyClientBuilder |
serviceVersion(CryptographyServiceVersion version)
Sets the
CryptographyServiceVersion that is used when making API requests. |
public KeyEncryptionKeyClientBuilder()
public com.azure.core.cryptography.KeyEncryptionKey buildKeyEncryptionKey(String keyId)
KeyEncryptionKey based on options set in the builder.
Every time buildKeyEncryptionKey(String) is called, a new instance of KeyEncryptionKey
is created.
If pipeline is set, then the pipeline
and keyId are used to create the client.
All other builder settings are ignored. If pipeline is not set, then
vault credential and keyId
are required to build the client.
buildKeyEncryptionKey in interface com.azure.core.cryptography.KeyEncryptionKeyResolverKeyEncryptionKeyClient with the options set from the builder.IllegalStateException - If KeyEncryptionKeyClientBuilder.credential(TokenCredential) or
keyId have not been set.public Mono<? extends com.azure.core.cryptography.AsyncKeyEncryptionKey> buildAsyncKeyEncryptionKey(String keyId)
KeyEncryptionKeyAsyncClient based on options set in the builder.
Every time buildAsyncKeyEncryptionKey(String) is called, a new instance of
KeyEncryptionKeyAsyncClient is created.
If pipeline is set, then the pipeline
and keyId are used to create the async client.
All other builder settings are ignored. If pipeline is not set, then
(jsonWebKey vault credential and
keyId are required to build the async client.
buildAsyncKeyEncryptionKey in interface com.azure.core.cryptography.AsyncKeyEncryptionKeyResolverKeyEncryptionKeyAsyncClient with the options set from the builder.IllegalStateException - If KeyEncryptionKeyClientBuilder.credential(TokenCredential) or
keyId have not been set.public KeyEncryptionKeyClientBuilder credential(com.azure.core.credential.TokenCredential credential)
credential - The credential to use for authenticating HTTP requests.NullPointerException - if credential is null.public KeyEncryptionKeyClientBuilder 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.public KeyEncryptionKeyClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
policy - The policy to be added.NullPointerException - if policy is null.public KeyEncryptionKeyClientBuilder httpClient(com.azure.core.http.HttpClient client)
client - The HTTP client to use for requests.NullPointerException - If client is null.public KeyEncryptionKeyClientBuilder pipeline(com.azure.core.http.HttpPipeline pipeline)
pipeline is set, all other settings are ignored, aside from jsonWebKey identifier
or jsonWebKey to build the clients.pipeline - The HTTP pipeline to use for sending service requests and receiving responses.public KeyEncryptionKeyClientBuilder configuration(com.azure.core.util.Configuration configuration)
global
configuration store, use Configuration.NONE to bypass using configuration settings during construction.configuration - The configuration store used topublic KeyEncryptionKeyClientBuilder serviceVersion(CryptographyServiceVersion version)
CryptographyServiceVersion 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.
version - CryptographyServiceVersion of the service to be used when making requests.public KeyEncryptionKeyClientBuilder 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.NullPointerException - if the specified retryPolicy is null.Copyright © 2021 Microsoft Corporation. All rights reserved.