ConfigurationClient.getConfigurationSettingWithResponse(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged, Context context) Method

Definition

Attempts to get the ConfigurationSetting with a matching getKey(), and optional getLabel(), optional acceptDateTime and optional ETag combination.

Code Samples

Retrieve the setting with the key "prodDBConnection".

// Retrieve the setting with the key-label "prodDBConnection"-"westUS".
 Response<ConfigurationSetting> responseResultSetting = configurationClient.getConfigurationSettingWithResponse(
     new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"),
     null, false, new Context(key1, value1));
 System.out.printf("Key: %s, Value: %s", responseResultSetting.getValue().getKey(),
     responseResultSetting.getValue().getValue());
public Response<ConfigurationSetting> getConfigurationSettingWithResponse(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged, Context context)

Parameters

setting
ConfigurationSetting

The setting to retrieve.

acceptDateTime
java.time.OffsetDateTime

Datetime to access a past state of the configuration setting. If null then the current state of the configuration setting will be returned.

ifChanged
boolean

Flag indicating if the setting getETag is used as a If-None-Match header.

context
Context

Additional context that is passed through the Http pipeline during the service call.

Returns

A REST response contains the 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 ServiceRequestException described below).

Applies to