Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<azure-core-amqp.version>1.0.0-preview.3</azure-core-amqp.version>
<azure-core-management.version>1.0.0-preview.3</azure-core-management.version>
<azure-core-test.version>1.0.0-preview.3</azure-core-test.version>
<azure-data-appconfiguration.version>1.0.0-preview.1</azure-data-appconfiguration.version>
<azure-data-appconfiguration.version>1.0.0-preview.2</azure-data-appconfiguration.version>
<azure-identity.version>1.0.0-preview.1</azure-identity.version>
<azure-keyvault.version>4.0.0-preview.1</azure-keyvault.version>
<azure-messaging-eventhubs.version>5.0.0-preview.2</azure-messaging-eventhubs.version>
Expand Down
2 changes: 1 addition & 1 deletion eng/spotbugs-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- Track 2 client library versions -->
<azure-core.version>1.0.0-preview.3</azure-core.version>
<azure-data-appconfiguration.version>1.0.0-preview.1</azure-data-appconfiguration.version>
<azure-data-appconfiguration.version>1.0.0-preview.2</azure-data-appconfiguration.version>
<azure-identity.version>1.0.0-preview.1</azure-identity.version>
<azure-keyvault.version>4.0.0-preview.1</azure-keyvault.version>
<azure-identity.version>1.0.0-preview.1</azure-identity.version>
Expand Down
4 changes: 2 additions & 2 deletions sdk/appconfiguration/azure-data-appconfiguration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Use the client library for App Configuration to create and manage application co
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-data-appconfiguration</artifactId>
<version>1.0.0-preview.1</version>
<version>1.0.0-preview.2</version>
</dependency>
```

Expand Down Expand Up @@ -106,7 +106,7 @@ An application that has a large set of configurations that it needs to periodica
ConfigurationAsyncClient client = new ConfigurationClientBuilder()
.credential(new ConfigurationClientCredentials(appConfigConnectionString))
.buildAsyncClient();

client.listSettings(new SettingSelection().label(periodicUpdateLabel))
.subscribe(setting -> updateConfiguration(setting));
```
Expand Down
2 changes: 1 addition & 1 deletion sdk/appconfiguration/azure-data-appconfiguration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-data-appconfiguration</artifactId>
<version>1.0.0-preview.1</version>
<version>1.0.0-preview.2</version>

