public final class ConfigurationAsyncClient extends ServiceClient
ConfigurationSettings
in Azure App Configuration Store. Operations allowed by the client are adding, retrieving, updating, and deleting
ConfigurationSettings, and listing settings or revision of a setting based on a filter
.
Instantiating an Asynchronous Configuration Client
ConfigurationAsyncClient client = ConfigurationAsyncClient.builder() .credentials(new ConfigurationClientCredentials(connectionString)) .build();
View this
for additional ways to construct the client.
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
addSetting(ConfigurationSetting setting)
Adds a configuration value in the service if that key and label does not exist.
|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
addSetting(String key,
String value)
Adds a configuration value in the service if that key does not exist.
|
static ConfigurationAsyncClientBuilder |
builder()
Creates a builder that can configure options for the ConfigurationAsyncClient before creating an instance of it.
|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
deleteSetting(ConfigurationSetting setting)
Deletes the
ConfigurationSetting with a matching key, along with the given label and etag. |
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
deleteSetting(String key)
Deletes the ConfigurationSetting with a matching
key . |
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
getSetting(ConfigurationSetting setting)
Attempts to get the ConfigurationSetting given the
key , optional label . |
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
getSetting(String key)
Attempts to get a ConfigurationSetting that matches the
key . |
reactor.core.publisher.Flux<ConfigurationSetting> |
listSettingRevisions(SettingSelector selector)
Lists chronological/historical representation of
ConfigurationSetting resource(s). |
reactor.core.publisher.Flux<ConfigurationSetting> |
listSettings(SettingSelector options)
Fetches the configuration settings that match the
options . |
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
setSetting(ConfigurationSetting setting)
Creates or updates a configuration value in the service.
|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
setSetting(String key,
String value)
Creates or updates a configuration value in the service with the given key.
|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
updateSetting(ConfigurationSetting setting)
Updates an existing configuration value in the service.
|
reactor.core.publisher.Mono<Response<ConfigurationSetting>> |
updateSetting(String key,
String value)
Updates an existing configuration value in the service with the given key.
|
httpPipeline
public static ConfigurationAsyncClientBuilder builder()
ConfigurationAsyncClientBuilder
to create a ConfigurationAsyncClient from.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> addSetting(String key, String value)
Code Samples
Add a setting with the key "prodDBConnection" and value "db_connection".
client.addSetting("prodDBConnection", "db_connection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
key
- The key of the configuration setting to add.value
- The value associated with this configuration setting key.ConfigurationSetting
that was created, or null
, if a key collision occurs or the key
is an invalid value (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If a ConfigurationSetting with the same key exists.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting)
Code Samples
Add a setting with the key "prodDBConnection", label "westUS", and value "db_connection".
client.addSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("db_connection")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
setting
- The setting to add to the configuration service.ConfigurationSetting
that was created, or null
, if a key collision occurs or the key
is an invalid value (which will also throw HttpResponseException described below).NullPointerException
- If setting
is null
.IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If a ConfigurationSetting with the same key and label exists.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> setSetting(String key, String value)
Code Samples
Add a setting with the key "prodDBConnection" and value "db_connection".
client.setSetting("prodDBConnection", "db_connection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
Update the value of the setting to "updated_db_connection".
client.setSetting("prodDBConnection", "updated_db_connection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
key
- The key of the configuration setting to create or update.value
- The value of this configuration setting.ConfigurationSetting
that was created or updated, or null
, if the key is an invalid
value (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If the setting exists and is locked.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> setSetting(ConfigurationSetting setting)
etag
is specified, the configuration value is updated if the current
setting's etag matches. If the etag's value is equal to the wildcard character ("*"
), the setting
will always be updated.
Code Samples
Add a setting with the key "prodDBConnection", label "westUS", and value "db_connection".
client.setSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("db_connection")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
Update the value of the setting to "updated_db_connection".
client.setSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("updated_db_connection")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
setting
- The configuration setting to create or update.ConfigurationSetting
that was created or updated, or null
, if the key is an invalid
value, the setting is locked, or an etag was provided but does not match the service's current etag value (which
will also throw HttpResponseException described below).NullPointerException
- If setting
is null
.IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If the etag
was specified, is not the
wildcard character, and the current configuration value's etag does not match, or the
setting exists and is locked.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> updateSetting(String key, String value)
Code Samples
Update a setting with the key "prodDBConnection" to have the value "updated_db_connection".
client.updateSetting("prodDBConnection", "updated_db_connection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
key
- The key of the configuration setting to update.value
- The updated value of this configuration setting.ConfigurationSetting
that was updated, or null
, if the configuration value does not
exist, is locked, or the key is an invalid value (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.HttpResponseException
- If a ConfigurationSetting with the key does not exist or the configuration value
is locked.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> updateSetting(ConfigurationSetting setting)
etag
is specified, the configuration value is only updated if it matches.
Code Samples
Update the setting with the key-label pair "prodDBConnection"-"westUS" to have the value "updated_db_connection".
client.updateSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("updated_db_connection")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
setting
- The setting to add or update in the service.ConfigurationSetting
that was updated, or null
, if the configuration value does not
exist, is locked, or the key is an invalid value (which will also throw HttpResponseException described below).NullPointerException
- If setting
is null
.IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If a ConfigurationSetting with the same key and label does not
exist, the setting is locked, or etag
is specified but does not match
the current value.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> getSetting(String key)
key
.
Code Samples
Retrieve the setting with the key "prodDBConnection".
client.getSetting("prodDBConnection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
key
- The key of the setting to retrieve.ConfigurationSetting
stored in the service, or null
, if the configuration value does
not exist or the key is an invalid value (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.ResourceNotFoundException
- If a ConfigurationSetting with key
does not exist.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> getSetting(ConfigurationSetting setting)
key
, optional label
.
Code Samples
Retrieve the setting with the key-label "prodDBConnection"-"westUS".
client.getSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
setting
- The setting to retrieve based on its key and optional label combination.ConfigurationSetting
stored in the service, or null
, if the configuration value does
not exist or the key is an invalid value (which will also throw HttpResponseException described below).NullPointerException
- If setting
is null
.IllegalArgumentException
- If key
is null
.ResourceNotFoundException
- If a ConfigurationSetting with the same key and label does not exist.HttpResponseException
- If the key is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> deleteSetting(String key)
key
.
Code Samples
Delete the setting with the key "prodDBConnection".
client.deleteSetting("prodDBConnection") .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
key
- The key of the setting to delete.null
if it didn't exist. null
is also returned if
the key
is an invalid value (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.ResourceModifiedException
- If the ConfigurationSetting is locked.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Mono<Response<ConfigurationSetting>> deleteSetting(ConfigurationSetting setting)
ConfigurationSetting
with a matching key, along with the given label and etag.
If etag
is specified and is not the wildcard character ("*"
),
then the setting is only deleted if the etag matches the current etag; this means that no one has updated
the ConfigurationSetting yet.
Code Samples
Delete the setting with the key-label "prodDBConnection"-"westUS".
client.deleteSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS")) .subscribe(response -> { ConfigurationSetting result = response.value(); System.out.printf("Key: %s, Value: %s", result.key(), result.value()); });
setting
- The ConfigurationSetting to delete.null
if didn't exist. null
is also returned if
the key
is an invalid value or etag
is set but does not match the
current etag (which will also throw HttpResponseException described below).IllegalArgumentException
- If key
is null
.NullPointerException
- When setting
is null
.ResourceModifiedException
- If the ConfigurationSetting is locked.ResourceNotFoundException
- If etag
is specified, not the wildcard
character, and does not match the current etag value.HttpResponseException
- If key
is an empty string.public reactor.core.publisher.Flux<ConfigurationSetting> listSettings(SettingSelector options)
options
. If options
is null
, then all
the configuration settings
are fetched with their current values.
Code Samples
Retrieve all settings that use the key "prodDBConnection".
client.listSettings(new SettingSelector().key("prodDBConnection")) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.key(), setting.value()));
options
- Optional. Options to filter configuration setting results from the service.options
. If no options were provided, the Flux
contains all of the current settings in the service.public reactor.core.publisher.Flux<ConfigurationSetting> listSettingRevisions(SettingSelector selector)
ConfigurationSetting
resource(s). Revisions are provided
in descending order from their lastModified
date. Revisions expire
after a period of time. The service maintains change history for up to 7 days.
If options
is null
, then all the ConfigurationSettings
are fetched
in their current state. Otherwise, the results returned match the parameters given in options
.
Code Samples
Retrieve all revisions of the setting that has the key "prodDBConnection".
client.listSettingRevisions(new SettingSelector().key("prodDBConnection")) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.key(), setting.value()));
selector
- Optional. Used to filter configuration setting revisions from the service.Copyright © 2019 Microsoft Corporation. All rights reserved.