diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 022f981e8725..bdf42a6e2248 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -27,7 +27,7 @@ 1.0.0-preview.3 1.0.0-preview.3 1.0.0-preview.3 - 1.0.0-preview.1 + 1.0.0-preview.2 1.0.0-preview.1 4.0.0-preview.1 5.0.0-preview.2 diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index aa3e5dc764da..cb5b2dfdceef 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -23,7 +23,7 @@ 1.0.0-preview.3 - 1.0.0-preview.1 + 1.0.0-preview.2 1.0.0-preview.1 4.0.0-preview.1 1.0.0-preview.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md index 8740e54e7621..2ee4515c73c5 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md @@ -21,7 +21,7 @@ Use the client library for App Configuration to create and manage application co com.azure azure-data-appconfiguration - 1.0.0-preview.1 + 1.0.0-preview.2 ``` @@ -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)); ``` diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index 5f3c743e6a26..e675f1abd993 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -13,7 +13,7 @@ com.azure azure-data-appconfiguration - 1.0.0-preview.1 + 1.0.0-preview.2 Microsoft Azure client library for App Configuration This package contains the Microsoft Azure App Configuration client library. diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/AzureConfiguration.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/AzureConfiguration.java index 13785a52eb77..2b85ed98688b 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/AzureConfiguration.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/AzureConfiguration.java @@ -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"; } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java index 1d751432d742..cdf87bc3aaac 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java @@ -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. * *

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}.

+ * construct a client, set the ConfigurationClientCredentials with + * {@link #credential(ConfigurationClientCredentials) this}.

* *

Instantiating an asynchronous Configuration Client

* @@ -50,11 +52,11 @@ * * {@codesnippet com.azure.data.applicationconfig.configurationclient.instantiation} * - *

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.

+ *

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.

* * {@codesnippet com.azure.data.applicationconfig.configurationclient.pipeline.instantiation} * @@ -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. * *

- * 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.

+ * 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.

* * @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. * *

- * 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. *

* * @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; @@ -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. @@ -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; } @@ -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; } @@ -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; } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/credentials/ConfigurationClientCredentials.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/credentials/ConfigurationClientCredentials.java index 5759ee76e2f7..6370024bb578 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/credentials/ConfigurationClientCredentials.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/credentials/ConfigurationClientCredentials.java @@ -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> getAuthorizationHeadersAsync(URL url, String httpMethod, Flux contents) { return contents diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingPage.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingPage.java index 9bd010d7ebe5..3ee39c33eff7 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingPage.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingPage.java @@ -20,9 +20,9 @@ public final class ConfigurationSettingPage implements Page 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() { @@ -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 items() { diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/ConfigurationSetting.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/ConfigurationSetting.java index 24bf8709e7e9..27be16892dea 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/ConfigurationSetting.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/ConfigurationSetting.java @@ -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 { @@ -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. diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/Range.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/Range.java index 07a7214acb94..b5a5e92463a1 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/Range.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/Range.java @@ -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) diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/SettingSelector.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/SettingSelector.java index 90856854f1aa..59c0a33bc028 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/SettingSelector.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/SettingSelector.java @@ -14,17 +14,16 @@ * *
    *
  • - * 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. *
  • *
  • - * 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}. *
  • *
  • - * 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. *
  • *
*