<name>Microsoft Azure client library for App Configuration</name>
<description>This package contains the Microsoft Azure App Configuration client library.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
class AzureConfiguration {
//TODO: Eventually remove these hardcoded strings with https://github.com/Azure/azure-sdk-for-java/issues/3141
static final String NAME = "application-configuration";
static final String VERSION = "1.0.0-SNAPSHOT";
static final String VERSION = "1.0.0-preview.2";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
import java.util.Objects;

/**
* This class provides a fluent builder API to help aid the configuration and instantiation of the {@link ConfigurationAsyncClient} and {@link ConfigurationClient},
* by calling {@link ConfigurationClientBuilder#buildAsyncClient() buildAsyncClient} and {@link ConfigurationClientBuilder#buildClient() buildClient} respectively
* to construct an instance of the desired client.
* This class provides a fluent builder API to help aid the configuration and instantiation of
* {@link ConfigurationClient ConfigurationClients} and {@link ConfigurationAsyncClient ConfigurationAsyncClients},
* call {@link #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct
* an instance of the desired client.
*
* <p>The client needs the service endpoint of the Azure App Configuration store and access credential.
* {@link ConfigurationClientCredentials} gives the builder the service endpoint and access credential it requires to
* construct a client, set the ConfigurationClientCredentials with {@link ConfigurationClientBuilder#credential(ConfigurationClientCredentials) this}.</p>
* construct a client, set the ConfigurationClientCredentials with
* {@link #credential(ConfigurationClientCredentials) this}.</p>
*
* <p><strong>Instantiating an asynchronous Configuration Client</strong></p>
*
Expand All @@ -50,11 +52,11 @@
*
* {@codesnippet com.azure.data.applicationconfig.configurationclient.instantiation}
*
* <p>Another way to construct the client is using a {@link 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
* {@link ConfigurationClientBuilder#pipeline(HttpPipeline) this}, additionally set the service endpoint with
* {@link ConfigurationClientBuilder#endpoint(String) this}. Using a pipeline requires additional setup but
* allows for finer control on how the {@link ConfigurationAsyncClient} and {@link ConfigurationClient} it built.</p>
* <p>Another way to construct the client is using a {@link 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
* {@link #pipeline(HttpPipeline) this} and set the service endpoint with {@link #endpoint(String) this}. Using a
* pipeline requires additional setup but allows for finer control on how the {@link ConfigurationClient} and
* {@link ConfigurationAsyncClient} is built.</p>
*
* {@codesnippet com.azure.data.applicationconfig.configurationclient.pipeline.instantiation}
*
Expand Down Expand Up @@ -99,40 +101,38 @@ public ConfigurationClientBuilder() {
}
/**
* Creates a {@link ConfigurationClient} based on options set in the Builder. Every time {@code buildClient()} is
* called, a new instance of {@link ConfigurationClient} is created.
* called a new instance of {@link ConfigurationClient} is created.
*
* <p>
* If {@link ConfigurationClientBuilder#pipeline(HttpPipeline) pipeline} is set, then the {@code pipeline} and
* {@link ConfigurationClientBuilder#endpoint(String) endpoint} are used to create the
* {@link ConfigurationClient client}. All other builder settings are ignored.</p>
* If {@link #pipeline(HttpPipeline) pipeline} is set, then the {@code pipeline} and
* {@link #endpoint(String) endpoint} are used to create the {@link ConfigurationClient client}. All other builder
* settings are ignored.</p>
*
* @return A ConfigurationClient with the options set from the builder.
* @throws NullPointerException If {@code endpoint} has not been set. This setting is automatically set when
* {@link ConfigurationClientBuilder#credential(ConfigurationClientCredentials) credential} are set through
* the builder. Or can be set explicitly by calling {@link ConfigurationClientBuilder#endpoint(String)}.
* @throws IllegalStateException If {@link ConfigurationClientBuilder#credential(ConfigurationClientCredentials)}
* has not been set.
* {@link #credential(ConfigurationClientCredentials) credential} are set through the builder. Or can be set
* explicitly by calling {@link #endpoint(String)}.
* @throws IllegalStateException If {@link #credential(ConfigurationClientCredentials)} has not been set.
*/
public ConfigurationClient buildClient() {
return new ConfigurationClient(buildAsyncClient());
}

/**
* Creates a {@link ConfigurationAsyncClient} based on options set in the Builder. Every time {@code buildAsyncClient()} is
* called, a new instance of {@link ConfigurationAsyncClient} is created.
* Creates a {@link ConfigurationAsyncClient} based on options set in the Builder. Every time
* {@code buildAsyncClient()} is called a new instance of {@link ConfigurationAsyncClient} is created.
*
* <p>
* If {@link ConfigurationClientBuilder#pipeline(HttpPipeline) pipeline} is set, then the {@code pipeline} and
* {@link ConfigurationClientBuilder#endpoint(String) endpoint} are used to create the
* {@link ConfigurationAsyncClient client}. All other builder settings are ignored.
* If {@link #pipeline(HttpPipeline) pipeline} is set, then the {@code pipeline} and
* {@link #endpoint(String) endpoint} are used to create the {@link ConfigurationAsyncClient client}. All other
* builder settings are ignored.
* </p>
*
* @return A ConfigurationAsyncClient with the options set from the builder.
* @throws NullPointerException If {@code endpoint} has not been set. This setting is automatically set when
* {@link ConfigurationClientBuilder#credential(ConfigurationClientCredentials) credential} are set through
* the builder. Or can be set explicitly by calling {@link ConfigurationClientBuilder#endpoint(String)}.
* @throws IllegalStateException If {@link ConfigurationClientBuilder#credential(ConfigurationClientCredentials)}
* has not been set.
* {@link #credential(ConfigurationClientCredentials) credential} are set through the builder. Or can be set
* explicitly by calling {@link #endpoint(String)}.
* @throws IllegalStateException If {@link #credential(ConfigurationClientCredentials)} has not been set.
*/
public ConfigurationAsyncClient buildAsyncClient() {
Configuration buildConfiguration = (configuration == null) ? ConfigurationManager.getConfiguration().clone() : configuration;
Expand Down Expand Up @@ -193,8 +193,8 @@ public ConfigurationClientBuilder endpoint(String endpoint) {
}

/**
* Sets the credential to use when authenticating HTTP requests. Also, sets the
* {@link ConfigurationClientBuilder#endpoint(String) endpoint} for this ConfigurationClientBuilder.
* Sets the credential to use when authenticating HTTP requests. Also, sets the {@link #endpoint(String) endpoint}
* for this ConfigurationClientBuilder.
*
* @param credential The credential to use for authenticating HTTP requests.
* @return The updated ConfigurationClientBuilder object.
Expand All @@ -211,9 +211,10 @@ public ConfigurationClientBuilder credential(ConfigurationClientCredentials cred
*
* @param logLevel The amount of logging output when sending and receiving HTTP requests/responses.
* @return The updated ConfigurationClientBuilder object.
* @throws NullPointerException If {@code logLevel} is {@code null}.
*/
public ConfigurationClientBuilder httpLogDetailLevel(HttpLogDetailLevel logLevel) {
httpLogDetailLevel = logLevel;
httpLogDetailLevel = Objects.requireNonNull(logLevel);
return this;
}

Expand All @@ -235,10 +236,12 @@ public ConfigurationClientBuilder addPolicy(HttpPipelinePolicy policy) {
*
* @param client The HTTP client to use for requests.
* @return The updated ConfigurationClientBuilder object.
* @throws NullPointerException If {@code client} is {@code null}.
*/
public ConfigurationClientBuilder httpClient(HttpClient client) {
Objects.requireNonNull(client);
if (this.httpClient != null && client == null) {
logger.info("HttpClient is being set to 'null' when it was previously configured.");
}

this.httpClient = client;
return this;
}
Expand All @@ -253,7 +256,10 @@ public ConfigurationClientBuilder httpClient(HttpClient client) {
* @return The updated ConfigurationClientBuilder object.
*/
public ConfigurationClientBuilder pipeline(HttpPipeline pipeline) {
Objects.requireNonNull(pipeline);
if (this.pipeline != null && pipeline == null) {
logger.info("HttpPipeline is being set to 'null' when it was previously configured.");
}

this.pipeline = pipeline;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public URL baseUri() {
* @param httpMethod the request HTTP method
* @param contents the body content of the request
* @return a flux of headers to add for authorization
* @throws NoSuchAlgorithmException If the SHA-256 algorithm doesn't exist.
*/
public Mono<Map<String, String>> getAuthorizationHeadersAsync(URL url, String httpMethod, Flux<ByteBuf> contents) {
return contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public final class ConfigurationSettingPage implements Page<ConfigurationSetting
private List<ConfigurationSetting> items;

/**
* Gets the link to the next page. Or {@code null} if there are no more resources to fetch.
* Gets the link to the next page.
*
* @return The link to the next page.
* @return The link to the next page or {@code null} if there are no more resources to fetch.
*/
@Override
public String nextLink() {
Expand All @@ -32,7 +32,7 @@ public String nextLink() {
/**
* Gets the list of {@link ConfigurationSetting ConfigurationSettings} on this page.
*
* @return The list of items in {@link List}.
* @return The list of {@link ConfigurationSetting ConfigurationSettings}.
*/
@Override
public List<ConfigurationSetting> items() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
import java.util.Objects;

/**
* ConfigurationSetting is a resource identified by unique combination of {@link ConfigurationSetting#key() key} and
* {@link ConfigurationSetting#label() label}. By default, the label is {@code null}. To explicitly reference the
* default label use {@link ConfigurationSetting#NO_LABEL}.
* ConfigurationSetting is a resource identified by unique combination of {@link #key() key} and {@link #label() label}.
* By default, the label is {@code null}. To explicitly reference the default label use {@link #NO_LABEL}.
*/
@Fluent
public class ConfigurationSetting {
Expand Down Expand Up @@ -84,8 +83,8 @@ public String label() {
}

/**
* Sets the label of this configuration setting. {@link ConfigurationSetting#NO_LABEL} is the default label used
* when this value is not set.
* Sets the label of this configuration setting. {@link #NO_LABEL} is the default label used when this value is
* not set.
*
* @param label The label of this configuration setting.
* @return The updated ConfigurationSetting object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import com.azure.core.implementation.annotation.Immutable;
import com.azure.data.appconfiguration.ConfigurationAsyncClient;
import com.azure.data.appconfiguration.ConfigurationClient;
import com.azure.data.appconfiguration.implementation.ConfigurationSettingPage;

/**
* A configuration for selecting a range of revisions when retrieving configuration setting revisions from the
* App Configuration service.
* A configuration for selecting a range of revisions that will be returned in a single
* {@link ConfigurationSettingPage response page} when retrieving revisions from the App Configuration service.
*
* @see ConfigurationAsyncClient#listSettingRevisions(SettingSelector)
* @see ConfigurationClient#listSettingRevisions(SettingSelector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
*
* <ul>
* <li>
* Providing {@link SettingSelector#labels() labels} will filter
* {@link ConfigurationSetting ConfigurationSettings} that match any label name in conjunction with the keys
* that are passed in to the service request.
* Providing {@link #labels() labels} will filter {@link ConfigurationSetting ConfigurationSettings} that match
* any label name in conjunction with the keys that are passed in to the service request.
* </li>
* <li>
* Providing {@link SettingSelector#acceptDateTime() acceptDateTime} will return the representation of matching
* Providing {@link #acceptDateTime() acceptDateTime} will return the representation of matching
* {@link ConfigurationSetting} at that given {@link OffsetDateTime}.
* </li>
* <li>
* Providing {@link SettingSelector#fields() fields} will populate only those {@link ConfigurationSetting}
* fields in the response. By default, all of the fields are returned.
* Providing {@link #fields() fields} will populate only those {@link ConfigurationSetting} fields in the
* response. By default, all of the fields are returned.
* </li>
* </ul>
*
Expand Down