public final class ConfigurationAsyncClientBuilder extends Object
ConfigurationAsyncClient,
calling build constructs an instance of the client.
The client needs the service endpoint of the Azure App Configuration store and access credentials.
ConfigurationClientCredentials gives the builder the service endpoint and access credentials it requires to
construct a client, set the ConfigurationClientCredentials with this.
ConfigurationAsyncClient client = ConfigurationAsyncClient.builder()
.credentials(new ConfigurationClientCredentials(connectionString))
.build();
Another way to construct the client is using a HttpPipeline. The pipeline gives the client an authenticated
way to communicate with the service but it doesn't contain the service endpoint. Set the pipeline with
this, additionally set the service endpoint with
this. Using a pipeline requires additional setup but
allows for finer control on how the ConfigurationAsyncClient it built.
ConfigurationAsyncClient.builder()
.pipeline(new HttpPipeline(policies))
.serviceEndpoint(serviceEndpoint)
.build();
| Modifier and Type | Method and Description |
|---|---|
ConfigurationAsyncClientBuilder |
addPolicy(HttpPipelinePolicy policy)
Adds a policy to the set of existing policies that are executed after
ConfigurationAsyncClient required policies. |
ConfigurationAsyncClient |
build()
Creates a
ConfigurationAsyncClient based on options set in the Builder. |
ConfigurationAsyncClientBuilder |
configuration(Configuration configuration)
Sets the configuration store that is used during construction of the service client.
|
ConfigurationAsyncClientBuilder |
credentials(ConfigurationClientCredentials credentials)
Sets the credentials to use when authenticating HTTP requests.
|
ConfigurationAsyncClientBuilder |
httpClient(HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.
|
ConfigurationAsyncClientBuilder |
httpLogDetailLevel(HttpLogDetailLevel logLevel)
Sets the logging level for HTTP requests and responses.
|
ConfigurationAsyncClientBuilder |
pipeline(HttpPipeline pipeline)
Sets the HTTP pipeline to use for the service client.
|
ConfigurationAsyncClientBuilder |
serviceEndpoint(String serviceEndpoint)
Sets the service endpoint for the Azure App Configuration instance.
|
public ConfigurationAsyncClient build()
ConfigurationAsyncClient based on options set in the Builder. Every time build() is
called, a new instance of ConfigurationAsyncClient is created.
If pipeline is set, then the pipeline and
serviceEndpoint are used to create the
client. All other builder settings are ignored.
NullPointerException - If serviceEndpoint has not been set. This setting is automatically set when
credentials are set through
the builder. Or can be set explicitly by calling ConfigurationAsyncClientBuilder.serviceEndpoint(String).IllegalStateException - If ConfigurationAsyncClientBuilder.credentials(ConfigurationClientCredentials)
has not been set.public ConfigurationAsyncClientBuilder serviceEndpoint(String serviceEndpoint) throws MalformedURLException
serviceEndpoint - The URL of the Azure App Configuration instance to send ConfigurationSetting
service requests to and receive responses from.MalformedURLException - if serviceEndpoint is null or it cannot be parsed into a valid URL.public ConfigurationAsyncClientBuilder credentials(ConfigurationClientCredentials credentials)
serviceEndpoint for this ConfigurationAsyncClientBuilder.credentials - The credentials to use for authenticating HTTP requests.NullPointerException - If credentials is null.public ConfigurationAsyncClientBuilder httpLogDetailLevel(HttpLogDetailLevel logLevel)
logLevel - The amount of logging output when sending and receiving HTTP requests/responses.public ConfigurationAsyncClientBuilder addPolicy(HttpPipelinePolicy policy)
ConfigurationAsyncClient required policies.policy - The retry policy for service requests.NullPointerException - If policy is null.public ConfigurationAsyncClientBuilder httpClient(HttpClient client)
client - The HTTP client to use for requests.NullPointerException - If client is null.public ConfigurationAsyncClientBuilder pipeline(HttpPipeline pipeline)
pipeline is set, all other settings are ignored, aside from
serviceEndpoint to build ConfigurationAsyncClient.pipeline - The HTTP pipeline to use for sending service requests and receiving responses.public ConfigurationAsyncClientBuilder configuration(Configuration configuration)
global
configuration store, use Configuration.NONE to bypass using configuration settings during construction.configuration - The configuration store used toCopyright © 2019 Microsoft Corporation. All rights reserved.