ConfigurationClient.setReadOnly Method

Definition

Overloads

setReadOnly(ConfigurationSetting setting, boolean isReadOnly)

Sets the read-only status for the ConfigurationSetting.

Code Samples

Set the setting to read-only with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting setting = configurationClient.setReadOnly(
     new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), true);
 System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());

Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting setting = configurationClient.setReadOnly(
     new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false);
 System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
setReadOnly(String key, String label, boolean isReadOnly)

Sets the read-only status for the ConfigurationSetting that matches the key, the optional label.

Code Samples

Set the setting to read-only with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", true);
 System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());

Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", false);
 System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());

setReadOnly(ConfigurationSetting setting, boolean isReadOnly)

Sets the read-only status for the ConfigurationSetting.

Code Samples

Set the setting to read-only with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting setting = configurationClient.setReadOnly(
     new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), true);
 System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());

Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting setting = configurationClient.setReadOnly(
     new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false);
 System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
public ConfigurationSetting setReadOnly(ConfigurationSetting setting, boolean isReadOnly)

Parameters

setting
ConfigurationSetting

The configuration setting to set to read-only or not read-only based on the isReadOnly.

isReadOnly
boolean

Flag used to set the read-only status of the configuration. true will put the configuration into a read-only state, false will clear the state.

Returns

The ConfigurationSetting that is read-only, or null is also returned if a key collision occurs or the key is an invalid value (which will also throw HttpResponseException described below).

setReadOnly(String key, String label, boolean isReadOnly)

Sets the read-only status for the ConfigurationSetting that matches the key, the optional label.

Code Samples

Set the setting to read-only with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", true);
 System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());

Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".

ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", false);
 System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
public ConfigurationSetting setReadOnly(String key, String label, boolean isReadOnly)

Parameters

key
java.lang.String

The key of configuration setting to set to read-only or not read-only based on the isReadOnly.

label
java.lang.String

The label of configuration setting to set to read-only or not read-only based on the isReadOnly value, or optionally. If null no label will be used.

isReadOnly
boolean

Flag used to set the read-only status of the configuration. true will put the configuration into a read-only state, false will clear the state.

Returns

The ConfigurationSetting that is read-only, or null is also returned if a key collision occurs or the key is an invalid value (which will also throw HttpResponseException described below).

Applies to