From 6c1d8d5246c0bfa3239079e529e373f4555db5ec Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 11:31:37 +0800 Subject: [PATCH 01/14] change Aware to Provider, move client.headers to http clients, add more JavaDocs --- .../checkstyle/checkstyle-suppressions.xml | 5 -- .../AadProfileEnvironmentProperties.java | 8 +- .../aad/properties/AadProfileProperties.java | 8 +- ...zureAppConfigurationAutoConfiguration.java | 12 ++- ...dAzureCompatibilityVerifierProperties.java | 27 ++++++- .../context/AzureGlobalProperties.java | 16 +++- ...AzureTokenCredentialAutoConfiguration.java | 8 +- .../cosmos/AzureCosmosAutoConfiguration.java | 12 ++- ...AzureBlobCheckpointStoreConfiguration.java | 4 + .../AzureEventHubsKafkaAutoConfiguration.java | 11 +++ ...tractAzureAmqpConfigurationProperties.java | 4 +- ...tractAzureHttpConfigurationProperties.java | 4 +- .../AmqpClientConfigurationProperties.java | 4 +- .../HttpClientConfigurationProperties.java | 17 ++++- .../AmqpProxyConfigurationProperties.java | 4 +- .../HttpProxyConfigurationProperties.java | 4 +- .../AmqpRetryConfigurationProperties.java | 4 +- .../utils/AzureGlobalPropertiesUtils.java | 25 ++++--- .../jms/ServiceBusJmsAutoConfiguration.java | 10 ++- .../ServiceBusJmsContainerConfiguration.java | 12 +++ .../AzureServiceBusJmsProperties.java | 74 ++++++++++++++++++- ...eKeyVaultCertificateAutoConfiguration.java | 12 ++- .../AzureKeyVaultSecretAutoConfiguration.java | 12 ++- ...okenCredentialConfigurationProperties.java | 38 +++++++++- .../client/ClientConfigurationProperties.java | 21 ++---- .../HttpLoggingConfigurationProperties.java | 16 +++- .../AzureProfileConfigurationProperties.java | 51 ++++++++----- .../proxy/ProxyConfigurationProperties.java | 24 +++++- .../retry/RetryConfigurationProperties.java | 40 +++++++--- ...tHubsResourceManagerAutoConfiguration.java | 4 + ...ceBusResourceManagerAutoConfiguration.java | 4 + ...torageQueueMessagingAutoConfiguration.java | 10 ++- .../AzureStorageBlobAutoConfiguration.java | 10 +++ ...eStorageBlobResourceAutoConfiguration.java | 4 + ...zureStorageFileShareAutoConfiguration.java | 10 +++ ...ageFileShareResourceAutoConfiguration.java | 4 + .../AzureStorageQueueAutoConfiguration.java | 10 +++ .../AzureServiceConfigurationBaseTests.java | 27 ++++++- ...gurationEnvironmentPostProcessorTests.java | 4 +- ...lobalPropertiesAutoConfigurationTests.java | 18 ++--- ...eEventHubsKafkaAutoConfigurationTests.java | 2 +- ...AzureServiceBusAutoConfigurationTests.java | 4 +- ....java => AzureProfileOptionsProvider.java} | 6 +- ...sAware.java => ClientOptionsProvider.java} | 22 +++--- ...e.java => HttpLoggingOptionsProvider.java} | 6 +- ...nsAware.java => ProxyOptionsProvider.java} | 10 +-- ...nsAware.java => RetryOptionsProvider.java} | 8 +- ...va => TokenCredentialOptionsProvider.java} | 6 +- .../AzureAmqpProxyOptionsConverter.java | 12 +-- .../AzureAmqpRetryOptionsConverter.java | 10 +-- .../AzureHttpLogOptionsConverter.java | 8 +- .../AzureHttpProxyOptionsConverter.java | 18 ++--- .../AzureHttpRetryOptionsConverter.java | 14 ++-- .../AzureTokenCredentialResolver.java | 4 +- ...AbstractAzureAmqpClientBuilderFactory.java | 26 +++---- ...AbstractAzureHttpClientBuilderFactory.java | 48 +++++++----- ...tractAzureServiceClientBuilderFactory.java | 6 +- ...AbstractAzureCredentialBuilderFactory.java | 8 +- .../AzureAadCredentialBuilderFactory.java | 4 +- ...ntCertificateCredentialBuilderFactory.java | 4 +- .../ClientSecretCredentialBuilderFactory.java | 4 +- .../DefaultAzureCredentialBuilderFactory.java | 4 +- ...nagedIdentityCredentialBuilderFactory.java | 4 +- ...rnamePasswordCredentialBuilderFactory.java | 4 +- .../properties/AzureAmqpSdkProperties.java | 4 +- .../properties/AzureHttpSdkProperties.java | 4 +- .../util/AzurePropertiesUtils.java | 20 ++--- .../core/properties/AzureProperties.java | 12 +-- .../TokenCredentialProperties.java | 39 +++------- .../client/AmqpClientProperties.java | 4 +- .../properties/client/ClientProperties.java | 24 +----- .../client/HttpClientProperties.java | 19 ++++- .../client/HttpLoggingProperties.java | 24 ++---- .../profile/AzureEnvironmentProperties.java | 4 +- ...r.java => AzureProfileOptionsAdapter.java} | 16 ++-- .../profile/AzureProfileProperties.java | 28 ++----- .../properties/proxy/AmqpProxyProperties.java | 4 +- .../properties/proxy/HttpProxyProperties.java | 4 +- .../properties/proxy/ProxyProperties.java | 4 +- .../properties/retry/AmqpRetryProperties.java | 4 +- .../properties/retry/RetryProperties.java | 30 +++----- .../cloud/core/service/AzureServiceType.java | 34 +++++++-- ...AzureServiceClientBuilderFactoryTests.java | 4 +- .../AzureAmqpRetryOptionsConverterTests.java | 8 +- .../AzureHttpRetryOptionsConverterTests.java | 6 +- .../core/util/AzurePropertiesUtilsTests.java | 12 +-- .../ConfigurationClientProperties.java | 4 +- .../cosmos/CosmosClientBuilderFactory.java | 4 +- .../EventHubClientCommonProperties.java | 4 +- .../keyvault/KeyVaultProperties.java | 4 +- .../ServiceBusClientCommonProperties.java | 4 +- .../AzureStorageRetryOptionsConverter.java | 2 +- ...tractAzureStorageClientBuilderFactory.java | 8 +- .../storage/common/StorageProperties.java | 4 +- .../storage/common/StorageRetry.java | 4 +- .../credential/AzureGlobalTestProperties.java | 4 +- ...zureStorageRetryOptionsConverterTests.java | 6 +- .../config/EnableAzureMessagingTests.java | 2 - 98 files changed, 755 insertions(+), 437 deletions(-) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/{AzureProfileOptionsAware.java => AzureProfileOptionsProvider.java} (98%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/{ClientOptionsAware.java => ClientOptionsProvider.java} (90%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/{HttpLoggingOptionsAware.java => HttpLoggingOptionsProvider.java} (93%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/{ProxyOptionsAware.java => ProxyOptionsProvider.java} (88%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/{RetryOptionsAware.java => RetryOptionsProvider.java} (90%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/{TokenCredentialOptionsAware.java => TokenCredentialOptionsProvider.java} (91%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/{AzureProfileAdapter.java => AzureProfileOptionsAdapter.java} (71%) diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 3a6eaca8b5ca8..4ffe2b32d8a8c 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -399,22 +399,17 @@ the main ServiceBusClientBuilder. --> - - - - - diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java index 6f4095d7b759d..81425717978ae 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java @@ -4,8 +4,8 @@ package com.azure.spring.cloud.autoconfigure.aad.properties; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; -import com.azure.spring.cloud.core.properties.profile.AzureProfileAdapter; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.properties.profile.AzureProfileOptionsAdapter; /** * Properties to Azure Active Directory endpoints. @@ -57,8 +57,8 @@ public void setMicrosoftGraphEndpoint(String microsoftGraphEndpoint) { * * @param cloudType The cloud type. */ - public void updatePropertiesByCloudType(AzureProfileOptionsAware.CloudType cloudType) { - AzureEnvironment knownAzureEnvironment = AzureProfileAdapter.decideManagementAzureEnvironment(cloudType, AzureEnvironment.AZURE); + public void updatePropertiesByCloudType(AzureProfileOptionsProvider.CloudType cloudType) { + AzureEnvironment knownAzureEnvironment = AzureProfileOptionsAdapter.decideManagementAzureEnvironment(cloudType, AzureEnvironment.AZURE); if (this.activeDirectoryEndpoint == null) { this.activeDirectoryEndpoint = knownAzureEnvironment.getActiveDirectoryEndpoint(); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java index 8255f28504534..ac005504dfff6 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.aad.properties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; @@ -21,7 +21,7 @@ public class AadProfileProperties { * Name of the Azure cloud to connect to. * Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. */ - private AzureProfileOptionsAware.CloudType cloudType; + private AzureProfileOptionsProvider.CloudType cloudType; /** * Properties to Azure Active Directory endpoints. */ @@ -48,7 +48,7 @@ public void setTenantId(String tenantId) { * * @return The cloud type. */ - public AzureProfileOptionsAware.CloudType getCloudType() { + public AzureProfileOptionsProvider.CloudType getCloudType() { return cloudType; } @@ -56,7 +56,7 @@ public AzureProfileOptionsAware.CloudType getCloudType() { * * @param cloudType The cloud type. */ - public void setCloudType(AzureProfileOptionsAware.CloudType cloudType) { + public void setCloudType(AzureProfileOptionsProvider.CloudType cloudType) { this.cloudType = cloudType; environment.updatePropertiesByCloudType(cloudType); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java index 72d3706b77357..f3b642bb867f7 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java @@ -7,9 +7,9 @@ import com.azure.data.appconfiguration.ConfigurationClient; import com.azure.data.appconfiguration.ConfigurationClientBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; -import com.azure.spring.cloud.autoconfigure.implementation.appconfiguration.AzureAppConfigurationProperties; import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; +import com.azure.spring.cloud.autoconfigure.implementation.appconfiguration.AzureAppConfigurationProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; @@ -41,12 +41,22 @@ AzureAppConfigurationProperties azureAppConfigurationProperties() { return loadProperties(this.azureGlobalProperties, new AzureAppConfigurationProperties()); } + /** + * Autoconfigure the {@link ConfigurationClient} instance. + * @param builder The {@link ConfigurationClientBuilder} to build the instance. + * @return the configuration client instance. + */ @Bean @ConditionalOnMissingBean public ConfigurationClient azureConfigurationClient(ConfigurationClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link ConfigurationAsyncClient} instance. + * @param builder The {@link ConfigurationClientBuilder} to build the instance. + * @return the configuration async client instance. + */ @Bean @ConditionalOnMissingBean public ConfigurationAsyncClient azureConfigurationAsyncClient(ConfigurationClientBuilder builder) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java index 26b716c6dc5be..d97a9d3884ef5 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java @@ -4,6 +4,7 @@ package com.azure.spring.cloud.autoconfigure.compatibility; import org.springframework.boot.context.properties.ConfigurationProperties; + import java.util.Arrays; import java.util.List; @@ -12,24 +13,44 @@ */ @ConfigurationProperties("spring.cloud.azure.compatibility-verifier") public class SpringCloudAzureCompatibilityVerifierProperties { + + /** + * Whether to enable the Spring Cloud Azure compatibility verifier. + */ private boolean enabled; + /** + * Comma-delimited list of compatible Spring Boot versions. + */ private List compatibleBootVersions = Arrays.asList("2.5.x", "2.6.x"); - public SpringCloudAzureCompatibilityVerifierProperties() { - } - + /** + * Whether to enable the Spring Cloud Azure compatibility verifier. + * @return whether to enable the Spring Cloud Azure compatibility verifier. + */ public boolean isEnabled() { return this.enabled; } + /** + * Set whether to enable the Spring Cloud Azure compatibility verifier. + * @param enabled whether to enable the Spring Cloud Azure compatibility verifier. + */ public void setEnabled(boolean enabled) { this.enabled = enabled; } + /** + * Get the list of compatible Spring Boot versions. + * @return the compatible Spring Boot versions. + */ public List getCompatibleBootVersions() { return this.compatibleBootVersions; } + /** + * Set the list of compatible Spring Boot versions. + * @param compatibleBootVersions the compatible Spring Boot versions. + */ public void setCompatibleBootVersions(List compatibleBootVersions) { this.compatibleBootVersions = compatibleBootVersions; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java index a077e26295088..d4fbedd3df62f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java @@ -10,18 +10,21 @@ import com.azure.spring.cloud.autoconfigure.properties.core.profile.AzureProfileConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.properties.client.HeaderProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; import java.time.Duration; +import java.util.ArrayList; +import java.util.List; /** * */ @ConfigurationProperties(prefix = AzureGlobalProperties.PREFIX) -public class AzureGlobalProperties implements AzureProperties, RetryOptionsAware { +public class AzureGlobalProperties implements AzureProperties, RetryOptionsProvider { public static final String PREFIX = "spring.cloud.azure"; @@ -198,6 +201,11 @@ public static final class GlobalHttpClientConfigurationProperties { */ private Duration connectionIdleTimeout; + /** + * Comma-delimited list of headers applied to each request sent with client. + */ + private final List headers = new ArrayList<>(); + @NestedConfigurationProperty private final HttpLoggingConfigurationProperties logging = new HttpLoggingConfigurationProperties(); @@ -249,6 +257,10 @@ public void setConnectionIdleTimeout(Duration connectionIdleTimeout) { this.connectionIdleTimeout = connectionIdleTimeout; } + public List getHeaders() { + return headers; + } + public HttpLoggingConfigurationProperties getLogging() { return logging; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java index 034434c3aa9bb..bfdf54da2b4f5 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java @@ -11,7 +11,7 @@ import com.azure.identity.UsernamePasswordCredentialBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.AbstractAzureHttpConfigurationProperties; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureTokenCredentialResolver; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureServiceClientBuilderFactory; @@ -82,7 +82,7 @@ AzureTokenCredentialResolver azureTokenCredentialResolver( return null; } - final TokenCredentialOptionsAware.TokenCredential properties = azureProperties.getCredential(); + final TokenCredentialOptionsProvider.TokenCredentialOptions properties = azureProperties.getCredential(); final String tenantId = azureProperties.getProfile().getTenantId(); final String clientId = properties.getClientId(); final boolean isClientIdSet = StringUtils.hasText(clientId); @@ -187,6 +187,10 @@ UsernamePasswordCredentialBuilderFactory usernamePasswordCredentialBuilderFactor return factory; } + /** + * The BeanPostProcessor to apply the default token credential to all service client builder factories. + * @return the BPP. + */ @Bean public static AzureServiceClientBuilderFactoryPostProcessor builderFactoryBeanPostProcessor() { return new AzureServiceClientBuilderFactoryPostProcessor(); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/cosmos/AzureCosmosAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/cosmos/AzureCosmosAutoConfiguration.java index a762a01b7258b..294b13b9483d0 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/cosmos/AzureCosmosAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/cosmos/AzureCosmosAutoConfiguration.java @@ -8,8 +8,8 @@ import com.azure.cosmos.CosmosClientBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; -import com.azure.spring.cloud.autoconfigure.implementation.cosmos.properties.AzureCosmosProperties; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; +import com.azure.spring.cloud.autoconfigure.implementation.cosmos.properties.AzureCosmosProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.service.implementation.cosmos.CosmosClientBuilderFactory; @@ -38,12 +38,22 @@ AzureCosmosProperties azureCosmosProperties() { return loadProperties(this.azureGlobalProperties, new AzureCosmosProperties()); } + /** + * Autoconfigure the {@link CosmosClient} instance. + * @param builder the {@link CosmosClientBuilder} to build the instance. + * @return the cosmos client instance. + */ @Bean @ConditionalOnMissingBean public CosmosClient azureCosmosClient(CosmosClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link CosmosAsyncClient} instance. + * @param builder the {@link CosmosClientBuilder} to build the instance. + * @return the cosmos async client instance. + */ @Bean @ConditionalOnMissingBean // TODO (xiada): spring data cosmos also defines a CosmosAsyncClient diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureBlobCheckpointStoreConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureBlobCheckpointStoreConfiguration.java index a44f61d9ee55c..374ce145c29e9 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureBlobCheckpointStoreConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureBlobCheckpointStoreConfiguration.java @@ -53,6 +53,10 @@ BlobCheckpointStore blobCheckpointStore( return new BlobCheckpointStore(blobContainerAsyncClient); } + /** + * The default {@link BlobCheckpointStoreContainerInitializer} to create the storage blob if not exists. + * @return the default {@link BlobCheckpointStoreContainerInitializer}. + */ @Bean @ConditionalOnProperty(value = "spring.cloud.azure.eventhubs.processor.checkpoint-store.create-container-if-not-exists", havingValue = "true") public BlobCheckpointStoreContainerInitializer blobCheckpointStoreContainerCreationInitializer() { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java index 42c27935442fc..678ae83411ee4 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java @@ -40,6 +40,11 @@ public class AzureEventHubsKafkaAutoConfiguration { private static final Logger LOGGER = LoggerFactory.getLogger(AzureEventHubsKafkaAutoConfiguration.class); private static final String SASL_CONFIG_VALUE = "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"$ConnectionString\" password=\"%s\";%s"; + /** + * The static connection string provider to provide the connection string for an Event Hubs instance. + * @param environment the Spring environment. + * @return the connection string provider. + */ @Bean @ConditionalOnProperty("spring.cloud.azure.eventhubs.connection-string") @ConditionalOnMissingBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ConnectionStringProvider.class) @@ -56,6 +61,12 @@ public StaticConnectionStringProvider eventHubsKafka return new StaticConnectionStringProvider<>(AzureServiceType.EVENT_HUBS, connectionString); } + /** + * The Azure {@link KafkaProperties} instance will be created if an Azure Event Hubs connection string is provided + * and the Kafka dependency is detected from the classpath. + * @param connectionStringProvider the Azure Event Hubs connection string provider. + * @return the {@link KafkaProperties} with an Azure Event Hubs connection information. + */ @Primary @Bean @ConditionalOnBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ConnectionStringProvider.class) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java index 4da8b83e0fa13..fbe3cb2fb27c3 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java @@ -6,14 +6,14 @@ import com.azure.spring.cloud.autoconfigure.implementation.properties.core.client.AmqpClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy.AmqpProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.retry.AmqpRetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Configuration properties base class for all AMQP-based Azure Service clients. */ public abstract class AbstractAzureAmqpConfigurationProperties extends AbstractAzureServiceConfigurationProperties - implements RetryOptionsAware { + implements RetryOptionsProvider { @NestedConfigurationProperty protected final AmqpClientConfigurationProperties client = new AmqpClientConfigurationProperties(); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java index f8a5494a530a9..6458872c0362c 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java @@ -6,14 +6,14 @@ import com.azure.spring.cloud.autoconfigure.implementation.properties.core.client.HttpClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy.HttpProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Configuration properties base class for all HTTP-based Azure Service clients. */ public abstract class AbstractAzureHttpConfigurationProperties extends AbstractAzureServiceConfigurationProperties - implements RetryOptionsAware { + implements RetryOptionsProvider { @NestedConfigurationProperty protected final HttpClientConfigurationProperties client = new HttpClientConfigurationProperties(); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java index 957d4e44fc1df..7e242f76334ad 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java @@ -5,12 +5,12 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.spring.cloud.autoconfigure.properties.core.client.ClientConfigurationProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; /** * */ -public class AmqpClientConfigurationProperties extends ClientConfigurationProperties implements ClientOptionsAware.AmqpClient { +public class AmqpClientConfigurationProperties extends ClientConfigurationProperties implements ClientOptionsProvider.AmqpClientOptions { /** * Transport type for AMQP-based client. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java index 6d49e65c731ad..90c71ea6435e8 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java @@ -5,15 +5,18 @@ import com.azure.spring.cloud.autoconfigure.properties.core.client.ClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.client.HttpLoggingConfigurationProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.properties.client.HeaderProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; import java.time.Duration; +import java.util.ArrayList; +import java.util.List; /** * */ -public class HttpClientConfigurationProperties extends ClientConfigurationProperties implements ClientOptionsAware.HttpClient { +public class HttpClientConfigurationProperties extends ClientConfigurationProperties implements ClientOptionsProvider.HttpClientOptions { /** * Amount of time each request being sent over the wire. @@ -40,6 +43,11 @@ public class HttpClientConfigurationProperties extends ClientConfigurationProper */ private Duration connectionIdleTimeout; + /** + * Comma-delimited list of headers applied to each request sent with client. + */ + private final List headers = new ArrayList<>(); + @NestedConfigurationProperty private final HttpLoggingConfigurationProperties logging = new HttpLoggingConfigurationProperties(); @@ -94,6 +102,11 @@ public void setConnectionIdleTimeout(Duration connectionIdleTimeout) { this.connectionIdleTimeout = connectionIdleTimeout; } + @Override + public List getHeaders() { + return headers; + } + @Override public HttpLoggingConfigurationProperties getLogging() { return logging; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java index 8d2ea0739eb79..a7db424c94b39 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java @@ -5,13 +5,13 @@ import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Proxy properties for all Azure AMQP SDKs. */ public class AmqpProxyConfigurationProperties extends ProxyConfigurationProperties - implements ProxyOptionsAware.AmqpProxy { + implements ProxyOptionsProvider.AmqpProxyOptions { /** * Authentication type used against the proxy. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java index 8cbf6bfc00929..e2ae1df1814a6 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java @@ -4,13 +4,13 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy; import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Proxy properties for all Azure HTTP SDKs. */ public class HttpProxyConfigurationProperties extends ProxyConfigurationProperties - implements ProxyOptionsAware.HttpProxy { + implements ProxyOptionsProvider.HttpProxyOptions { /** * A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java index 826da3c21a970..d4f1f4e6e91da 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java @@ -4,14 +4,14 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.core.retry; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import java.time.Duration; /** * Amqp based client related retry properties. */ -public class AmqpRetryConfigurationProperties extends RetryConfigurationProperties implements RetryOptionsAware.AmqpRetry { +public class AmqpRetryConfigurationProperties extends RetryConfigurationProperties implements RetryOptionsProvider.AmqpRetryOptions { /** * Amount of time to wait until a timeout. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java index 510e0274b3fc3..36bd0c5363f2a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.utils; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.beans.BeanUtils; @@ -33,26 +33,29 @@ private AzureGlobalPropertiesUtils() { public static T loadProperties(AzureGlobalProperties source, T target) { AzurePropertiesUtils.copyAzureCommonProperties(source, target); - if (target.getClient() instanceof ClientOptionsAware.HttpClient) { + if (target.getClient() instanceof ClientOptionsProvider.HttpClientOptions) { BeanUtils.copyProperties(source.getClient().getHttp(), target.getClient()); - ClientOptionsAware.HttpClient targetClient = (ClientOptionsAware.HttpClient) target.getClient(); + ClientOptionsProvider.HttpClientOptions targetClient = (ClientOptionsProvider.HttpClientOptions) target.getClient(); + + targetClient.getHeaders().addAll(source.getClient().getHttp().getHeaders()); + BeanUtils.copyProperties(source.getClient().getHttp().getLogging(), targetClient.getLogging()); targetClient.getLogging().getAllowedHeaderNames().addAll(source.getClient().getHttp().getLogging().getAllowedHeaderNames()); targetClient.getLogging().getAllowedQueryParamNames().addAll(source.getClient().getHttp().getLogging().getAllowedQueryParamNames()); - } else if (target.getClient() instanceof ClientOptionsAware.AmqpClient) { + } else if (target.getClient() instanceof ClientOptionsProvider.AmqpClientOptions) { BeanUtils.copyProperties(source.getClient().getAmqp(), target.getClient()); } - if (target.getProxy() instanceof ProxyOptionsAware.HttpProxy) { + if (target.getProxy() instanceof ProxyOptionsProvider.HttpProxyOptions) { BeanUtils.copyProperties(source.getProxy().getHttp(), target.getProxy()); - } else if (target.getProxy() instanceof ProxyOptionsAware.AmqpProxy) { + } else if (target.getProxy() instanceof ProxyOptionsProvider.AmqpProxyOptions) { BeanUtils.copyProperties(source.getProxy().getAmqp(), target.getProxy()); } - if (target instanceof RetryOptionsAware) { - RetryOptionsAware.Retry retry = ((RetryOptionsAware) target).getRetry(); - if (retry instanceof RetryOptionsAware.AmqpRetry) { + if (target instanceof RetryOptionsProvider) { + RetryOptionsProvider.RetryOptions retry = ((RetryOptionsProvider) target).getRetry(); + if (retry instanceof RetryOptionsProvider.AmqpRetryOptions) { BeanUtils.copyProperties(source.getRetry().getAmqp(), retry); } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java index 1963a7e350eb2..6414e0d776461 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java @@ -43,6 +43,7 @@ @EnableConfigurationProperties({ AzureServiceBusJmsProperties.class, JmsProperties.class }) @Import({ ServiceBusJmsConnectionFactoryConfiguration.class, ServiceBusJmsContainerConfiguration.class }) public class ServiceBusJmsAutoConfiguration { + @Bean @ConditionalOnExpression("'premium'.equalsIgnoreCase('${spring.jms.servicebus.pricing-tier}')") ServiceBusJmsConnectionFactoryCustomizer amqpOpenPropertiesCustomizer() { @@ -56,10 +57,17 @@ ServiceBusJmsConnectionFactoryCustomizer amqpOpenPropertiesCustomizer() { }; } + /** + * The BeanPostProcessor to instrument the {@link AzureServiceBusJmsProperties} bean with provided connection string + * providers. + * @param connectionStringProviders the connection string providers to provide the Service Bus connection string. + * @return the bean post processor. + */ @Bean @ConditionalOnMissingBean @ConditionalOnMissingProperty(prefix = "spring.jms.servicebus", name = "connection-string") - public static AzureServiceBusJmsPropertiesBeanPostProcessor azureServiceBusJmsPropertiesBeanPostProcessor(ObjectProvider> connectionStringProviders) { + public static AzureServiceBusJmsPropertiesBeanPostProcessor azureServiceBusJmsPropertiesBeanPostProcessor( + ObjectProvider> connectionStringProviders) { return new AzureServiceBusJmsPropertiesBeanPostProcessor(connectionStringProviders); } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java index 6c22240cb5fed..25e87d98ddadd 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java @@ -36,6 +36,12 @@ public ServiceBusJmsContainerConfiguration(AzureServiceBusJmsProperties azureSer this.azureServiceBusJMSProperties = azureServiceBusJMSProperties; } + /** + * Autoconfigure the {@link JmsListenerContainerFactory} for Service Bus queues. + * @param configurer the configurer to configure the container factory. + * @param connectionFactory the connection factory for the container factory. + * @return the jms listener container factory for service bus queues. + */ @Bean @ConditionalOnMissingBean public JmsListenerContainerFactory jmsListenerContainerFactory( @@ -47,6 +53,12 @@ public JmsListenerContainerFactory jmsListenerContainerFactory( return jmsListenerContainerFactory; } + /** + * Autoconfigure the {@link JmsListenerContainerFactory} for Service Bus topics. + * @param configurer the configurer to configure the container factory. + * @param connectionFactory the connection factory for the container factory. + * @return the jms listener container factory for Service Bus topics. + */ @Bean @ConditionalOnMissingBean(name = "topicJmsListenerContainerFactory") public JmsListenerContainerFactory topicJmsListenerContainerFactory( diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java index 1a77e91a0cb0d..d06328c3ae781 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java @@ -25,11 +25,11 @@ public class AzureServiceBusJmsProperties implements InitializingBean { private static final String AMQP_URI_FORMAT = "amqps://%s?amqp.idleTimeout=%d"; /** - * Connection string to connect to service bus. + * Connection string to connect to a service bus. */ private String connectionString; /** - * Service bus topic client ID. Only works for the bean of topicJmsListenerContainerFactory. + * Service Bus topic client ID. Only works for the bean of topicJmsListenerContainerFactory. */ private String topicClientId; /** @@ -37,7 +37,7 @@ public class AzureServiceBusJmsProperties implements InitializingBean { */ private Duration idleTimeout = Duration.ofMinutes(30); /** - * Pricing tier for service bus namespace. + * Pricing tier for a Service Bus namespace. */ private String pricingTier; @@ -65,70 +65,138 @@ public class AzureServiceBusJmsProperties implements InitializingBean { */ private String password; + /** + * Get the URL of the AMQP broker. + * @return the URL of the AMQP broker. + */ public String getRemoteUrl() { return remoteUrl; } + /** + * Set the URL of the AMQP broker. + * @param remoteUrl the URL of the AMQP broker. + */ public void setRemoteUrl(String remoteUrl) { this.remoteUrl = remoteUrl; } + /** + * Get the login user of the AMQP broker. + * @return the login user of the AMQP broker. + */ public String getUsername() { return username; } + /** + * Set the login user of the AMQP broker. + * @param username the login user of the AMQP broker. + */ public void setUsername(String username) { this.username = username; } + /** + * Get the login password of the AMQP broker. + * @return the login password of the AMQP broker. + */ public String getPassword() { return password; } + /** + * Set the login password of the AMQP broker. + * @param password the login password of the AMQP broker. + */ public void setPassword(String password) { this.password = password; } + /** + * The properties for a pooled connection factory. + * @return the properties for a pooled connection factory. + */ public JmsPoolConnectionFactoryProperties getPool() { return pool; } + /** + * Get the connection string to connect to a service bus. + * @return the connection string to connect to a service bus. + */ public String getConnectionString() { return connectionString; } + /** + * Set the connection string to connect to a service bus. + * @param connectionString the connection string to connect to a service bus. + */ public void setConnectionString(String connectionString) { this.connectionString = connectionString; } + /** + * Get the Service bus topic client ID. + * @return the Service bus topic client ID. + */ public String getTopicClientId() { return topicClientId; } + /** + * Set the Service bus topic client ID. + * @param topicClientId the Service bus topic client ID. + */ public void setTopicClientId(String topicClientId) { this.topicClientId = topicClientId; } + /** + * Get the pricing tier for a service bus namespace. + * @return the pricing tier for a service bus namespace. + */ public String getPricingTier() { return this.pricingTier; } + /** + * Set the pricing tier for a service bus namespace. + * @param pricingTier the pricing tier for a service bus namespace. + */ public void setPricingTier(String pricingTier) { this.pricingTier = pricingTier; } + /** + * Get the connection idle timeout duration. + * @return the connection idle timeout duration. + */ public Duration getIdleTimeout() { return idleTimeout; } + /** + * Set the connection idle timeout duration. + * @param idleTimeout the connection idle timeout duration. + */ public void setIdleTimeout(Duration idleTimeout) { this.idleTimeout = idleTimeout; } + /** + * Get the listener related properties. + * @return the listener related properties. + */ public Listener getListener() { return listener; } + /** + * Get the prefetch policy related properties. + * @return the prefetch policy related properties. + */ public PrefetchPolicy getPrefetchPolicy() { return prefetchPolicy; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/certificates/AzureKeyVaultCertificateAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/certificates/AzureKeyVaultCertificateAutoConfiguration.java index 6e40f3dbc7674..5e70672313ba8 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/certificates/AzureKeyVaultCertificateAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/certificates/AzureKeyVaultCertificateAutoConfiguration.java @@ -7,8 +7,8 @@ import com.azure.security.keyvault.certificates.CertificateClient; import com.azure.security.keyvault.certificates.CertificateClientBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; -import com.azure.spring.cloud.autoconfigure.implementation.keyvault.certificates.properties.AzureKeyVaultCertificateProperties; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; +import com.azure.spring.cloud.autoconfigure.implementation.keyvault.certificates.properties.AzureKeyVaultCertificateProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.service.implementation.keyvault.certificates.CertificateClientBuilderFactory; @@ -41,12 +41,22 @@ AzureKeyVaultCertificateProperties azureKeyVaultCertificateProperties() { return loadProperties(this.azureGlobalProperties, new AzureKeyVaultCertificateProperties()); } + /** + * Autoconfigure the {@link CertificateClient} instance. + * @param builder the {@link CertificateClientBuilder} to build the instance. + * @return the certificate client instance. + */ @Bean @ConditionalOnMissingBean public CertificateClient azureKeyVaultCertificateClient(CertificateClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link CertificateAsyncClient} instance. + * @param builder the {@link CertificateClientBuilder} to build the instance. + * @return the certificate async client instance. + */ @Bean @ConditionalOnMissingBean public CertificateAsyncClient azureKeyVaultCertificateAsyncClient(CertificateClientBuilder builder) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/secrets/AzureKeyVaultSecretAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/secrets/AzureKeyVaultSecretAutoConfiguration.java index 069fa0fb04155..c3650040d5215 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/secrets/AzureKeyVaultSecretAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/keyvault/secrets/AzureKeyVaultSecretAutoConfiguration.java @@ -8,8 +8,8 @@ import com.azure.security.keyvault.secrets.SecretClientBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; -import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; +import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.service.implementation.keyvault.secrets.SecretClientBuilderFactory; @@ -41,12 +41,22 @@ AzureKeyVaultSecretProperties azureKeyVaultSecretProperties() { return loadProperties(this.azureGlobalProperties, new AzureKeyVaultSecretProperties()); } + /** + * Autoconfigure the {@link SecretClient} instance. + * @param builder the {@link SecretClientBuilder} to build the instance. + * @return the secret client instance. + */ @Bean @ConditionalOnMissingBean public SecretClient azureKeyVaultSecretClient(SecretClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link SecretAsyncClient} instance. + * @param builder the {@link SecretClientBuilder} to build the instance. + * @return the secret async client instance. + */ @Bean @ConditionalOnMissingBean public SecretAsyncClient azureKeyVaultSecretAsyncClient(SecretClientBuilder builder) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java index a1d6844b7d4db..e586a5bcf16a2 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java @@ -4,12 +4,12 @@ package com.azure.spring.cloud.autoconfigure.properties.core.authentication; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; /** * Azure properties used for getting token credential. */ -public class TokenCredentialConfigurationProperties implements TokenCredentialOptionsAware.TokenCredential { +public class TokenCredentialConfigurationProperties implements TokenCredentialOptionsProvider.TokenCredentialOptions { /** * Client id to use when performing service principal authentication with Azure. @@ -47,50 +47,80 @@ public class TokenCredentialConfigurationProperties implements TokenCredentialOp */ private boolean managedIdentityEnabled = false; + @Override public String getClientId() { return clientId; } + /** + * Set the client id. + * @param clientId The client id. + */ public void setClientId(String clientId) { this.clientId = clientId; } + @Override public String getClientSecret() { return clientSecret; } + /** + * Set the client secret. + * @param clientSecret The client secret. + */ public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } + @Override public String getClientCertificatePath() { return clientCertificatePath; } + /** + * Set the client certificate path. + * @param clientCertificatePath The client certificate path. + */ public void setClientCertificatePath(String clientCertificatePath) { this.clientCertificatePath = clientCertificatePath; } + @Override public String getClientCertificatePassword() { return clientCertificatePassword; } + /** + * Set the client certificate password. + * @param clientCertificatePassword The client certificate password. + */ public void setClientCertificatePassword(String clientCertificatePassword) { this.clientCertificatePassword = clientCertificatePassword; } + @Override public String getUsername() { return username; } + /** + * Set the username. + * @param username The username. + */ public void setUsername(String username) { this.username = username; } + @Override public String getPassword() { return password; } + /** + * Set the password. + * @param password The password. + */ public void setPassword(String password) { this.password = password; } @@ -100,6 +130,10 @@ public boolean isManagedIdentityEnabled() { return managedIdentityEnabled; } + /** + * Whether to enable managed identity. + * @param managedIdentityEnabled whether managed identity is enabled. + */ public void setManagedIdentityEnabled(boolean managedIdentityEnabled) { this.managedIdentityEnabled = managedIdentityEnabled; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java index f7b8a2599a4b8..9beeaf95e1249 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java @@ -3,38 +3,29 @@ package com.azure.spring.cloud.autoconfigure.properties.core.client; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.properties.client.HeaderProperties; - -import java.util.ArrayList; -import java.util.List; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; /** * */ -public class ClientConfigurationProperties implements ClientOptionsAware.Client { +public class ClientConfigurationProperties implements ClientOptionsProvider.ClientOptions { /** * Represents current application and is used for telemetry/monitoring purposes. */ private String applicationId; - /** - * Comma-delimited list of headers applied to each request sent with client. - */ - private final List headers = new ArrayList<>(); @Override public String getApplicationId() { return applicationId; } + /** + * Set the application id. + * @param applicationId The application id. + */ public void setApplicationId(String applicationId) { this.applicationId = applicationId; } - @Override - public List getHeaders() { - return headers; - } - } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java index 2e08ca01743fe..db206b1e8ae24 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.client; import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsAware; +import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; import java.util.HashSet; import java.util.Set; @@ -13,7 +13,7 @@ * Options related to http logging. For example, if you want to log the http request or response, you could set the * * level to {@link HttpLogDetailLevel#BASIC} or some other levels. */ -public class HttpLoggingConfigurationProperties implements HttpLoggingOptionsAware.HttpLogging { +public class HttpLoggingConfigurationProperties implements HttpLoggingOptionsProvider.HttpLoggingOptions { /** * The level of detail to log on HTTP messages. @@ -32,26 +32,38 @@ public class HttpLoggingConfigurationProperties implements HttpLoggingOptionsAwa */ private Boolean prettyPrintBody; + @Override public HttpLogDetailLevel getLevel() { return level; } + /** + * Set the logging detail level. + * @param level The logging detail level. + */ public void setLevel(HttpLogDetailLevel level) { this.level = level; } + @Override public Set getAllowedHeaderNames() { return allowedHeaderNames; } + @Override public Set getAllowedQueryParamNames() { return allowedQueryParamNames; } + @Override public Boolean getPrettyPrintBody() { return prettyPrintBody; } + /** + * Set whether to pretty print body. + * @param prettyPrintBody Whether to pretty print body. + */ public void setPrettyPrintBody(Boolean prettyPrintBody) { this.prettyPrintBody = prettyPrintBody; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java index e814122869dc9..f32af739862e2 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java @@ -4,13 +4,13 @@ package com.azure.spring.cloud.autoconfigure.properties.core.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; -import com.azure.spring.cloud.core.properties.profile.AzureProfileAdapter; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.properties.profile.AzureProfileOptionsAdapter; /** * The AzureProfile defines the properties related to an Azure subscription. */ -public class AzureProfileConfigurationProperties extends AzureProfileAdapter { +public class AzureProfileConfigurationProperties extends AzureProfileOptionsAdapter { /** * Tenant id for Azure resources. @@ -23,38 +23,53 @@ public class AzureProfileConfigurationProperties extends AzureProfileAdapter { /** * Name of the Azure cloud to connect to. */ - private AzureProfileOptionsAware.CloudType cloudType = AzureProfileOptionsAware.CloudType.AZURE; + private AzureProfileOptionsProvider.CloudType cloudType = AzureProfileOptionsProvider.CloudType.AZURE; private final AzureEnvironmentConfigurationProperties environment = new AzureEnvironmentConfigurationProperties(AzureEnvironment.AZURE); + @Override + public AzureProfileOptionsProvider.CloudType getCloudType() { + return cloudType; + } + + /** + * Set the cloud type. + * @param cloudType the cloud type. + */ + public void setCloudType(AzureProfileOptionsProvider.CloudType cloudType) { + this.cloudType = cloudType; + + // Explicitly call this method to merge default cloud endpoints to the environment object. + changeEnvironmentAccordingToCloud(); + } + + @Override public String getTenantId() { return tenantId; } + /** + * Set the tenant id. + * @param tenantId The tenant id. + */ public void setTenantId(String tenantId) { this.tenantId = tenantId; } + @Override public String getSubscriptionId() { return subscriptionId; } - @Override - public AzureProfileOptionsAware.CloudType getCloudType() { - return cloudType; - } - - public void setCloudType(AzureProfileOptionsAware.CloudType cloudType) { - this.cloudType = cloudType; - - // Explicitly call this method to merge default cloud endpoints to the environment object. - changeEnvironmentAccordingToCloud(); - } - + /** + * Set the subscription id. + * @param subscriptionId The subscription id. + */ public void setSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; } + @Override public AzureEnvironmentConfigurationProperties getEnvironment() { return this.environment; } @@ -62,7 +77,7 @@ public AzureEnvironmentConfigurationProperties getEnvironment() { /** * */ - public static final class AzureEnvironmentConfigurationProperties implements AzureProfileOptionsAware.AzureEnvironment { + public static final class AzureEnvironmentConfigurationProperties implements AzureProfileOptionsProvider.AzureEnvironment { /** * The management portal URL. */ @@ -337,7 +352,7 @@ private AzureEnvironmentConfigurationProperties(com.azure.core.management.AzureE } @Override - public AzureProfileOptionsAware.AzureEnvironment fromAzureManagementEnvironment(AzureEnvironment environment) { + public AzureProfileOptionsProvider.AzureEnvironment fromAzureManagementEnvironment(AzureEnvironment environment) { return new AzureEnvironmentConfigurationProperties(environment); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java index 03bdb8f029727..6e0d3fbebb316 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.autoconfigure.properties.core.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Common proxy properties for all Azure SDKs. */ -public class ProxyConfigurationProperties implements ProxyOptionsAware.Proxy { +public class ProxyConfigurationProperties implements ProxyOptionsProvider.ProxyOptions { /** * Type of the proxy. @@ -36,6 +36,10 @@ public String getType() { return type; } + /** + * Set proxy type. + * @param type The proxy type. + */ public void setType(String type) { this.type = type; } @@ -45,6 +49,10 @@ public String getHostname() { return hostname; } + /** + * Set proxy hostname. + * @param hostname The hostname. + */ public void setHostname(String hostname) { this.hostname = hostname; } @@ -54,6 +62,10 @@ public Integer getPort() { return port; } + /** + * Set port. + * @param port The port of the host. + */ public void setPort(Integer port) { this.port = port; } @@ -63,6 +75,10 @@ public String getUsername() { return username; } + /** + * Set the username used for authentication. + * @param username The username. + */ public void setUsername(String username) { this.username = username; } @@ -72,6 +88,10 @@ public String getPassword() { return password; } + /** + * Set the password for authentication. + * @param password The password. + */ public void setPassword(String password) { this.password = password; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java index 14985d4a18299..0fccde6a0bfdb 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.autoconfigure.properties.core.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import java.time.Duration; /** * Retry properties. */ -public class RetryConfigurationProperties implements RetryOptionsAware.Retry { +public class RetryConfigurationProperties implements RetryOptionsProvider.RetryOptions { /** * The maximum number of attempts. @@ -27,22 +27,43 @@ public class RetryConfigurationProperties implements RetryOptionsAware.Retry { /** * Retry backoff mode. */ - private RetryOptionsAware.RetryMode mode = RetryOptionsAware.RetryMode.EXPONENTIAL; + private RetryOptionsProvider.RetryMode mode = RetryOptionsProvider.RetryMode.EXPONENTIAL; @Override public Integer getMaxRetries() { return maxRetries; } + /** + * Set the maximum number of attempts. + * @param maxRetries the maximum number of attempts. + */ public void setMaxRetries(Integer maxRetries) { this.maxRetries = maxRetries; } + @Override + public RetryOptionsProvider.RetryMode getMode() { + return mode; + } + + /** + * Set the mode for retry backoff. + * @param mode the mode for retry backoff. + */ + public void setMode(RetryOptionsProvider.RetryMode mode) { + this.mode = mode; + } + @Override public Duration getBaseDelay() { return baseDelay; } + /** + * Set the amount of time to wait between retry attempts. + * @param baseDelay The delay to wait between retry attempts. + */ public void setBaseDelay(Duration baseDelay) { this.baseDelay = baseDelay; } @@ -52,16 +73,11 @@ public Duration getMaxDelay() { return maxDelay; } + /** + * Set the maximum permissible amount of time between retry attempts. + * @param maxDelay The maximum permissible amount of time between retry attempts. + */ public void setMaxDelay(Duration maxDelay) { this.maxDelay = maxDelay; } - - @Override - public RetryOptionsAware.RetryMode getMode() { - return mode; - } - - public void setMode(RetryOptionsAware.RetryMode mode) { - this.mode = mode; - } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureEventHubsResourceManagerAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureEventHubsResourceManagerAutoConfiguration.java index edaad37335ae5..84277c210598e 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureEventHubsResourceManagerAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureEventHubsResourceManagerAutoConfiguration.java @@ -51,6 +51,10 @@ EventHubsArmConnectionStringProvider eventHubsArmConnectionStringProvider() { resourceMetadata.getName()); } + /** + * Autoconfigure the {@link EventHubsProvisioner} instance. + * @return the Event Hubs provisioner. + */ @Bean @ConditionalOnMissingBean public EventHubsProvisioner eventHubsProvisioner() { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureServiceBusResourceManagerAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureServiceBusResourceManagerAutoConfiguration.java index 32dac19edf922..d171a9d7419a7 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureServiceBusResourceManagerAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/resourcemanager/AzureServiceBusResourceManagerAutoConfiguration.java @@ -41,6 +41,10 @@ public class AzureServiceBusResourceManagerAutoConfiguration extends AzureServic this.resourceMetadata = resourceMetadata; } + /** + * Autoconfigure the {@link ServiceBusProvisioner} instance. + * @return the Service Bus provisioner. + */ @Bean @ConditionalOnMissingBean public ServiceBusProvisioner serviceBusProvisioner() { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/AzureStorageQueueMessagingAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/AzureStorageQueueMessagingAutoConfiguration.java index 5d6d3dd7f06d0..7cae35412a0aa 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/AzureStorageQueueMessagingAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/AzureStorageQueueMessagingAutoConfiguration.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.autoconfigure.storage; -import com.azure.spring.cloud.autoconfigure.storage.queue.AzureStorageQueueAutoConfiguration; import com.azure.spring.cloud.autoconfigure.implementation.storage.queue.properties.AzureStorageQueueProperties; +import com.azure.spring.cloud.autoconfigure.storage.queue.AzureStorageQueueAutoConfiguration; import com.azure.spring.messaging.storage.queue.core.StorageQueueTemplate; -import com.azure.spring.messaging.storage.queue.implementation.factory.DefaultStorageQueueClientFactory; import com.azure.spring.messaging.storage.queue.core.factory.StorageQueueClientFactory; import com.azure.spring.messaging.storage.queue.core.properties.StorageQueueProperties; +import com.azure.spring.messaging.storage.queue.implementation.factory.DefaultStorageQueueClientFactory; import com.azure.spring.messaging.storage.queue.support.converter.StorageQueueMessageConverter; import org.springframework.beans.BeanUtils; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -40,6 +40,12 @@ StorageQueueClientFactory storageQueueClientFactory(AzureStorageQueueProperties return new DefaultStorageQueueClientFactory(storageQueueProperties); } + /** + * Autoconfigure the {@link StorageQueueTemplate} instance. + * @param storageQueueClientFactory the storage queue client factory to create the storage queue clients for the template. + * @param messageConverter the message converter used by the template. + * @return the storage queue template. + */ @Bean @ConditionalOnMissingBean public StorageQueueTemplate storageQueueTemplate(StorageQueueClientFactory storageQueueClientFactory, diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java index 7dbd4c09697de..21a832298e73a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java @@ -65,6 +65,11 @@ BlobContainerAsyncClient blobContainerAsyncClient(AzureStorageBlobProperties pro return blobServiceAsyncClient.getBlobContainerAsyncClient(properties.getContainerName()); } + /** + * Autoconfigure the {@link BlobServiceAsyncClient} instance. + * @param builder the {@link BlobServiceClientBuilder} to build the instance. + * @return the blob service async client. + */ @Bean @ConditionalOnMissingBean public BlobServiceAsyncClient blobServiceAsyncClient( @@ -88,6 +93,11 @@ BlobContainerClient blobContainerClient(AzureStorageBlobProperties properties, return blobServiceClient.getBlobContainerClient(properties.getContainerName()); } + /** + * Autoconfigure the {@link BlobServiceClient} instance. + * @param builder the {@link BlobServiceClientBuilder} to build the instance. + * @return the blob service client. + */ @Bean @ConditionalOnMissingBean public BlobServiceClient blobServiceClient( diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobResourceAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobResourceAutoConfiguration.java index 66e262b54e5d4..e2bd48f842414 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobResourceAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobResourceAutoConfiguration.java @@ -18,6 +18,10 @@ @ConditionalOnAnyProperty(prefix = "spring.cloud.azure.storage.blob", name = { "account-name", "endpoint", "connection-string" }) public class AzureStorageBlobResourceAutoConfiguration { + /** + * Autoconfigure the {@link AzureStorageBlobProtocolResolver} instance. + * @return the storage blob protocol resolver. + */ @Bean @ConditionalOnMissingBean public AzureStorageBlobProtocolResolver azureStorageBlobProtocolResolver() { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java index 757fb2f2f2099..aa140f7d86347 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java @@ -47,12 +47,22 @@ AzureStorageFileShareProperties azureStorageFileShareProperties() { return loadProperties(this.azureGlobalProperties, new AzureStorageFileShareProperties()); } + /** + * Autoconfigure the {@link ShareServiceClient} instance. + * @param builder the {@link ShareServiceClientBuilder} to build the instance. + * @return the share service client. + */ @Bean @ConditionalOnMissingBean public ShareServiceClient shareServiceClient(ShareServiceClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link ShareServiceAsyncClient} instance. + * @param builder the {@link ShareServiceClientBuilder} to build the instance. + * @return the share service async client. + */ @Bean @ConditionalOnMissingBean public ShareServiceAsyncClient shareServiceAsyncClient(ShareServiceClientBuilder builder) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareResourceAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareResourceAutoConfiguration.java index f1822136edcc3..00155bb9f4245 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareResourceAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareResourceAutoConfiguration.java @@ -18,6 +18,10 @@ @ConditionalOnAnyProperty(prefix = "spring.cloud.azure.storage.fileshare", name = { "account-name", "endpoint", "connection-string" }) public class AzureStorageFileShareResourceAutoConfiguration { + /** + * Autoconfigure the {@link AzureStorageFileProtocolResolver} instance. + * @return the storage file protocol resolver. + */ @Bean @ConditionalOnMissingBean public AzureStorageFileProtocolResolver azureStorageFileProtocolResolver() { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java index bc7553ec9dd21..7e7fdfa98846b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java @@ -43,12 +43,22 @@ AzureStorageQueueProperties azureStorageQueueProperties() { return loadProperties(this.azureGlobalProperties, new AzureStorageQueueProperties()); } + /** + * Autoconfigure the {@link QueueServiceClient} instance. + * @param builder the {@link QueueServiceClientBuilder} to build the instance. + * @return the queue service client. + */ @Bean @ConditionalOnMissingBean public QueueServiceClient queueServiceClient(QueueServiceClientBuilder builder) { return builder.buildClient(); } + /** + * Autoconfigure the {@link QueueServiceAsyncClient} instance. + * @param builder the {@link QueueServiceClientBuilder} to build the instance. + * @return the queue service async client. + */ @Bean @ConditionalOnMissingBean public QueueServiceAsyncClient queueServiceAsyncClient(QueueServiceClientBuilder builder) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java index 88b2a2fa8ac85..5677f6bdd2974 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java @@ -7,13 +7,14 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.cosmos.CosmosClientBuilder; import com.azure.security.keyvault.secrets.SecretClientBuilder; +import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.cosmos.AzureCosmosAutoConfiguration; import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsAutoConfiguration; import com.azure.spring.cloud.autoconfigure.implementation.cosmos.properties.AzureCosmosProperties; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; -import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.keyvault.secrets.AzureKeyVaultSecretAutoConfiguration; +import com.azure.spring.cloud.core.properties.client.HeaderProperties; import org.assertj.core.extractor.Extractors; import org.assertj.core.util.introspection.IntrospectionError; import org.junit.jupiter.api.Test; @@ -21,12 +22,13 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner; import java.time.Duration; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.OTHER; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; @@ -43,6 +45,9 @@ class AzureServiceConfigurationBaseTests { @Test void configureGlobalShouldApplyToAzureCosmosProperties() { + HeaderProperties headerProperties = new HeaderProperties(); + headerProperties.setName("global-header"); + headerProperties.setValues(Arrays.asList("a", "b", "c")); AzureGlobalProperties azureProperties = new AzureGlobalProperties(); azureProperties.getCredential().setClientId("global-client-id"); azureProperties.getCredential().setClientSecret("global-client-secret"); @@ -51,6 +56,7 @@ void configureGlobalShouldApplyToAzureCosmosProperties() { azureProperties.getClient().getHttp().setConnectTimeout(Duration.ofMinutes(1)); azureProperties.getClient().getHttp().getLogging().setLevel(HttpLogDetailLevel.HEADERS); azureProperties.getClient().getHttp().getLogging().getAllowedHeaderNames().add("abc"); + azureProperties.getClient().getHttp().getHeaders().add(headerProperties); azureProperties.getProxy().setHostname("localhost"); azureProperties.getProxy().getHttp().setNonProxyHosts("localhost"); azureProperties.getProxy().getAmqp().setAuthenticationType("basic"); @@ -83,6 +89,8 @@ void configureGlobalShouldApplyToAzureCosmosProperties() { assertThatThrownBy(() -> Extractors.byName("client.transportType").apply(properties)) .isInstanceOf(IntrospectionError.class); + assertThatThrownBy(() -> Extractors.byName("client.headers").apply(properties)) + .isInstanceOf(IntrospectionError.class); assertThatThrownBy(() -> Extractors.byName("client.logging.allowedHeaderNames").apply(properties)) .isInstanceOf(IntrospectionError.class); assertThatThrownBy(() -> Extractors.byName("client.logging.level").apply(properties)) @@ -132,11 +140,15 @@ void configureEnvGlobalAndCosmosShouldApplyCosmos() { @Test void configureGlobalShouldApplyToAmqpAzureEventHubsProperties() { + HeaderProperties headerProperties = new HeaderProperties(); + headerProperties.setName("global-header"); + headerProperties.setValues(Arrays.asList("a", "b", "c")); AzureGlobalProperties azureProperties = new AzureGlobalProperties(); azureProperties.getCredential().setClientId("global-client-id"); azureProperties.getCredential().setClientSecret("global-client-secret"); azureProperties.getClient().setApplicationId("global-application-id"); azureProperties.getClient().getAmqp().setTransportType(AmqpTransportType.AMQP_WEB_SOCKETS); + azureProperties.getClient().getHttp().getHeaders().add(headerProperties); azureProperties.getClient().getHttp().setConnectTimeout(Duration.ofMinutes(1)); azureProperties.getClient().getHttp().getLogging().setLevel(HttpLogDetailLevel.HEADERS); azureProperties.getClient().getHttp().getLogging().getAllowedHeaderNames().add("abc"); @@ -176,6 +188,8 @@ void configureGlobalShouldApplyToAmqpAzureEventHubsProperties() { assertThatThrownBy(() -> Extractors.byName("client.connectTimeout").apply(properties)) .isInstanceOf(IntrospectionError.class); + assertThatThrownBy(() -> Extractors.byName("client.headers").apply(properties)) + .isInstanceOf(IntrospectionError.class); assertThatThrownBy(() -> Extractors.byName("client.logging.level").apply(properties)) .isInstanceOf(IntrospectionError.class); assertThatThrownBy(() -> Extractors.byName("client.logging.allowedHeaderNames").apply(properties)) @@ -188,11 +202,15 @@ void configureGlobalShouldApplyToAmqpAzureEventHubsProperties() { @Test void configureGlobalShouldApplyToHttpAzureKeyVaultSecretProperties() { + HeaderProperties headerProperties = new HeaderProperties(); + headerProperties.setName("global-header"); + headerProperties.setValues(Arrays.asList("a", "b", "c")); AzureGlobalProperties azureProperties = new AzureGlobalProperties(); azureProperties.getCredential().setClientId("global-client-id"); azureProperties.getCredential().setClientSecret("global-client-secret"); azureProperties.getClient().setApplicationId("global-application-id"); azureProperties.getClient().getAmqp().setTransportType(AmqpTransportType.AMQP_WEB_SOCKETS); + azureProperties.getClient().getHttp().getHeaders().add(headerProperties); azureProperties.getClient().getHttp().setConnectTimeout(Duration.ofMinutes(1)); azureProperties.getClient().getHttp().getLogging().setLevel(HttpLogDetailLevel.HEADERS); azureProperties.getClient().getHttp().getLogging().getAllowedHeaderNames().add("abc"); @@ -222,6 +240,7 @@ void configureGlobalShouldApplyToHttpAzureKeyVaultSecretProperties() { Set allowedHeaderNames = new HashSet<>(); allowedHeaderNames.add("abc"); assertThat(properties).extracting("client.logging.allowedHeaderNames").isEqualTo(allowedHeaderNames); + assertThat(properties).extracting("client.headers").isEqualTo(Arrays.asList(headerProperties)); assertThat(properties).extracting("proxy.hostname").isEqualTo("localhost"); assertThat(properties).extracting("proxy.nonProxyHosts").isEqualTo("localhost"); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java index ebf1b0c948112..88824c999b9bb 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java @@ -6,7 +6,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; import org.junit.jupiter.api.Test; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.env.EnvironmentPostProcessor; @@ -128,7 +128,7 @@ void azureCoreEnvShouldBindCorrect() { assertEquals("core-password", globalProperties.getCredential().getPassword()); assertEquals("core-tenant-id", globalProperties.getProfile().getTenantId()); assertEquals("core-sub-id", globalProperties.getProfile().getSubscriptionId()); - assertEquals(AzureProfileOptionsAware.CloudType.OTHER, globalProperties.getProfile().getCloudType()); + assertEquals(AzureProfileOptionsProvider.CloudType.OTHER, globalProperties.getProfile().getCloudType()); assertEquals("aad", globalProperties.getProfile().getEnvironment().getActiveDirectoryEndpoint()); assertEquals(3, globalProperties.getRetry().getMaxRetries()); assertEquals(HttpLogDetailLevel.HEADERS, globalProperties.getClient().getHttp().getLogging().getLevel()); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java index 0ab7b3d9acc00..19e0752c01545 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java @@ -4,7 +4,7 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; @@ -12,9 +12,9 @@ import java.time.Duration; import java.util.Arrays; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.OTHER; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; import static org.assertj.core.api.Assertions.assertThat; class AzureGlobalPropertiesAutoConfigurationTests { @@ -35,8 +35,8 @@ void configurationPropertiesShouldBind() { this.contextRunner .withPropertyValues( "spring.cloud.azure.client.application-id=fake-application-id", - "spring.cloud.azure.client.headers[0].name=header-name", - "spring.cloud.azure.client.headers[0].values=a,b,c", + "spring.cloud.azure.client.http.headers[0].name=header-name", + "spring.cloud.azure.client.http.headers[0].values=a,b,c", "spring.cloud.azure.client.http.connect-timeout=1m", "spring.cloud.azure.client.http.read-timeout=2m", "spring.cloud.azure.client.http.response-timeout=3m", @@ -70,8 +70,8 @@ void configurationPropertiesShouldBind() { .run(context -> { final AzureGlobalProperties azureProperties = context.getBean(AzureGlobalProperties.class); assertThat(azureProperties.getClient().getApplicationId()).isEqualTo("fake-application-id"); - assertThat(azureProperties.getClient().getHeaders().get(0).getName()).isEqualTo("header-name"); - assertThat(azureProperties.getClient().getHeaders().get(0).getValues()).isEqualTo(Arrays.asList("a", "b", "c")); + assertThat(azureProperties.getClient().getHttp().getHeaders().get(0).getName()).isEqualTo("header-name"); + assertThat(azureProperties.getClient().getHttp().getHeaders().get(0).getValues()).isEqualTo(Arrays.asList("a", "b", "c")); assertThat(azureProperties.getClient().getHttp().getConnectTimeout()).isEqualTo(Duration.ofMinutes(1)); assertThat(azureProperties.getClient().getHttp().getReadTimeout()).isEqualTo(Duration.ofMinutes(2)); assertThat(azureProperties.getClient().getHttp().getResponseTimeout()).isEqualTo(Duration.ofMinutes(3)); @@ -99,7 +99,7 @@ void configurationPropertiesShouldBind() { assertThat(azureProperties.getRetry().getMaxRetries()).isEqualTo(1); assertThat(azureProperties.getRetry().getBaseDelay()).isEqualTo(Duration.ofSeconds(20)); assertThat(azureProperties.getRetry().getMaxDelay()).isEqualTo(Duration.ofSeconds(30)); - assertThat(azureProperties.getRetry().getMode()).isEqualTo(RetryOptionsAware.RetryMode.FIXED); + assertThat(azureProperties.getRetry().getMode()).isEqualTo(RetryOptionsProvider.RetryMode.FIXED); assertThat(azureProperties.getRetry().getAmqp().getTryTimeout()).isEqualTo(Duration.ofSeconds(200)); assertThat(azureProperties.getProfile().getTenantId()).isEqualTo("fake-tenant-id"); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java index cc0189836c861..d6aa0cd65fdf5 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java @@ -3,8 +3,8 @@ package com.azure.spring.cloud.autoconfigure.eventhubs; -import com.azure.spring.cloud.autoconfigure.eventhubs.kafka.AzureEventHubsKafkaAutoConfiguration; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; +import com.azure.spring.cloud.autoconfigure.eventhubs.kafka.AzureEventHubsKafkaAutoConfiguration; import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.resourcemanager.implementation.connectionstring.ArmConnectionStringProvider; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java index 46536b628aa64..f0f10b6bead4a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java @@ -8,7 +8,7 @@ import com.azure.messaging.servicebus.models.ServiceBusReceiveMode; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -96,7 +96,7 @@ void configureRetryShouldApply() { final AzureServiceBusProperties properties = context.getBean(AzureServiceBusProperties.class); assertEquals(5, properties.getRetry().getMaxRetries()); - assertEquals(RetryOptionsAware.RetryMode.FIXED, properties.getRetry().getMode()); + assertEquals(RetryOptionsProvider.RetryMode.FIXED, properties.getRetry().getMode()); assertEquals(Duration.ofSeconds(10), properties.getRetry().getBaseDelay()); assertEquals(Duration.ofSeconds(20), properties.getRetry().getMaxDelay()); assertEquals(Duration.ofSeconds(30), properties.getRetry().getTryTimeout()); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java similarity index 98% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java index fdde1f640c933..573a8daedd0b3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java @@ -9,18 +9,18 @@ /** * Interface to be implemented by classes that wish to be aware of the Azure profile. */ -public interface AzureProfileOptionsAware { +public interface AzureProfileOptionsProvider { /** * Get the profile * @return the profile */ - Profile getProfile(); + ProfileOptions getProfile(); /** * Interface to be implemented by classes that wish to describe an Azure cloud profile. */ - interface Profile { + interface ProfileOptions { /** * Get the tenant id. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java similarity index 90% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java index f635a2a2fa059..9147366779b35 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java @@ -12,18 +12,18 @@ /** * Interface to be implemented by classes that wish to be aware of the client properties. */ -public interface ClientOptionsAware { +public interface ClientOptionsProvider { /** * Get the client configuration. * @return the client configuration. */ - Client getClient(); + ClientOptions getClient(); /** * Interface to be implemented by classes that wish to describe sdk client common options. */ - interface Client { + interface ClientOptions { /** * Get the application id @@ -31,18 +31,12 @@ interface Client { */ String getApplicationId(); - /** - * Get header properties list for client header. - * @return header properties list. - */ - List getHeaders(); - } /** * Interface to be implemented by classes that wish to describe a http based client sdk. */ - interface HttpClient extends Client, HttpLoggingOptionsAware { + interface HttpClientOptions extends ClientOptions, HttpLoggingOptionsProvider { /** * Get the http client write timeout. @@ -80,12 +74,18 @@ interface HttpClient extends Client, HttpLoggingOptionsAware { */ Duration getConnectionIdleTimeout(); + /** + * Get header properties list for client header. + * @return header properties list. + */ + List getHeaders(); + } /** * Interface to be implemented by classes that wish to describe an amqp based client sdk. */ - interface AmqpClient extends Client { + interface AmqpClientOptions extends ClientOptions { /** * Get the AMQP transport type. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java similarity index 93% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java index 4fe2be445ea76..990627ebc20b8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java @@ -13,13 +13,13 @@ * For example, if you want to log the http request or response, you could set the level to * {@link HttpLogDetailLevel#BASIC} or some other levels. */ -public interface HttpLoggingOptionsAware { +public interface HttpLoggingOptionsProvider { /** * Get the http logging details. * @return the http logging. */ - HttpLogging getLogging(); + HttpLoggingOptions getLogging(); /** * Interface to be implemented by classes that wish to describe logging options in http-based client sdks. @@ -27,7 +27,7 @@ public interface HttpLoggingOptionsAware { * For example, if you want to log the http request or response, you could set the level to * {@link HttpLogDetailLevel#BASIC} or some other levels. */ - interface HttpLogging { + interface HttpLoggingOptions { /** * Gets the level of detail to log on HTTP messages. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java similarity index 88% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java index c2ca7d45a3527..80afe1f270c82 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java @@ -6,18 +6,18 @@ /** * Interface to be implemented by classes that wish to be aware of the proxy properties. */ -public interface ProxyOptionsAware { +public interface ProxyOptionsProvider { /** * Get the proxy configuration. * @return the proxy configuration. */ - Proxy getProxy(); + ProxyOptions getProxy(); /** * Interface to be implemented by classes that wish to describe the http based client proxy. */ - interface HttpProxy extends Proxy { + interface HttpProxyOptions extends ProxyOptions { /** * Get the http non-proxy host. @@ -29,7 +29,7 @@ interface HttpProxy extends Proxy { /** * Interface to be implemented by classes that wish to describe the amqp based client proxy. */ - interface AmqpProxy extends Proxy { + interface AmqpProxyOptions extends ProxyOptions { /** * Get the proxy authentication type. @@ -41,7 +41,7 @@ interface AmqpProxy extends Proxy { /** * Interface to be implemented by classes that wish to describe the proxy. */ - interface Proxy { + interface ProxyOptions { /** * Get the proxy type. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java similarity index 90% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java index b6d7c93e3d619..a7bceba49e985 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java @@ -8,18 +8,18 @@ /** * Interface to be implemented by classes that wish to be aware of the retry properties. */ -public interface RetryOptionsAware { +public interface RetryOptionsProvider { /** * Get the retry configuration. * @return the retry configuration. */ - Retry getRetry(); + RetryOptions getRetry(); /** * Interface to be implemented by classes that wish to describe retry options. */ - interface Retry { + interface RetryOptions { /** * The maximum number of attempts. @@ -49,7 +49,7 @@ interface Retry { /** * Interface to be implemented by classes that wish to describe amqp related retry options. */ - interface AmqpRetry extends Retry { + interface AmqpRetryOptions extends RetryOptions { /** * Amount of time to wait until a timeout. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java similarity index 91% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java index 2ab3af63d5c5b..1014cc45024aa 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java @@ -7,18 +7,18 @@ /** * Interface to be implemented by classes that wish to be aware of the token credential. */ -public interface TokenCredentialOptionsAware { +public interface TokenCredentialOptionsProvider { /** * Get the token credential * @return the token credential */ - TokenCredential getCredential(); + TokenCredentialOptions getCredential(); /** * Interface to be implemented by classes that wish to describe the token credential related options. */ - interface TokenCredential { + interface TokenCredentialOptions { /** * Get the client id diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java index 0380ca968b712..c1cce6044a403 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.ProxyAuthenticationType; import com.azure.core.amqp.ProxyOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; @@ -16,9 +16,9 @@ import java.util.Locale; /** - * Converts a {@link ProxyOptionsAware.Proxy} to a {@link ProxyOptions}. + * Converts a {@link ProxyOptionsProvider.ProxyOptions} to a {@link ProxyOptions}. */ -public final class AzureAmqpProxyOptionsConverter implements Converter { +public final class AzureAmqpProxyOptionsConverter implements Converter { private static final Logger LOGGER = LoggerFactory.getLogger(AzureAmqpProxyOptionsConverter.class); public static final AzureAmqpProxyOptionsConverter AMQP_PROXY_CONVERTER = new AzureAmqpProxyOptionsConverter(); @@ -28,7 +28,7 @@ private AzureAmqpProxyOptionsConverter() { } @Override - public ProxyOptions convert(ProxyOptionsAware.Proxy proxy) { + public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { if (!StringUtils.hasText(proxy.getHostname()) || proxy.getPort() == null) { LOGGER.debug("Proxy hostname or port is not set."); return null; @@ -39,8 +39,8 @@ public ProxyOptions convert(ProxyOptionsAware.Proxy proxy) { } ProxyAuthenticationType authenticationType = ProxyAuthenticationType.NONE; - if (proxy instanceof ProxyOptionsAware.AmqpProxy) { - ProxyOptionsAware.AmqpProxy amqpProxy = (ProxyOptionsAware.AmqpProxy) proxy; + if (proxy instanceof ProxyOptionsProvider.AmqpProxyOptions) { + ProxyOptionsProvider.AmqpProxyOptions amqpProxy = (ProxyOptionsProvider.AmqpProxyOptions) proxy; if (amqpProxy.getAuthenticationType() != null) { switch (amqpProxy.getAuthenticationType().toLowerCase(Locale.ROOT)) { case "basic": diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java index f1448af088fe4..60d69e9a72fc0 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.AmqpRetryMode; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.retry.RetryProperties; import org.springframework.core.convert.converter.Converter; @@ -13,7 +13,7 @@ /** * Converts a {@link RetryProperties} to a {@link AmqpRetryOptions}. */ -public final class AzureAmqpRetryOptionsConverter implements Converter { +public final class AzureAmqpRetryOptionsConverter implements Converter { public static final AzureAmqpRetryOptionsConverter AMQP_RETRY_CONVERTER = new AzureAmqpRetryOptionsConverter(); @@ -22,12 +22,12 @@ private AzureAmqpRetryOptionsConverter() { } @Override - public AmqpRetryOptions convert(RetryOptionsAware.AmqpRetry retry) { + public AmqpRetryOptions convert(RetryOptionsProvider.AmqpRetryOptions retry) { AmqpRetryOptions result = new AmqpRetryOptions(); - if (RetryOptionsAware.RetryMode.EXPONENTIAL.equals(retry.getMode())) { + if (RetryOptionsProvider.RetryMode.EXPONENTIAL.equals(retry.getMode())) { result.setMode(AmqpRetryMode.EXPONENTIAL); - } else if (RetryOptionsAware.RetryMode.FIXED.equals(retry.getMode())) { + } else if (RetryOptionsProvider.RetryMode.FIXED.equals(retry.getMode())) { result.setMode(AmqpRetryMode.FIXED); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java index 89ee2bb82a5ba..cbb73d4ff00dc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java @@ -4,13 +4,13 @@ package com.azure.spring.cloud.core.implementation.converter; import com.azure.core.http.policy.HttpLogOptions; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsAware; +import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; import org.springframework.core.convert.converter.Converter; /** - * Converts a {@link HttpLoggingOptionsAware} to a {@link HttpLogOptions}. + * Converts a {@link HttpLoggingOptionsProvider} to a {@link HttpLogOptions}. */ -public final class AzureHttpLogOptionsConverter implements Converter { +public final class AzureHttpLogOptionsConverter implements Converter { public static final AzureHttpLogOptionsConverter HTTP_LOG_OPTIONS_CONVERTER = new AzureHttpLogOptionsConverter(); @@ -19,7 +19,7 @@ private AzureHttpLogOptionsConverter() { } @Override - public HttpLogOptions convert(HttpLoggingOptionsAware.HttpLogging logging) { + public HttpLogOptions convert(HttpLoggingOptionsProvider.HttpLoggingOptions logging) { HttpLogOptions logOptions = new HttpLogOptions(); logOptions.setLogLevel(logging.getLevel()) diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java index 83215b492b3f1..b2d6e3ae3b408 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.converter; import com.azure.core.http.ProxyOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; @@ -13,9 +13,9 @@ import java.net.InetSocketAddress; /** - * Converts a {@link ProxyOptionsAware.Proxy} to a {@link ProxyOptions}. + * Converts a {@link ProxyOptionsProvider.ProxyOptions} to a {@link ProxyOptions}. */ -public final class AzureHttpProxyOptionsConverter implements Converter { +public final class AzureHttpProxyOptionsConverter implements Converter { private static final Logger LOGGER = LoggerFactory.getLogger(AzureHttpProxyOptionsConverter.class); public static final AzureHttpProxyOptionsConverter HTTP_PROXY_CONVERTER = new AzureHttpProxyOptionsConverter(); @@ -25,7 +25,7 @@ private AzureHttpProxyOptionsConverter() { } @Override - public ProxyOptions convert(ProxyOptionsAware.Proxy proxy) { + public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { if (!StringUtils.hasText(proxy.getHostname()) || proxy.getPort() == null) { LOGGER.debug("Proxy hostname or port is not set."); return null; @@ -34,11 +34,11 @@ public ProxyOptions convert(ProxyOptionsAware.Proxy proxy) { final String type = proxy.getType(); ProxyOptions.Type sdkProxyType = null; if ("http".equalsIgnoreCase(type)) { - sdkProxyType = ProxyOptions.Type.HTTP; + sdkProxyType = com.azure.core.http.ProxyOptions.Type.HTTP; } else if ("socks".equalsIgnoreCase(type) || "socks4".equalsIgnoreCase(type)) { - sdkProxyType = ProxyOptions.Type.SOCKS4; + sdkProxyType = com.azure.core.http.ProxyOptions.Type.SOCKS4; } else if ("socks5".equalsIgnoreCase(type)) { - sdkProxyType = ProxyOptions.Type.SOCKS5; + sdkProxyType = com.azure.core.http.ProxyOptions.Type.SOCKS5; } else { throw new IllegalArgumentException("Wrong proxy type provided!"); } @@ -49,8 +49,8 @@ public ProxyOptions convert(ProxyOptionsAware.Proxy proxy) { proxyOptions.setCredentials(proxy.getUsername(), proxy.getPassword()); } - if (proxy instanceof ProxyOptionsAware.HttpProxy) { - ProxyOptionsAware.HttpProxy httpProxyProperties = (ProxyOptionsAware.HttpProxy) proxy; + if (proxy instanceof ProxyOptionsProvider.HttpProxyOptions) { + ProxyOptionsProvider.HttpProxyOptions httpProxyProperties = (ProxyOptionsProvider.HttpProxyOptions) proxy; if (StringUtils.hasText(httpProxyProperties.getNonProxyHosts())) { proxyOptions.setNonProxyHosts(httpProxyProperties.getNonProxyHosts()); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java index 221a8c000f443..f1ac4f3d7b6f3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java @@ -6,16 +6,16 @@ import com.azure.core.http.policy.ExponentialBackoffOptions; import com.azure.core.http.policy.FixedDelayOptions; import com.azure.core.http.policy.RetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import org.springframework.core.convert.converter.Converter; import org.springframework.lang.NonNull; import java.time.Duration; /** - * Converts a {@link RetryOptionsAware.Retry} to a {@link RetryOptions}. + * Converts a {@link RetryOptionsProvider.RetryOptions} to a {@link RetryOptions}. */ -public final class AzureHttpRetryOptionsConverter implements Converter { +public final class AzureHttpRetryOptionsConverter implements Converter { public static final AzureHttpRetryOptionsConverter HTTP_RETRY_CONVERTER = new AzureHttpRetryOptionsConverter(); @@ -24,22 +24,22 @@ private AzureHttpRetryOptionsConverter() { } @Override - public RetryOptions convert(@NonNull RetryOptionsAware.Retry retry) { + public RetryOptions convert(@NonNull RetryOptionsProvider.RetryOptions retry) { Integer maxRetries = retry.getMaxRetries(); if (maxRetries == null) { return null; } Duration baseDelay = retry.getBaseDelay(); - RetryOptionsAware.RetryMode retryMode = retry.getMode(); - if (RetryOptionsAware.RetryMode.EXPONENTIAL.equals(retryMode)) { + RetryOptionsProvider.RetryMode retryMode = retry.getMode(); + if (RetryOptionsProvider.RetryMode.EXPONENTIAL.equals(retryMode)) { ExponentialBackoffOptions exponentialBackoffOptions = new ExponentialBackoffOptions(); exponentialBackoffOptions.setMaxRetries(maxRetries); exponentialBackoffOptions.setBaseDelay(baseDelay); exponentialBackoffOptions.setMaxDelay(retry.getMaxDelay()); return new RetryOptions(exponentialBackoffOptions); - } else if (RetryOptionsAware.RetryMode.FIXED.equals(retryMode)) { + } else if (RetryOptionsProvider.RetryMode.FIXED.equals(retryMode)) { FixedDelayOptions fixedDelayOptions = new FixedDelayOptions(maxRetries, baseDelay); return new RetryOptions(fixedDelayOptions); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java index 0fb4238c39bf9..4628b72414c49 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java @@ -8,7 +8,7 @@ import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.identity.ManagedIdentityCredentialBuilder; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; @@ -40,7 +40,7 @@ private static TokenCredential resolveTokenCredential(AzureProperties azurePrope return null; } - final TokenCredentialOptionsAware.TokenCredential properties = azureProperties.getCredential(); + final TokenCredentialOptionsProvider.TokenCredentialOptions properties = azureProperties.getCredential(); final String tenantId = azureProperties.getProfile().getTenantId(); final String clientId = properties.getClientId(); final boolean isClientIdSet = StringUtils.hasText(clientId); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java index 1fe60d6965325..b4591ac14828e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java @@ -7,9 +7,9 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.amqp.ProxyOptions; import com.azure.core.util.ClientOptions; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,14 +74,14 @@ protected void configureAmqpClient(T builder) { * @param builder The builder of the AMQP-based service client. */ protected void configureAmqpTransportProperties(T builder) { - final ClientOptionsAware.Client client = getAzureProperties().getClient(); + final ClientOptionsProvider.ClientOptions client = getAzureProperties().getClient(); if (client == null) { return; } - final ClientOptionsAware.AmqpClient amqpClient; - if (client instanceof ClientOptionsAware.AmqpClient) { - amqpClient = (ClientOptionsAware.AmqpClient) client; + final ClientOptionsProvider.AmqpClientOptions amqpClient; + if (client instanceof ClientOptionsProvider.AmqpClientOptions) { + amqpClient = (ClientOptionsProvider.AmqpClientOptions) client; consumeAmqpTransportType().accept(builder, amqpClient.getTransportType()); } } @@ -101,18 +101,18 @@ protected BiConsumer consumeApplicationId() { @Override protected void configureRetry(T builder) { - RetryOptionsAware.Retry retry = null; + RetryOptionsProvider.RetryOptions retry = null; AzureProperties azureProperties = getAzureProperties(); - if (azureProperties instanceof RetryOptionsAware) { - retry = ((RetryOptionsAware) azureProperties).getRetry(); + if (azureProperties instanceof RetryOptionsProvider) { + retry = ((RetryOptionsProvider) azureProperties).getRetry(); } if (retry == null) { return; } - if (retry instanceof RetryOptionsAware.AmqpRetry) { - AmqpRetryOptions retryOptions = AMQP_RETRY_CONVERTER.convert((RetryOptionsAware.AmqpRetry) retry); + if (retry instanceof RetryOptionsProvider.AmqpRetryOptions) { + AmqpRetryOptions retryOptions = AMQP_RETRY_CONVERTER.convert((RetryOptionsProvider.AmqpRetryOptions) retry); consumeAmqpRetryOptions().accept(builder, retryOptions); } else { LOGGER.debug("The provided retry options is not a RetryOptionsAware.AmqpRetry type."); @@ -121,7 +121,7 @@ protected void configureRetry(T builder) { @Override protected void configureProxy(T builder) { - ProxyOptionsAware.Proxy proxy = getAzureProperties().getProxy(); + ProxyOptionsProvider.ProxyOptions proxy = getAzureProperties().getProxy(); if (proxy == null) { return; } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java index 14c64f5643e5e..166fedc2d7a37 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java @@ -14,9 +14,9 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Header; import com.azure.core.util.HttpClientOptions; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.http.DefaultHttpProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; @@ -111,7 +111,7 @@ protected void configureHttpClient(T builder) { @Override protected void configureProxy(T builder) { - final ProxyOptionsAware.Proxy proxy = getAzureProperties().getProxy(); + final ProxyOptionsProvider.ProxyOptions proxy = getAzureProperties().getProxy(); if (proxy == null) { return; } @@ -144,11 +144,11 @@ protected void configureHttpHeaders(T builder) { * @param builder The builder of the HTTP-based service client. */ protected void configureHttpLogOptions(T builder) { - ClientOptionsAware.Client client = getAzureProperties().getClient(); + ClientOptionsProvider.ClientOptions client = getAzureProperties().getClient(); - if (client instanceof ClientOptionsAware.HttpClient) { + if (client instanceof ClientOptionsProvider.HttpClientOptions) { HttpLogOptions logOptions = - HTTP_LOG_OPTIONS_CONVERTER.convert(((ClientOptionsAware.HttpClient) client).getLogging()); + HTTP_LOG_OPTIONS_CONVERTER.convert(((ClientOptionsProvider.HttpClientOptions) client).getLogging()); consumeHttpLogOptions().accept(builder, logOptions); } else { LOGGER.warn("The client properties of an http-based client is of type {}", client.getClass().getName()); @@ -162,13 +162,13 @@ protected void configureHttpLogOptions(T builder) { * @param builder The builder of the HTTP-based service client. */ protected void configureHttpTransportProperties(T builder) { - final ClientOptionsAware.Client client = getAzureProperties().getClient(); + final ClientOptionsProvider.ClientOptions client = getAzureProperties().getClient(); if (client == null) { return; } - final ClientOptionsAware.HttpClient properties; - if (client instanceof ClientOptionsAware.HttpClient) { - properties = (ClientOptionsAware.HttpClient) client; + final ClientOptionsProvider.HttpClientOptions properties; + if (client instanceof ClientOptionsProvider.HttpClientOptions) { + properties = (ClientOptionsProvider.HttpClientOptions) client; httpClientOptions.setWriteTimeout(properties.getWriteTimeout()); httpClientOptions.responseTimeout(properties.getResponseTimeout()); httpClientOptions.readTimeout(properties.getReadTimeout()); @@ -181,9 +181,9 @@ protected void configureHttpTransportProperties(T builder) { @Override protected void configureRetry(T builder) { AzureProperties azureProperties = getAzureProperties(); - RetryOptionsAware.Retry retry = null; - if (azureProperties instanceof RetryOptionsAware) { - retry = ((RetryOptionsAware) azureProperties).getRetry(); + RetryOptionsProvider.RetryOptions retry = null; + if (azureProperties instanceof RetryOptionsProvider) { + retry = ((RetryOptionsProvider) azureProperties).getRetry(); } if (retry == null) { @@ -213,14 +213,22 @@ protected void configureHttpPipelinePolicies(T builder) { * @return The list of HTTP headers will be sent with the HTTP requests made of the HTTP-based sdk client. */ protected List
getHeaders() { - final ClientOptionsAware.Client client = getAzureProperties().getClient(); - if (client == null || client.getHeaders() == null) { + final ClientOptionsProvider.ClientOptions client = getAzureProperties().getClient(); + if (client == null) { + return null; + } + if (!(client instanceof ClientOptionsProvider.HttpClientOptions)) { + LOGGER.debug("The clientOptions passed in is not of ClientOptionsAware.HttpClientOptions."); + return null; + } + ClientOptionsProvider.HttpClientOptions httpClientOptions = (ClientOptionsProvider.HttpClientOptions) client; + if (httpClientOptions.getHeaders() == null) { return null; } - return client.getHeaders() - .stream() - .map(h -> new Header(h.getName(), h.getValues())) - .collect(Collectors.toList()); + return httpClientOptions.getHeaders() + .stream() + .map(h -> new Header(h.getName(), h.getValues())) + .collect(Collectors.toList()); } /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java index e9e1fc7c57422..6a394b81757a7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java @@ -7,7 +7,7 @@ import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.credential.AzureCredentialResolvers; @@ -298,9 +298,9 @@ private Object resolveAzureCredential(AzureProperties azureProperties, } private String getApplicationId() { - final ClientOptionsAware.Client client = getAzureProperties().getClient(); + final ClientOptionsProvider.ClientOptions client = getAzureProperties().getClient(); return Optional.ofNullable(client) - .map(ClientOptionsAware.Client::getApplicationId) + .map(ClientOptionsProvider.ClientOptions::getApplicationId) .orElse(""); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java index c4e711dbbdd37..7d3df6f13890d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java @@ -12,7 +12,7 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.identity.CredentialBuilderBase; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -62,10 +62,10 @@ protected BiConsumer consumeConfiguration() { @Override protected void configureRetry(T builder) { - RetryOptionsAware.Retry retry = null; + RetryOptionsProvider.RetryOptions retry = null; AzureProperties azureProperties = getAzureProperties(); - if (azureProperties instanceof RetryOptionsAware) { - retry = ((RetryOptionsAware) azureProperties).getRetry(); + if (azureProperties instanceof RetryOptionsProvider) { + retry = ((RetryOptionsProvider) azureProperties).getRetry(); } if (retry == null) { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java index ee7da2d5edb4f..8a04fefdf7f9f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.AadCredentialBuilderBase; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -28,7 +28,7 @@ public AzureAadCredentialBuilderFactory(AzureProperties azureProperties) { @Override protected void configureService(T builder) { AzureProperties azureProperties = getAzureProperties(); - AzureProfileOptionsAware.Profile profile = azureProperties.getProfile(); + AzureProfileOptionsProvider.ProfileOptions profile = azureProperties.getProfile(); PropertyMapper map = new PropertyMapper(); map.from(azureProperties.getCredential().getClientId()).to(builder::clientId); map.from(profile.getTenantId()).to(builder::tenantId); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java index f0cb115e5f0f1..de2752a6505fc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientCertificateCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; @@ -31,7 +31,7 @@ protected void configureService(ClientCertificateCredentialBuilder builder) { super.configureService(builder); AzureProperties azureProperties = getAzureProperties(); - TokenCredentialOptionsAware.TokenCredential credential = azureProperties.getCredential(); + TokenCredentialOptionsProvider.TokenCredentialOptions credential = azureProperties.getCredential(); String clientCertificatePath = credential.getClientCertificatePath(); if (StringUtils.hasText(clientCertificatePath)) { if (StringUtils.hasText(credential.getClientCertificatePassword())) { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java index a7238f8b5a42a..65eaf3b7efa1d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientSecretCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -31,7 +31,7 @@ protected void configureService(ClientSecretCredentialBuilder builder) { super.configureService(builder); AzureProperties azureProperties = getAzureProperties(); - TokenCredentialOptionsAware.TokenCredential credential = azureProperties.getCredential(); + TokenCredentialOptionsProvider.TokenCredentialOptions credential = azureProperties.getCredential(); PropertyMapper map = new PropertyMapper(); map.from(credential.getClientSecret()).to(builder::clientSecret); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java index f0ea375751cd6..24d29102c090e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -33,7 +33,7 @@ protected DefaultAzureCredentialBuilder createBuilderInstance() { @Override protected void configureService(DefaultAzureCredentialBuilder builder) { AzureProperties azureProperties = getAzureProperties(); - AzureProfileOptionsAware.Profile profile = azureProperties.getProfile(); + AzureProfileOptionsProvider.ProfileOptions profile = azureProperties.getProfile(); PropertyMapper mapper = new PropertyMapper(); mapper.from(profile.getTenantId()).to(builder::tenantId); mapper.from(profile.getEnvironment().getActiveDirectoryEndpoint()).to(builder::authorityHost); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java index 1629cc0caa78f..98860fe412cc7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ManagedIdentityCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -31,7 +31,7 @@ protected void configureService(ManagedIdentityCredentialBuilder builder) { super.configureService(builder); AzureProperties azureProperties = getAzureProperties(); - TokenCredentialOptionsAware.TokenCredential credential = azureProperties.getCredential(); + TokenCredentialOptionsProvider.TokenCredentialOptions credential = azureProperties.getCredential(); PropertyMapper map = new PropertyMapper(); map.from(credential.getClientId()).when(p -> credential.isManagedIdentityEnabled()).to(builder::clientId); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java index acaeeef14e499..9b8ea5dae86aa 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -31,7 +31,7 @@ protected void configureService(UsernamePasswordCredentialBuilder builder) { super.configureService(builder); AzureProperties azureProperties = getAzureProperties(); - TokenCredentialOptionsAware.TokenCredential credential = azureProperties.getCredential(); + TokenCredentialOptionsProvider.TokenCredentialOptions credential = azureProperties.getCredential(); PropertyMapper map = new PropertyMapper(); map.from(credential.getUsername()).to(builder::username); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java index be812c733d8b9..5728b5683d94d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.AmqpClientProperties; import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; import com.azure.spring.cloud.core.properties.proxy.AmqpProxyProperties; @@ -11,7 +11,7 @@ /** * Unified properties for Azure SDK clients. */ -public abstract class AzureAmqpSdkProperties extends AzureSdkProperties implements RetryOptionsAware { +public abstract class AzureAmqpSdkProperties extends AzureSdkProperties implements RetryOptionsProvider { private final AmqpClientProperties client = new AmqpClientProperties(); private final AmqpProxyProperties proxy = new AmqpProxyProperties(); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java index 84511f84b87f7..945d36f971933 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.HttpClientProperties; import com.azure.spring.cloud.core.properties.proxy.HttpProxyProperties; import com.azure.spring.cloud.core.properties.retry.RetryProperties; @@ -11,7 +11,7 @@ /** * Unified properties for Azure SDK clients. */ -public abstract class AzureHttpSdkProperties extends AzureSdkProperties implements RetryOptionsAware { +public abstract class AzureHttpSdkProperties extends AzureSdkProperties implements RetryOptionsProvider { private final HttpClientProperties client = new HttpClientProperties(); private final HttpProxyProperties proxy = new HttpProxyProperties(); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java index 59b2dd52ac353..9e6f128d79bf2 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java @@ -3,8 +3,8 @@ package com.azure.spring.cloud.core.implementation.util; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanWrapper; @@ -41,8 +41,8 @@ public static void copyAzureCommonProperties(AzurePr BeanUtils.copyProperties(source.getProfile().getEnvironment(), target.getProfile().getEnvironment()); BeanUtils.copyProperties(source.getCredential(), target.getCredential()); - if (source instanceof RetryOptionsAware && target instanceof RetryOptionsAware) { - BeanUtils.copyProperties(((RetryOptionsAware) source).getRetry(), ((RetryOptionsAware) target).getRetry()); + if (source instanceof RetryOptionsProvider && target instanceof RetryOptionsProvider) { + BeanUtils.copyProperties(((RetryOptionsProvider) source).getRetry(), ((RetryOptionsProvider) target).getRetry()); } } @@ -64,8 +64,8 @@ public static void copyAzureCommonPropertiesIgnoreNu BeanUtils.copyProperties(source.getProfile().getEnvironment(), target.getProfile().getEnvironment()); copyPropertiesIgnoreNull(source.getCredential(), target.getCredential()); - if (source instanceof RetryOptionsAware && target instanceof RetryOptionsAware) { - copyPropertiesIgnoreNull(((RetryOptionsAware) source).getRetry(), ((RetryOptionsAware) target).getRetry()); + if (source instanceof RetryOptionsProvider && target instanceof RetryOptionsProvider) { + copyPropertiesIgnoreNull(((RetryOptionsProvider) source).getRetry(), ((RetryOptionsProvider) target).getRetry()); } } @@ -98,11 +98,11 @@ public static void copyPropertiesIgnoreNull(Object source, Object target) { private static void copyHttpLoggingProperties(AzureProperties source, T target, boolean ignoreNull) { - if (source.getClient() instanceof ClientOptionsAware.HttpClient - && target.getClient() instanceof ClientOptionsAware.HttpClient) { + if (source.getClient() instanceof ClientOptionsProvider.HttpClientOptions + && target.getClient() instanceof ClientOptionsProvider.HttpClientOptions) { - ClientOptionsAware.HttpClient sourceClient = (ClientOptionsAware.HttpClient) source.getClient(); - ClientOptionsAware.HttpClient targetClient = (ClientOptionsAware.HttpClient) target.getClient(); + ClientOptionsProvider.HttpClientOptions sourceClient = (ClientOptionsProvider.HttpClientOptions) source.getClient(); + ClientOptionsProvider.HttpClientOptions targetClient = (ClientOptionsProvider.HttpClientOptions) target.getClient(); if (ignoreNull) { copyPropertiesIgnoreNull(sourceClient.getLogging(), targetClient.getLogging()); } else { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java index 40b7dbdd63255..ea1aa83181d8f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java @@ -3,15 +3,15 @@ package com.azure.spring.cloud.core.properties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; /** * Unified properties for Azure SDK clients. */ -public interface AzureProperties extends ClientOptionsAware, ProxyOptionsAware, - TokenCredentialOptionsAware, AzureProfileOptionsAware { +public interface AzureProperties extends ClientOptionsProvider, ProxyOptionsProvider, + TokenCredentialOptionsProvider, AzureProfileOptionsProvider { } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java index 775c9fe0d2ee6..1124f2b5f9e52 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java @@ -4,12 +4,12 @@ package com.azure.spring.cloud.core.properties.authentication; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsAware; +import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; /** * Azure properties used for getting token credential. */ -public final class TokenCredentialProperties implements TokenCredentialOptionsAware.TokenCredential { +public final class TokenCredentialProperties implements TokenCredentialOptionsProvider.TokenCredentialOptions { /** * Client id to use when performing service principal authentication with Azure. @@ -47,10 +47,7 @@ public final class TokenCredentialProperties implements TokenCredentialOptionsAw */ private boolean managedIdentityEnabled; - /** - * Get the client id. - * @return The client id. - */ + @Override public String getClientId() { return clientId; } @@ -63,10 +60,7 @@ public void setClientId(String clientId) { this.clientId = clientId; } - /** - * Get the client secret. - * @return The client secret. - */ + @Override public String getClientSecret() { return clientSecret; } @@ -79,10 +73,7 @@ public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } - /** - * Get the client certificate path. - * @return The client certificate path. - */ + @Override public String getClientCertificatePath() { return clientCertificatePath; } @@ -95,10 +86,7 @@ public void setClientCertificatePath(String clientCertificatePath) { this.clientCertificatePath = clientCertificatePath; } - /** - * Get the client certificate password. - * @return The client certificate password. - */ + @Override public String getClientCertificatePassword() { return clientCertificatePassword; } @@ -111,10 +99,7 @@ public void setClientCertificatePassword(String clientCertificatePassword) { this.clientCertificatePassword = clientCertificatePassword; } - /** - * Get the username. - * @return The username. - */ + @Override public String getUsername() { return username; } @@ -127,10 +112,7 @@ public void setUsername(String username) { this.username = username; } - /** - * Get the password. - * @return The password. - */ + @Override public String getPassword() { return password; } @@ -143,10 +125,7 @@ public void setPassword(String password) { this.password = password; } - /** - * Whether the managed identity is enabled. - * @return whether managed identity is enabled. - */ + @Override public boolean isManagedIdentityEnabled() { return managedIdentityEnabled; } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java index 401816ac222ec..d5f1052cdb46c 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java @@ -4,12 +4,12 @@ package com.azure.spring.cloud.core.properties.client; import com.azure.core.amqp.AmqpTransportType; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; /** * Properties shared by all amqp client builders. */ -public final class AmqpClientProperties extends ClientProperties implements ClientOptionsAware.AmqpClient { +public final class AmqpClientProperties extends ClientProperties implements ClientOptionsProvider.AmqpClientOptions { /** * Transport type for AMQP-based client. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java index 71a266c5fbf8b..c2a3711ed6954 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java @@ -3,29 +3,19 @@ package com.azure.spring.cloud.core.properties.client; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; - -import java.util.ArrayList; -import java.util.List; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; /** * Properties shared by all azure service client builders. */ -public class ClientProperties implements ClientOptionsAware.Client { +public class ClientProperties implements ClientOptionsProvider.ClientOptions { /** * Represents current application and is used for telemetry/monitoring purposes. */ private String applicationId; - /** - * List of headers applied to each request sent with client. - */ - private final List headers = new ArrayList<>(); - /** - * Get the application id. - * @return The application id. - */ + @Override public String getApplicationId() { return applicationId; } @@ -38,12 +28,4 @@ public void setApplicationId(String applicationId) { this.applicationId = applicationId; } - /** - * Get the headers. - * @return The headers. - */ - public List getHeaders() { - return headers; - } - } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java index 19f5ed0c3503b..c842a03649f75 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java @@ -3,14 +3,16 @@ package com.azure.spring.cloud.core.properties.client; -import com.azure.spring.cloud.core.aware.ClientOptionsAware; +import com.azure.spring.cloud.core.aware.ClientOptionsProvider; import java.time.Duration; +import java.util.ArrayList; +import java.util.List; /** * Properties shared by all http client builders. */ -public final class HttpClientProperties extends ClientProperties implements ClientOptionsAware.HttpClient { +public final class HttpClientProperties extends ClientProperties implements ClientOptionsProvider.HttpClientOptions { /** * Amount of time each request being sent over the wire. @@ -37,6 +39,11 @@ public final class HttpClientProperties extends ClientProperties implements Clie */ private Duration connectionIdleTimeout; + /** + * List of headers applied to each request sent with client. + */ + private final List headers = new ArrayList<>(); + private final HttpLoggingProperties logging = new HttpLoggingProperties(); /** @@ -138,6 +145,14 @@ public void setConnectionIdleTimeout(Duration connectionIdleTimeout) { this.connectionIdleTimeout = connectionIdleTimeout; } + /** + * Get the headers. + * @return The headers. + */ + public List getHeaders() { + return headers; + } + /** * Get the {@link HttpLoggingProperties}. * @return The http client logging properties. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java index e290f82b0834f..784b0b460124b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.properties.client; import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsAware; +import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; import java.util.HashSet; import java.util.Set; @@ -13,7 +13,7 @@ * Options related to http logging. For example, if you want to log the http request or response, you could set the * level to {@link HttpLogDetailLevel#BASIC} or some other levels. */ -public final class HttpLoggingProperties implements HttpLoggingOptionsAware.HttpLogging { +public final class HttpLoggingProperties implements HttpLoggingOptionsProvider.HttpLoggingOptions { /** * Gets the level of detail to log on HTTP messages. @@ -32,10 +32,7 @@ public final class HttpLoggingProperties implements HttpLoggingOptionsAware.Http */ private Boolean prettyPrintBody; - /** - * Get the logging detail level. - * @return The logging detail level. - */ + @Override public HttpLogDetailLevel getLevel() { return level; } @@ -48,26 +45,17 @@ public void setLevel(HttpLogDetailLevel level) { this.level = level; } - /** - * Get allowed http header names. - * @return The allowed http header names. - */ + @Override public Set getAllowedHeaderNames() { return allowedHeaderNames; } - /** - * Get allowed http query parameter names. - * @return The allowed http query parameter names. - */ + @Override public Set getAllowedQueryParamNames() { return allowedQueryParamNames; } - /** - * Get whether to pretty print body. - * @return Whether to pretty print body. - */ + @Override public Boolean getPrettyPrintBody() { return prettyPrintBody; } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java index 2d9c618b9d6cb..19a0b02d6a1c6 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.core.properties.profile; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; /** * The AzureEnvironment defines all properties to Azure services, such as endpoints, resource ids, etc. */ -public class AzureEnvironmentProperties implements AzureProfileOptionsAware.AzureEnvironment { +public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.AzureEnvironment { /** * The management portal URL. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileAdapter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java similarity index 71% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileAdapter.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java index 1cc5314feb0d3..fafac41ef5ab7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileAdapter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java @@ -4,19 +4,19 @@ package com.azure.spring.cloud.core.properties.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; /** - * Skeleton implementation of a {@link AzureProfileOptionsAware.Profile}. + * Skeleton implementation of a {@link AzureProfileOptionsProvider.ProfileOptions}. */ -public abstract class AzureProfileAdapter implements AzureProfileOptionsAware.Profile { +public abstract class AzureProfileOptionsAdapter implements AzureProfileOptionsProvider.ProfileOptions { /** * Change the environment according to the cloud type set. */ protected void changeEnvironmentAccordingToCloud() { - AzureProfileOptionsAware.AzureEnvironment defaultEnvironment = decideAzureEnvironment(this.getCloudType()); + AzureProfileOptionsProvider.AzureEnvironment defaultEnvironment = decideAzureEnvironment(this.getCloudType()); AzurePropertiesUtils.copyPropertiesIgnoreNull(defaultEnvironment, this.getEnvironment()); } @@ -24,20 +24,20 @@ protected void changeEnvironmentAccordingToCloud() { * Get the Azure environment. * @return The Azure environment. */ - public abstract AzureProfileOptionsAware.AzureEnvironment getEnvironment(); + public abstract AzureProfileOptionsProvider.AzureEnvironment getEnvironment(); - private AzureProfileOptionsAware.AzureEnvironment decideAzureEnvironment(AzureProfileOptionsAware.CloudType cloud) { + private AzureProfileOptionsProvider.AzureEnvironment decideAzureEnvironment(AzureProfileOptionsProvider.CloudType cloud) { AzureEnvironment managementAzureEnvironment = decideManagementAzureEnvironment(cloud, null); return getEnvironment().fromAzureManagementEnvironment(managementAzureEnvironment); } /** - * Decide the corresponding {@link AzureEnvironment} by the {@link AzureProfileOptionsAware.CloudType}. + * Decide the corresponding {@link AzureEnvironment} by the {@link AzureProfileOptionsProvider.CloudType}. * @param cloudType The provided cloud type. * @param defaultManagementEnvironment The default management {@link AzureEnvironment}. * @return The corresponding {@link AzureEnvironment}. */ - public static AzureEnvironment decideManagementAzureEnvironment(AzureProfileOptionsAware.CloudType cloudType, + public static AzureEnvironment decideManagementAzureEnvironment(AzureProfileOptionsProvider.CloudType cloudType, AzureEnvironment defaultManagementEnvironment) { switch (cloudType) { case AZURE_CHINA: diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java index ce989508fef4b..4b8d68c20c65f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java @@ -3,16 +3,16 @@ package com.azure.spring.cloud.core.properties.profile; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsAware; +import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; /** * The AzureProfile defines the properties related to an Azure subscription. */ -public final class AzureProfileProperties extends AzureProfileAdapter { +public final class AzureProfileProperties extends AzureProfileOptionsAdapter { private String tenantId; private String subscriptionId; - private AzureProfileOptionsAware.CloudType cloudType; + private AzureProfileOptionsProvider.CloudType cloudType; private final AzureEnvironmentProperties environment; /** @@ -20,12 +20,10 @@ public final class AzureProfileProperties extends AzureProfileAdapter { */ public AzureProfileProperties() { environment = new AzureEnvironmentProperties(); - setCloudType(AzureProfileOptionsAware.CloudType.AZURE); + setCloudType(AzureProfileOptionsProvider.CloudType.AZURE); } - /** - * @return The tenant id. - */ + @Override public String getTenantId() { return tenantId; } @@ -38,9 +36,7 @@ public void setTenantId(String tenantId) { this.tenantId = tenantId; } - /** - * @return The subscription id. - */ + @Override public String getSubscriptionId() { return subscriptionId; } @@ -53,12 +49,8 @@ public void setSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; } - /** - * Get the cloud type. - * @return The cloud type. - */ @Override - public AzureProfileOptionsAware.CloudType getCloudType() { + public AzureProfileOptionsProvider.CloudType getCloudType() { return cloudType; } @@ -66,17 +58,13 @@ public AzureProfileOptionsAware.CloudType getCloudType() { * Set the cloud type. * @param cloudType the cloud type. */ - public void setCloudType(AzureProfileOptionsAware.CloudType cloudType) { + public void setCloudType(AzureProfileOptionsProvider.CloudType cloudType) { this.cloudType = cloudType; // Explicitly call this method to merge default cloud endpoints to the environment object. changeEnvironmentAccordingToCloud(); } - /** - * Get the Azure environment. - * @return The Azure environment. - */ @Override public AzureEnvironmentProperties getEnvironment() { return environment; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java index 503970b82692f..8db9e62881f6f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Extend the proxy properties for AMQP connection */ -public final class AmqpProxyProperties extends ProxyProperties implements ProxyOptionsAware.AmqpProxy { +public final class AmqpProxyProperties extends ProxyProperties implements ProxyOptionsProvider.AmqpProxyOptions { /** * Authentication type used against the proxy. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java index 2b8307a2cd716..645a4d627b245 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Extend the proxy properties for HTTP connection */ -public final class HttpProxyProperties extends ProxyProperties implements ProxyOptionsAware.HttpProxy { +public final class HttpProxyProperties extends ProxyProperties implements ProxyOptionsProvider.HttpProxyOptions { /** * A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java index e5a98159d629a..b91c2cea5400b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java @@ -3,12 +3,12 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; /** * Common proxy properties for all Azure SDKs. */ -public class ProxyProperties implements ProxyOptionsAware.Proxy { +public class ProxyProperties implements ProxyOptionsProvider.ProxyOptions { private String type; private String hostname; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java index 4afc542cf1131..d051a0b2265c4 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.core.properties.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import java.time.Duration; /** * Unified http retry properties for all Azure SDKs based on HTTP. */ -public class AmqpRetryProperties extends RetryProperties implements RetryOptionsAware.AmqpRetry { +public class AmqpRetryProperties extends RetryProperties implements RetryOptionsProvider.AmqpRetryOptions { /** * How long to wait until a timeout. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java index 44a89859530bb..5432a42ea5130 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.core.properties.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import java.time.Duration; /** * Common retry properties for all Azure SDKs. */ -public class RetryProperties implements RetryOptionsAware.Retry { +public class RetryProperties implements RetryOptionsProvider.RetryOptions { /** * The maximum number of attempts. @@ -19,7 +19,7 @@ public class RetryProperties implements RetryOptionsAware.Retry { /** * The mode for retry backoff. */ - private RetryOptionsAware.RetryMode mode = RetryOptionsAware.RetryMode.EXPONENTIAL; + private RetryOptionsProvider.RetryMode mode = RetryOptionsProvider.RetryMode.EXPONENTIAL; /** * Amount of time to wait between retry attempts. */ @@ -29,10 +29,7 @@ public class RetryProperties implements RetryOptionsAware.Retry { */ private Duration maxDelay; - /** - * Get the maximum number of attempts. - * @return the maximum number of attempts. - */ + @Override public Integer getMaxRetries() { return maxRetries; } @@ -45,12 +42,8 @@ public void setMaxRetries(Integer maxRetries) { this.maxRetries = maxRetries; } - /** - * Get the mode for retry backoff. - * @return the mode for retry backoff. - */ @Override - public RetryOptionsAware.RetryMode getMode() { + public RetryOptionsProvider.RetryMode getMode() { return mode; } @@ -58,13 +51,11 @@ public RetryOptionsAware.RetryMode getMode() { * Set the mode for retry backoff. * @param mode the mode for retry backoff. */ - public void setMode(RetryOptionsAware.RetryMode mode) { + public void setMode(RetryOptionsProvider.RetryMode mode) { this.mode = mode; } - /** - * Get the amount of time to wait between retry attempts. - * @return The delay to wait between retry attempts. - */ + + @Override public Duration getBaseDelay() { return baseDelay; } @@ -77,10 +68,7 @@ public void setBaseDelay(Duration baseDelay) { this.baseDelay = baseDelay; } - /** - * Get the maximum permissible amount of time between retry attempts. - * @return The maximum permissible amount of time between retry attempts. - */ + @Override public Duration getMaxDelay() { return maxDelay; } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java index b6a64efa4196a..0d9c5d9070d06 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java @@ -25,42 +25,64 @@ private AzureServiceType() { /** * The Service Bus service. */ - public static class ServiceBus { + public static final class ServiceBus { + private ServiceBus() { + + } } /** * The Event Hub service. */ - public static class EventHubs { + public static final class EventHubs { + + private EventHubs() { + + } } /** * The Storage Blob service. */ - public static class StorageBlob { + public static final class StorageBlob { + private StorageBlob() { + + } } /** * The Storage File Share service. */ - public static class StorageFileShare { + public static final class StorageFileShare { + + private StorageFileShare() { + + } } /** * The Storage Queue service. */ - public static class StorageQueue { + public static final class StorageQueue { + + private StorageQueue() { + + } } /** * The App Configuration service. */ - public static class AppConfiguration { + public static final class AppConfiguration { + + private AppConfiguration() { + + } } } diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java index 367e8fae84d7d..2e666ba3f54e6 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java @@ -5,7 +5,7 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.util.Configuration; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; @@ -204,7 +204,7 @@ public void setCustomizedTimes(int customizedTimes) { } } - static class AzureTestProperties extends AzureSdkProperties implements ConnectionStringAware, RetryOptionsAware { + static class AzureTestProperties extends AzureSdkProperties implements ConnectionStringAware, RetryOptionsProvider { private String connectionString; private final ClientProperties client = new ClientProperties(); private final ProxyProperties proxy = new ProxyProperties(); diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java index 7856aa6c189b4..c4c0063ddd43c 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.AmqpRetryMode; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; import org.junit.jupiter.api.Test; @@ -23,7 +23,7 @@ void correctlyConverted() { source.setBaseDelay(Duration.ofSeconds(2)); source.setMaxDelay(Duration.ofSeconds(3)); source.setTryTimeout(Duration.ofSeconds(4)); - source.setMode(RetryOptionsAware.RetryMode.EXPONENTIAL); + source.setMode(RetryOptionsProvider.RetryMode.EXPONENTIAL); AmqpRetryOptions target = AzureAmqpRetryOptionsConverter.AMQP_RETRY_CONVERTER.convert(source); @@ -44,12 +44,12 @@ void correctlyConvertRetryMode() { assertNotNull(target); assertEquals(AmqpRetryMode.EXPONENTIAL, target.getMode()); - source.setMode(RetryOptionsAware.RetryMode.EXPONENTIAL); + source.setMode(RetryOptionsProvider.RetryMode.EXPONENTIAL); target = AzureAmqpRetryOptionsConverter.AMQP_RETRY_CONVERTER.convert(source); assertNotNull(target); assertEquals(AmqpRetryMode.EXPONENTIAL, target.getMode()); - source.setMode(RetryOptionsAware.RetryMode.FIXED); + source.setMode(RetryOptionsProvider.RetryMode.FIXED); target = AzureAmqpRetryOptionsConverter.AMQP_RETRY_CONVERTER.convert(source); assertNotNull(target); assertEquals(AmqpRetryMode.FIXED, target.getMode()); diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java index 547e0d2fd6b37..09edd641299c5 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java @@ -6,7 +6,7 @@ import com.azure.core.http.policy.ExponentialBackoffOptions; import com.azure.core.http.policy.FixedDelayOptions; import com.azure.core.http.policy.RetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.retry.RetryProperties; import org.junit.jupiter.api.Test; @@ -24,7 +24,7 @@ void correctlyConvertedExponentialRetry() { source.setMaxRetries(1); source.setBaseDelay(Duration.ofSeconds(2)); source.setMaxDelay(Duration.ofSeconds(3)); - source.setMode(RetryOptionsAware.RetryMode.EXPONENTIAL); + source.setMode(RetryOptionsProvider.RetryMode.EXPONENTIAL); RetryOptions target = AzureHttpRetryOptionsConverter.HTTP_RETRY_CONVERTER.convert(source); @@ -43,7 +43,7 @@ void correctlyConvertedFixedRetry() { source.setMaxRetries(1); source.setBaseDelay(Duration.ofSeconds(2)); source.setMaxDelay(Duration.ofSeconds(3)); - source.setMode(RetryOptionsAware.RetryMode.FIXED); + source.setMode(RetryOptionsProvider.RetryMode.FIXED); RetryOptions target = AzureHttpRetryOptionsConverter.HTTP_RETRY_CONVERTER.convert(source); diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java index 0d93bab3caa67..a0023a5ce9176 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.util; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.TokenCredentialProperties; @@ -17,9 +17,9 @@ import java.time.Duration; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsAware.CloudType.OTHER; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; /** @@ -166,7 +166,7 @@ void testCopyPropertiesSourceNotChanged() { } - static class AzurePropertiesA implements AzureProperties, RetryOptionsAware { + static class AzurePropertiesA implements AzureProperties, RetryOptionsProvider { private final ClientProperties client = new ClientProperties(); private final ProxyProperties proxy = new ProxyProperties(); @@ -200,7 +200,7 @@ public AzureProfileProperties getProfile() { } } - static class AzurePropertiesB implements AzureProperties, RetryOptionsAware { + static class AzurePropertiesB implements AzureProperties, RetryOptionsProvider { private final ClientProperties client = new ClientProperties(); private final ProxyProperties proxy = new ProxyProperties(); diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java index 70f150f14a773..73a76ae310bf5 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java @@ -4,14 +4,14 @@ package com.azure.spring.cloud.service.implementation.appconfiguration; import com.azure.data.appconfiguration.ConfigurationServiceVersion; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Properties for Azure App Configuration Client {@link com.azure.data.appconfiguration.ConfigurationClient}. */ -public interface ConfigurationClientProperties extends AzureProperties, RetryOptionsAware, ConnectionStringAware { +public interface ConfigurationClientProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { /** * Get the service endpoint. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java index f5d6b3f4bbcec..64ec3b069ac7a 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java @@ -11,7 +11,7 @@ import com.azure.cosmos.DirectConnectionConfig; import com.azure.cosmos.GatewayConnectionConfig; import com.azure.cosmos.ThrottlingRetryOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsAware; +import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.KeyAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; @@ -70,7 +70,7 @@ protected List> getAuthenticationDescriptors(CosmosC @Override protected void configureProxy(CosmosClientBuilder builder) { - ProxyOptionsAware.Proxy proxy = this.cosmosClientProperties.getProxy(); + ProxyOptionsProvider.ProxyOptions proxy = this.cosmosClientProperties.getProxy(); this.proxyOptions = HTTP_PROXY_CONVERTER.convert(proxy); if (this.proxyOptions == null) { LOGGER.debug("No proxy properties available."); diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java index c905e700eab53..8dff83bada0ae 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.service.implementation.eventhubs.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Azure Event Hubs common related properties. */ -public interface EventHubClientCommonProperties extends AzureProperties, RetryOptionsAware, ConnectionStringAware { +public interface EventHubClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { /** * Get the fully qualified namespace. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java index e21265bd37b31..3355c9f067480 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java @@ -3,13 +3,13 @@ package com.azure.spring.cloud.service.implementation.keyvault; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Common properties for Azure Key Vault */ -public interface KeyVaultProperties extends AzureProperties, RetryOptionsAware { +public interface KeyVaultProperties extends AzureProperties, RetryOptionsProvider { String getEndpoint(); diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java index ed1049fc61f8a..86d20b6a6b38d 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.servicebus.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; @@ -11,7 +11,7 @@ /** * */ -public interface ServiceBusClientCommonProperties extends AzureProperties, RetryOptionsAware, ConnectionStringAware { +public interface ServiceBusClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { String getFullyQualifiedNamespace(); diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java index b7983f62206e1..b14041a5caa9e 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java @@ -9,7 +9,7 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.lang.NonNull; -import static com.azure.spring.cloud.core.aware.RetryOptionsAware.RetryMode.EXPONENTIAL; +import static com.azure.spring.cloud.core.aware.RetryOptionsProvider.RetryMode.EXPONENTIAL; /** * Converts a {@link StorageRetry} to a {@link RequestRetryOptions}. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java index 852c6d52a048d..e62473cda811b 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.service.implementation.storage.common; import com.azure.core.http.policy.RetryPolicy; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.storage.common.policy.RequestRetryOptions; @@ -31,10 +31,10 @@ public abstract class AbstractAzureStorageClientBuilderFactory extends Abstra @Override protected void configureRetry(T builder) { - RetryOptionsAware.Retry retry; + RetryOptionsProvider.RetryOptions retry; AzureProperties azureProperties = getAzureProperties(); - if (azureProperties instanceof RetryOptionsAware) { - retry = ((RetryOptionsAware) azureProperties).getRetry(); + if (azureProperties instanceof RetryOptionsProvider) { + retry = ((RetryOptionsProvider) azureProperties).getRetry(); } else { LOGGER.warn("The properties {} is not of type RetryOptionsAware", azureProperties.getClass().getName()); return; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java index f2f3ed8e818d4..87a600044274e 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.storage.common; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; import com.azure.spring.cloud.core.properties.AzureProperties; @@ -11,7 +11,7 @@ /** * Common properties for all Azure Storage services. */ -public interface StorageProperties extends AzureProperties, RetryOptionsAware, SasTokenAware, ConnectionStringAware { +public interface StorageProperties extends AzureProperties, RetryOptionsProvider, SasTokenAware, ConnectionStringAware { /** * Get the storage endpoint. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java index 8450c5096db6c..ff70bf2e1ac81 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.service.implementation.storage.common; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import java.time.Duration; /** * Interface to be implemented by classes that wish to describe storage sdks related retry operations. */ -public interface StorageRetry extends RetryOptionsAware.Retry { +public interface StorageRetry extends RetryOptionsProvider.RetryOptions { /** * Get the secondary host for retry. diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java index eb79dc333c9b1..a93c378f69c3f 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.credential; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.TokenCredentialProperties; import com.azure.spring.cloud.core.properties.client.ClientProperties; @@ -11,7 +11,7 @@ import com.azure.spring.cloud.core.properties.proxy.ProxyProperties; import com.azure.spring.cloud.core.properties.retry.RetryProperties; -public class AzureGlobalTestProperties implements AzureProperties, RetryOptionsAware { +public class AzureGlobalTestProperties implements AzureProperties, RetryOptionsProvider { private final TokenCredentialProperties credential = new TokenCredentialProperties(); private final AzureProfileProperties profile = new AzureProfileProperties(); diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java index 1fd63b5b07588..d280c857daec0 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.storage; -import com.azure.spring.cloud.core.aware.RetryOptionsAware; +import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.service.implementation.storage.common.StorageRetryProperties; import com.azure.storage.common.policy.RequestRetryOptions; import org.junit.jupiter.api.Test; @@ -23,7 +23,7 @@ void correctlyConvertedExponential() { source.setBaseDelay(Duration.ofSeconds(2)); source.setMaxDelay(Duration.ofSeconds(3)); source.setTryTimeout(Duration.ofSeconds(4)); - source.setMode(RetryOptionsAware.RetryMode.EXPONENTIAL); + source.setMode(RetryOptionsProvider.RetryMode.EXPONENTIAL); RequestRetryOptions target = AzureStorageRetryOptionsConverter.STORAGE_RETRY_CONVERTER.convert(source); @@ -44,7 +44,7 @@ void correctlyConvertedFixed() { source.setBaseDelay(Duration.ofSeconds(2)); source.setMaxDelay(Duration.ofSeconds(3)); source.setTryTimeout(Duration.ofSeconds(4)); - source.setMode(RetryOptionsAware.RetryMode.FIXED); + source.setMode(RetryOptionsProvider.RetryMode.FIXED); RequestRetryOptions target = AzureStorageRetryOptionsConverter.STORAGE_RETRY_CONVERTER.convert(source); diff --git a/sdk/spring/spring-messaging-azure/src/test/java/com/azure/spring/messaging/implementation/config/EnableAzureMessagingTests.java b/sdk/spring/spring-messaging-azure/src/test/java/com/azure/spring/messaging/implementation/config/EnableAzureMessagingTests.java index a26e21818be1d..b90eea8c242a4 100644 --- a/sdk/spring/spring-messaging-azure/src/test/java/com/azure/spring/messaging/implementation/config/EnableAzureMessagingTests.java +++ b/sdk/spring/spring-messaging-azure/src/test/java/com/azure/spring/messaging/implementation/config/EnableAzureMessagingTests.java @@ -12,7 +12,6 @@ import com.azure.spring.messaging.listener.MessageListenerTestContainer; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.BeanCreationException; -import org.springframework.beans.factory.ObjectProvider; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; @@ -21,7 +20,6 @@ import org.springframework.core.annotation.AliasFor; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.stereotype.Component; -import org.springframework.util.ErrorHandler; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; From 0a7e2140125979b7c28b6536719f737efceb75ca Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 12:08:44 +0800 Subject: [PATCH 02/14] fix javadocs --- .../jms/properties/AzureServiceBusJmsProperties.java | 8 ++++---- .../converter/AzureAmqpRetryOptionsConverter.java | 3 +-- .../converter/AzureHttpLogOptionsConverter.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java index d06328c3ae781..37034e9cbc9aa 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java @@ -154,16 +154,16 @@ public void setTopicClientId(String topicClientId) { } /** - * Get the pricing tier for a service bus namespace. - * @return the pricing tier for a service bus namespace. + * Get the pricing tier for a Service Bus namespace. + * @return the pricing tier for a Service Bus namespace. */ public String getPricingTier() { return this.pricingTier; } /** - * Set the pricing tier for a service bus namespace. - * @param pricingTier the pricing tier for a service bus namespace. + * Set the pricing tier for a Service Bus namespace. + * @param pricingTier the pricing tier for a Service Bus namespace. */ public void setPricingTier(String pricingTier) { this.pricingTier = pricingTier; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java index 60d69e9a72fc0..26c3af74c8f5a 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java @@ -7,11 +7,10 @@ import com.azure.core.amqp.AmqpRetryOptions; import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; -import com.azure.spring.cloud.core.properties.retry.RetryProperties; import org.springframework.core.convert.converter.Converter; /** - * Converts a {@link RetryProperties} to a {@link AmqpRetryOptions}. + * Converts a {@link RetryOptionsProvider.AmqpRetryOptions} to a {@link AmqpRetryOptions}. */ public final class AzureAmqpRetryOptionsConverter implements Converter { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java index cbb73d4ff00dc..76c98bf55edf6 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java @@ -8,7 +8,7 @@ import org.springframework.core.convert.converter.Converter; /** - * Converts a {@link HttpLoggingOptionsProvider} to a {@link HttpLogOptions}. + * Converts a {@link HttpLoggingOptionsProvider.HttpLoggingOptions} to a {@link HttpLogOptions}. */ public final class AzureHttpLogOptionsConverter implements Converter { From 32083297216612a7714670ec60edf78277697426 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 12:44:50 +0800 Subject: [PATCH 03/14] refactor package names --- .../AadProfileEnvironmentProperties.java | 2 +- .../aad/properties/AadProfileProperties.java | 2 +- ...zureAppConfigurationAutoConfiguration.java | 6 ++--- .../context/AzureGlobalProperties.java | 2 +- ...AzureTokenCredentialAutoConfiguration.java | 2 +- .../AzureEventHubsAutoConfiguration.java | 2 +- ...reEventHubsClientBuilderConfiguration.java | 4 ++-- ...eEventHubsConsumerClientConfiguration.java | 4 ++-- ...EventHubsProcessorClientConfiguration.java | 4 ++-- ...eEventHubsProducerClientConfiguration.java | 4 ++-- .../AzureEventHubsKafkaAutoConfiguration.java | 10 ++++---- ...tractAzureAmqpConfigurationProperties.java | 2 +- ...tractAzureHttpConfigurationProperties.java | 2 +- .../AmqpClientConfigurationProperties.java | 2 +- .../HttpClientConfigurationProperties.java | 2 +- .../AmqpProxyConfigurationProperties.java | 2 +- .../HttpProxyConfigurationProperties.java | 2 +- .../AmqpRetryConfigurationProperties.java | 2 +- .../utils/AzureGlobalPropertiesUtils.java | 6 ++--- ...viceBusJmsPropertiesBeanPostProcessor.java | 8 +++---- .../jms/ServiceBusJmsAutoConfiguration.java | 4 ++-- ...okenCredentialConfigurationProperties.java | 2 +- .../client/ClientConfigurationProperties.java | 2 +- .../HttpLoggingConfigurationProperties.java | 2 +- .../AzureProfileConfigurationProperties.java | 2 +- .../proxy/ProxyConfigurationProperties.java | 2 +- .../retry/RetryConfigurationProperties.java | 2 +- ...eServiceBusClientBuilderConfiguration.java | 6 ++--- ...ServiceBusConsumerClientConfiguration.java | 6 ++--- ...erviceBusProcessorClientConfiguration.java | 6 ++--- ...ServiceBusProducerClientConfiguration.java | 4 ++-- .../AzureStorageBlobAutoConfiguration.java | 6 ++--- ...zureStorageFileShareAutoConfiguration.java | 6 ++--- .../AzureStorageQueueAutoConfiguration.java | 6 ++--- .../AzureServiceConfigurationBaseTests.java | 6 ++--- ...gurationEnvironmentPostProcessorTests.java | 2 +- ...lobalPropertiesAutoConfigurationTests.java | 8 +++---- .../AzureEventHubsAutoConfigurationTests.java | 2 +- ...eEventHubsKafkaAutoConfigurationTests.java | 2 +- .../ServiceBusJmsAutoConfigurationTests.java | 2 +- ...AzureServiceBusAutoConfigurationTests.java | 2 +- ...iceBusClientBuilderConfigurationTests.java | 2 +- .../amqp/ServiceBusUserAgentTests.java | 2 +- .../spring/cloud/core/aware/package-info.java | 7 ------ .../ConnectionStringProvider.java | 23 ------------------- .../AzureAmqpProxyOptionsConverter.java | 2 +- .../AzureAmqpRetryOptionsConverter.java | 2 +- .../AzureHttpLogOptionsConverter.java | 2 +- .../AzureHttpProxyOptionsConverter.java | 2 +- .../AzureHttpRetryOptionsConverter.java | 2 +- .../resolver/AzureKeyCredentialResolver.java | 6 ++--- .../AzureNamedKeyCredentialResolver.java | 6 ++--- .../resolver/AzureSasCredentialResolver.java | 6 ++--- .../AzureTokenCredentialResolver.java | 2 +- ...AbstractAzureAmqpClientBuilderFactory.java | 8 +++---- ...AbstractAzureHttpClientBuilderFactory.java | 8 +++---- ...tractAzureServiceClientBuilderFactory.java | 18 +++++++-------- ...AbstractAzureCredentialBuilderFactory.java | 2 +- .../AzureAadCredentialBuilderFactory.java | 2 +- ...ntCertificateCredentialBuilderFactory.java | 2 +- .../ClientSecretCredentialBuilderFactory.java | 2 +- .../DefaultAzureCredentialBuilderFactory.java | 2 +- ...nagedIdentityCredentialBuilderFactory.java | 2 +- ...rnamePasswordCredentialBuilderFactory.java | 2 +- .../properties/AzureAmqpSdkProperties.java | 2 +- .../properties/AzureHttpSdkProperties.java | 2 +- .../util/AzurePropertiesUtils.java | 4 ++-- .../core/properties/AzureProperties.java | 8 +++---- .../TokenCredentialProperties.java | 2 +- .../client/AmqpClientProperties.java | 2 +- .../properties/client/ClientProperties.java | 2 +- .../client/HttpClientProperties.java | 2 +- .../client/HttpLoggingProperties.java | 2 +- .../profile/AzureEnvironmentProperties.java | 2 +- .../profile/AzureProfileOptionsAdapter.java | 2 +- .../profile/AzureProfileProperties.java | 2 +- .../properties/proxy/AmqpProxyProperties.java | 2 +- .../properties/proxy/HttpProxyProperties.java | 2 +- .../properties/proxy/ProxyProperties.java | 2 +- .../properties/retry/AmqpRetryProperties.java | 2 +- .../properties/retry/RetryProperties.java | 2 +- .../AzureProfileOptionsProvider.java | 4 ++-- .../ClientOptionsProvider.java | 4 ++-- .../HttpLoggingOptionsProvider.java | 6 ++--- .../ProxyOptionsProvider.java | 4 ++-- .../RetryOptionsProvider.java | 4 ++-- .../authentication/KeyProvider.java} | 6 ++--- .../authentication/NamedKeyProvider.java} | 6 ++--- .../authentication/SasTokenProvider.java} | 6 ++--- .../TokenCredentialOptionsProvider.java | 4 ++-- .../authentication/package-info.java | 2 +- .../ConnectionStringProvider.java} | 6 ++--- .../ServiceConnectionStringProvider.java | 17 ++++++++++++++ .../StaticConnectionStringProvider.java | 6 ++--- .../connectionstring/package-info.java | 2 +- .../cloud/core/provider/package-info.java | 7 ++++++ .../cloud/core/service/AzureServiceType.java | 4 ++-- .../AzureCredentialResolversTests.java | 8 +++---- ...AzureServiceClientBuilderFactoryTests.java | 8 +++---- .../AzureAmqpRetryOptionsConverterTests.java | 2 +- .../AzureHttpRetryOptionsConverterTests.java | 2 +- .../AzureKeyCredentialResolverTests.java | 4 ++-- .../AzureNamedKeyCredentialResolverTests.java | 4 ++-- .../AzureSasCredentialResolverTests.java | 4 ++-- .../core/util/AzurePropertiesUtilsTests.java | 8 +++---- .../ArmConnectionStringProvider.java | 4 ++-- .../ConfigurationClientProperties.java | 6 ++--- .../cosmos/CosmosClientBuilderFactory.java | 2 +- .../cosmos/CosmosClientProperties.java | 4 ++-- .../EventHubClientCommonProperties.java | 6 ++--- .../keyvault/KeyVaultProperties.java | 2 +- .../ServiceBusClientCommonProperties.java | 6 ++--- .../AzureStorageRetryOptionsConverter.java | 2 +- ...tractAzureStorageClientBuilderFactory.java | 4 ++-- .../storage/common/StorageProperties.java | 8 +++---- .../storage/common/StorageRetry.java | 2 +- .../credential/AzureGlobalTestProperties.java | 2 +- .../ServiceBusClientCommonTestProperties.java | 6 ++--- ...zureStorageRetryOptionsConverterTests.java | 2 +- .../core/properties/CommonProperties.java | 4 ++-- 120 files changed, 243 insertions(+), 249 deletions(-) delete mode 100644 sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/package-info.java delete mode 100644 sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/ConnectionStringProvider.java rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/AzureProfileOptionsProvider.java (97%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/ClientOptionsProvider.java (94%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/HttpLoggingOptionsProvider.java (91%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/ProxyOptionsProvider.java (92%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/RetryOptionsProvider.java (91%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware/authentication/KeyAware.java => provider/authentication/KeyProvider.java} (53%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware/authentication/NamedKeyAware.java => provider/authentication/NamedKeyProvider.java} (64%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware/authentication/SasTokenAware.java => provider/authentication/SasTokenProvider.java} (54%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/authentication/TokenCredentialOptionsProvider.java (90%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware => provider}/authentication/package-info.java (75%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{aware/authentication/ConnectionStringAware.java => provider/connectionstring/ConnectionStringProvider.java} (54%) create mode 100644 sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ServiceConnectionStringProvider.java rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{ => provider}/connectionstring/StaticConnectionStringProvider.java (80%) rename sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/{ => provider}/connectionstring/package-info.java (73%) create mode 100644 sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/package-info.java diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java index 81425717978ae..3df71d4b99e6a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.aad.properties; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.properties.profile.AzureProfileOptionsAdapter; /** diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java index ac005504dfff6..1b2525d535764 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.aad.properties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java index f3b642bb867f7..e68181f93f32f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/appconfiguration/AzureAppConfigurationAutoConfiguration.java @@ -11,8 +11,8 @@ import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.appconfiguration.AzureAppConfigurationProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.appconfiguration.ConfigurationClientBuilderFactory; @@ -73,7 +73,7 @@ ConfigurationClientBuilder configurationClientBuilder(ConfigurationClientBuilder @ConditionalOnMissingBean ConfigurationClientBuilderFactory configurationClientBuilderFactory( AzureAppConfigurationProperties properties, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ConfigurationClientBuilderFactory factory = new ConfigurationClientBuilderFactory(properties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java index d4fbedd3df62f..462fb3aea263c 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalProperties.java @@ -10,7 +10,7 @@ import com.azure.spring.cloud.autoconfigure.properties.core.profile.AzureProfileConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.client.HeaderProperties; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java index bfdf54da2b4f5..6ceefdb3d3634 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/context/AzureTokenCredentialAutoConfiguration.java @@ -11,7 +11,7 @@ import com.azure.identity.UsernamePasswordCredentialBuilder; import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.AbstractAzureHttpConfigurationProperties; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureTokenCredentialResolver; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureServiceClientBuilderFactory; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfiguration.java index 9f9b502d79013..1782805a146cd 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfiguration.java @@ -8,7 +8,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsClientBuilderConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsClientBuilderConfiguration.java index 7b9b84e1665b8..3c5c27ee26541 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsClientBuilderConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsClientBuilderConfiguration.java @@ -7,7 +7,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.eventhubs.factory.EventHubClientBuilderFactory; @@ -39,7 +39,7 @@ EventHubClientBuilder eventHubClientBuilder(@Qualifier(EVENT_HUB_CLIENT_BUILDER_ @Bean(EVENT_HUB_CLIENT_BUILDER_FACTORY_BEAN_NAME) @ConditionalOnMissingBean EventHubClientBuilderFactory eventHubClientBuilderFactory(AzureEventHubsProperties properties, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final EventHubClientBuilderFactory factory = new EventHubClientBuilderFactory(properties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsConsumerClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsConsumerClientConfiguration.java index afed7ce04eba0..6c0f3ce1a3135 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsConsumerClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsConsumerClientConfiguration.java @@ -10,7 +10,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnMissingProperty; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.eventhubs.factory.EventHubClientBuilderFactory; @@ -82,7 +82,7 @@ static class DedicatedConsumerConnectionConfiguration { @Bean(EVENT_HUB_CONSUMER_CLIENT_BUILDER_FACTORY_BEAN_NAME) @ConditionalOnMissingBean(name = EVENT_HUB_CONSUMER_CLIENT_BUILDER_FACTORY_BEAN_NAME) EventHubClientBuilderFactory eventHubClientBuilderFactoryForConsumer( - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final EventHubClientBuilderFactory factory = new EventHubClientBuilderFactory(this.consumerProperties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProcessorClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProcessorClientConfiguration.java index d92616d5c997f..4b782739ee552 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProcessorClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProcessorClientConfiguration.java @@ -9,7 +9,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.eventhubs.consumer.EventHubsErrorHandler; @@ -53,7 +53,7 @@ EventProcessorClientBuilderFactory eventProcessorClientBuilderFactory( CheckpointStore checkpointStore, EventHubsMessageListener messageListener, EventHubsErrorHandler errorHandler, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final EventProcessorClientBuilderFactory factory = new EventProcessorClientBuilderFactory(this.processorProperties, checkpointStore, messageListener, errorHandler); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProducerClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProducerClientConfiguration.java index 06c03f4e72115..b1206874116be 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProducerClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsProducerClientConfiguration.java @@ -10,7 +10,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnMissingProperty; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.eventhubs.factory.EventHubClientBuilderFactory; @@ -64,7 +64,7 @@ static class DedicatedProducerConnectionConfiguration { @Bean(EVENT_HUB_PRODUCER_CLIENT_BUILDER_FACTORY_BEAN_NAME) @ConditionalOnMissingBean(name = EVENT_HUB_PRODUCER_CLIENT_BUILDER_FACTORY_BEAN_NAME) EventHubClientBuilderFactory eventHubClientBuilderFactoryForProducer( - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final EventHubClientBuilderFactory factory = new EventHubClientBuilderFactory(this.producerProperties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java index 678ae83411ee4..d16565d60f4aa 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/eventhubs/kafka/AzureEventHubsKafkaAutoConfiguration.java @@ -5,8 +5,8 @@ import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsAutoConfiguration; import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureEventHubsResourceManagerAutoConfiguration; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.implementation.connectionstring.EventHubsConnectionString; import com.azure.spring.cloud.core.service.AzureServiceType; import org.slf4j.Logger; @@ -47,7 +47,7 @@ public class AzureEventHubsKafkaAutoConfiguration { */ @Bean @ConditionalOnProperty("spring.cloud.azure.eventhubs.connection-string") - @ConditionalOnMissingBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ConnectionStringProvider.class) + @ConditionalOnMissingBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ServiceConnectionStringProvider.class) public StaticConnectionStringProvider eventHubsKafkaConnectionString(Environment environment) { String connectionString = environment.getProperty("spring.cloud.azure.eventhubs.connection-string"); @@ -69,9 +69,9 @@ public StaticConnectionStringProvider eventHubsKafka */ @Primary @Bean - @ConditionalOnBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ConnectionStringProvider.class) + @ConditionalOnBean(value = AzureServiceType.EventHubs.class, parameterizedContainer = ServiceConnectionStringProvider.class) public KafkaProperties azureKafkaProperties( - ConnectionStringProvider connectionStringProvider) { + ServiceConnectionStringProvider connectionStringProvider) { KafkaProperties kafkaProperties = new KafkaProperties(); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java index fbe3cb2fb27c3..0ccfe5509a71a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureAmqpConfigurationProperties.java @@ -6,7 +6,7 @@ import com.azure.spring.cloud.autoconfigure.implementation.properties.core.client.AmqpClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy.AmqpProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.retry.AmqpRetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java index 6458872c0362c..1fad07eed21aa 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/AbstractAzureHttpConfigurationProperties.java @@ -6,7 +6,7 @@ import com.azure.spring.cloud.autoconfigure.implementation.properties.core.client.HttpClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy.HttpProxyConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java index 7e242f76334ad..7c39143aa426b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/AmqpClientConfigurationProperties.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.spring.cloud.autoconfigure.properties.core.client.ClientConfigurationProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; /** * diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java index 90c71ea6435e8..6df404bc846f0 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/client/HttpClientConfigurationProperties.java @@ -5,7 +5,7 @@ import com.azure.spring.cloud.autoconfigure.properties.core.client.ClientConfigurationProperties; import com.azure.spring.cloud.autoconfigure.properties.core.client.HttpLoggingConfigurationProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; import com.azure.spring.cloud.core.properties.client.HeaderProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java index a7db424c94b39..9df90a041f4bf 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/AmqpProxyConfigurationProperties.java @@ -5,7 +5,7 @@ import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Proxy properties for all Azure AMQP SDKs. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java index e2ae1df1814a6..3cf0b0b4bf89f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/proxy/HttpProxyConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.core.proxy; import com.azure.spring.cloud.autoconfigure.properties.core.proxy.ProxyConfigurationProperties; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Proxy properties for all Azure HTTP SDKs. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java index d4f1f4e6e91da..6af8200495059 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/retry/AmqpRetryConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.core.retry; import com.azure.spring.cloud.autoconfigure.properties.core.retry.RetryConfigurationProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import java.time.Duration; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java index 36bd0c5363f2a..377fccb2fabf3 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/utils/AzureGlobalPropertiesUtils.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.autoconfigure.implementation.properties.utils; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.beans.BeanUtils; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesBeanPostProcessor.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesBeanPostProcessor.java index 23fb56f864e95..d33581162bdac 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesBeanPostProcessor.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesBeanPostProcessor.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.jms; import com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import org.springframework.beans.BeansException; import org.springframework.beans.factory.ObjectProvider; @@ -12,13 +12,13 @@ import org.springframework.util.StringUtils; /** - * {@link BeanPostProcessor} to apply a {@link ConnectionStringProvider} to {@link AzureServiceBusJmsProperties}. + * {@link BeanPostProcessor} to apply a {@link ServiceConnectionStringProvider} to {@link AzureServiceBusJmsProperties}. */ class AzureServiceBusJmsPropertiesBeanPostProcessor implements BeanPostProcessor { - private final ObjectProvider> connectionStringProviders; + private final ObjectProvider> connectionStringProviders; - AzureServiceBusJmsPropertiesBeanPostProcessor(ObjectProvider> connectionStringProviders) { + AzureServiceBusJmsPropertiesBeanPostProcessor(ObjectProvider> connectionStringProviders) { this.connectionStringProviders = connectionStringProviders; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java index 6414e0d776461..a4e9c69c79bd1 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfiguration.java @@ -6,7 +6,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnMissingProperty; import com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties; import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureServiceBusResourceManagerAutoConfiguration; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import org.apache.qpid.jms.JmsConnectionExtensions; import org.apache.qpid.jms.JmsConnectionFactory; @@ -67,7 +67,7 @@ ServiceBusJmsConnectionFactoryCustomizer amqpOpenPropertiesCustomizer() { @ConditionalOnMissingBean @ConditionalOnMissingProperty(prefix = "spring.jms.servicebus", name = "connection-string") public static AzureServiceBusJmsPropertiesBeanPostProcessor azureServiceBusJmsPropertiesBeanPostProcessor( - ObjectProvider> connectionStringProviders) { + ObjectProvider> connectionStringProviders) { return new AzureServiceBusJmsPropertiesBeanPostProcessor(connectionStringProviders); } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java index e586a5bcf16a2..94d08cd1a68b7 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/authentication/TokenCredentialConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.authentication; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * Azure properties used for getting token credential. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java index 9beeaf95e1249..4a0ddc2a88575 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/ClientConfigurationProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.client; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; /** * diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java index db206b1e8ae24..fde9255cc6bcd 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/client/HttpLoggingConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.client; import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; +import com.azure.spring.cloud.core.provider.HttpLoggingOptionsProvider; import java.util.HashSet; import java.util.Set; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java index f32af739862e2..50251ac49276e 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.properties.profile.AzureProfileOptionsAdapter; /** diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java index 6e0d3fbebb316..64893d86be796 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/proxy/ProxyConfigurationProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Common proxy properties for all Azure SDKs. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java index 0fccde6a0bfdb..fa95fb429c8ed 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/retry/RetryConfigurationProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.autoconfigure.properties.core.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import java.time.Duration; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfiguration.java index 970153348ba9a..afb57f398cb5f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfiguration.java @@ -7,8 +7,8 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusClientBuilderFactory; @@ -33,7 +33,7 @@ class AzureServiceBusClientBuilderConfiguration { @Bean @ConditionalOnMissingBean ServiceBusClientBuilderFactory serviceBusClientBuilderFactory( - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final ServiceBusClientBuilderFactory factory = new ServiceBusClientBuilderFactory(this.serviceBusProperties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusConsumerClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusConsumerClientConfiguration.java index be8d43522b23e..4b9e1e164d7f1 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusConsumerClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusConsumerClientConfiguration.java @@ -11,7 +11,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusReceiverClientBuilderFactory; @@ -47,7 +47,7 @@ static class NoneSessionConsumerClientConfiguration { ServiceBusReceiverClientBuilderFactory serviceBusReceiverClientBuilderFactory( AzureServiceBusProperties serviceBusProperties, ObjectProvider serviceBusClientBuilders, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ServiceBusReceiverClientBuilderFactory factory; @@ -96,7 +96,7 @@ static class SessionConsumerClientConfiguration { ServiceBusSessionReceiverClientBuilderFactory serviceBusSessionReceiverClientBuilderFactory( AzureServiceBusProperties serviceBusProperties, ObjectProvider serviceBusClientBuilders, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ServiceBusSessionReceiverClientBuilderFactory factory; if (isDedicatedConnection(serviceBusProperties.getConsumer())) { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProcessorClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProcessorClientConfiguration.java index 1e6be1a88ce55..fbc6c160cd83e 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProcessorClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProcessorClientConfiguration.java @@ -8,7 +8,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusProcessorClientBuilderFactory; @@ -49,7 +49,7 @@ ServiceBusProcessorClientBuilderFactory serviceBusProcessorClientBuilderFactory( ServiceBusMessageListener messageListener, ServiceBusErrorHandler errorHandler, ObjectProvider serviceBusClientBuilders, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ServiceBusProcessorClientBuilderFactory factory; @@ -100,7 +100,7 @@ ServiceBusSessionProcessorClientBuilderFactory serviceBusSessionProcessorClientB ServiceBusMessageListener messageListener, ServiceBusErrorHandler errorHandler, ObjectProvider serviceBusClientBuilders, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ServiceBusSessionProcessorClientBuilderFactory factory; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProducerClientConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProducerClientConfiguration.java index 37304fdf20e36..b75c142e3063f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProducerClientConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusProducerClientConfiguration.java @@ -9,7 +9,7 @@ import com.azure.spring.cloud.autoconfigure.condition.ConditionalOnAnyProperty; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusSenderClientBuilderFactory; @@ -33,7 +33,7 @@ class AzureServiceBusProducerClientConfiguration { ServiceBusSenderClientBuilderFactory serviceBusSenderClientBuilderFactory( AzureServiceBusProperties serviceBusProperties, ObjectProvider serviceBusClientBuilders, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ServiceBusSenderClientBuilderFactory factory; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java index 21a832298e73a..180531d1a194d 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.java @@ -8,8 +8,8 @@ import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.storage.blob.properties.AzureStorageBlobProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.storage.blob.BlobServiceClientBuilderFactory; @@ -109,7 +109,7 @@ public BlobServiceClient blobServiceClient( @ConditionalOnMissingBean(name = STORAGE_BLOB_CLIENT_BUILDER_FACTORY_BEAN_NAME) BlobServiceClientBuilderFactory blobServiceClientBuilderFactory( AzureStorageBlobProperties properties, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { BlobServiceClientBuilderFactory factory = new BlobServiceClientBuilderFactory(properties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java index aa140f7d86347..605047cc3c472 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.java @@ -8,8 +8,8 @@ import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.storage.fileshare.properties.AzureStorageFileShareProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.storage.fileshare.ShareServiceClientBuilderFactory; @@ -73,7 +73,7 @@ public ShareServiceAsyncClient shareServiceAsyncClient(ShareServiceClientBuilder @ConditionalOnMissingBean ShareServiceClientBuilderFactory shareServiceClientBuilderFactory( AzureStorageFileShareProperties properties, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { ShareServiceClientBuilderFactory factory = new ShareServiceClientBuilderFactory(properties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java index 7e7fdfa98846b..0b82e881587b8 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/storage/queue/AzureStorageQueueAutoConfiguration.java @@ -8,8 +8,8 @@ import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.storage.queue.properties.AzureStorageQueueProperties; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.storage.queue.QueueServiceClientBuilderFactory; @@ -84,7 +84,7 @@ QueueAsyncClient queueAsyncClient(QueueServiceAsyncClient queueServiceAsyncClien @ConditionalOnMissingBean QueueServiceClientBuilderFactory queueServiceClientBuilderFactory( AzureStorageQueueProperties properties, - ObjectProvider> connectionStringProviders, + ObjectProvider> connectionStringProviders, ObjectProvider> customizers) { final QueueServiceClientBuilderFactory factory = new QueueServiceClientBuilderFactory(properties); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java index 5677f6bdd2974..71707ad470226 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/AzureServiceConfigurationBaseTests.java @@ -26,9 +26,9 @@ import java.util.HashSet; import java.util.Set; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.OTHER; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java index 88824c999b9bb..e22e768909779 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalConfigurationEnvironmentPostProcessorTests.java @@ -6,7 +6,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import org.junit.jupiter.api.Test; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.env.EnvironmentPostProcessor; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java index 19e0752c01545..f016cedac7383 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/context/AzureGlobalPropertiesAutoConfigurationTests.java @@ -4,7 +4,7 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; @@ -12,9 +12,9 @@ import java.time.Duration; import java.util.Arrays; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.OTHER; import static org.assertj.core.api.Assertions.assertThat; class AzureGlobalPropertiesAutoConfigurationTests { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java index 20d2850719d7e..3b8d55ceea523 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java @@ -6,7 +6,7 @@ import com.azure.messaging.eventhubs.EventHubClientBuilder; import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java index d6aa0cd65fdf5..237c1635f7904 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsKafkaAutoConfigurationTests.java @@ -5,7 +5,7 @@ import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.eventhubs.kafka.AzureEventHubsKafkaAutoConfiguration; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.resourcemanager.implementation.connectionstring.ArmConnectionStringProvider; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfigurationTests.java index b59d2431101a8..12cae1432a1cf 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsAutoConfigurationTests.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.autoconfigure.jms; import com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import org.apache.qpid.jms.JmsConnectionFactory; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java index f0f10b6bead4a..5b36de2e1949a 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java @@ -8,7 +8,7 @@ import com.azure.messaging.servicebus.models.ServiceBusReceiveMode; import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.servicebus.properties.AzureServiceBusProperties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfigurationTests.java index 1a8d7a2415599..105f2398db6a1 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusClientBuilderConfigurationTests.java @@ -6,7 +6,7 @@ import com.azure.data.appconfiguration.ConfigurationClientBuilder; import com.azure.messaging.servicebus.ServiceBusClientBuilder; import com.azure.spring.cloud.autoconfigure.TestBuilderCustomizer; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusClientBuilderFactory; import org.junit.jupiter.api.Assertions; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/amqp/ServiceBusUserAgentTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/amqp/ServiceBusUserAgentTests.java index 321630502ed14..84eb9c845f07b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/amqp/ServiceBusUserAgentTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/amqp/ServiceBusUserAgentTests.java @@ -9,7 +9,7 @@ import com.azure.spring.cloud.autoconfigure.servicebus.AzureServiceBusAutoConfiguration; import com.azure.spring.cloud.autoconfigure.useragent.util.UserAgentTestUtil; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.service.implementation.servicebus.factory.ServiceBusClientBuilderFactory; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/package-info.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/package-info.java deleted file mode 100644 index efac12b446142..0000000000000 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * Aware abstraction for Azure service configuration properties. - */ -package com.azure.spring.cloud.core.aware; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/ConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/ConnectionStringProvider.java deleted file mode 100644 index 8323a015cbaf4..0000000000000 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/ConnectionStringProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.spring.cloud.core.connectionstring; - -/** - * - */ -public interface ConnectionStringProvider { - - /** - * Provide the connection string of the associated Azure service. - * @return The connection string. - */ - String getConnectionString(); - - /** - * Provide the service type this provider supports. - * @return The service type. - */ - T getServiceType(); - -} diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java index c1cce6044a403..2c24b48e64242 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.ProxyAuthenticationType; import com.azure.core.amqp.ProxyOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java index 26c3af74c8f5a..e4367dfee3ac1 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.AmqpRetryMode; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import org.springframework.core.convert.converter.Converter; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java index 76c98bf55edf6..0a83436b46ab3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpLogOptionsConverter.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.converter; import com.azure.core.http.policy.HttpLogOptions; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; +import com.azure.spring.cloud.core.provider.HttpLoggingOptionsProvider; import org.springframework.core.convert.converter.Converter; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java index b2d6e3ae3b408..289c3b71c8008 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.converter; import com.azure.core.http.ProxyOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java index f1ac4f3d7b6f3..fc3c6d21da20e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverter.java @@ -6,7 +6,7 @@ import com.azure.core.http.policy.ExponentialBackoffOptions; import com.azure.core.http.policy.FixedDelayOptions; import com.azure.core.http.policy.RetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.springframework.core.convert.converter.Converter; import org.springframework.lang.NonNull; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java index 4a1ba41e6c1e3..063ca8f48c7e8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureKeyCredential; -import com.azure.spring.cloud.core.aware.authentication.KeyAware; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; @@ -20,7 +20,7 @@ public AzureKeyCredential resolve(AzureProperties properties) { return null; } - String key = ((KeyAware) properties).getKey(); + String key = ((KeyProvider) properties).getKey(); if (!StringUtils.hasText(key)) { return null; } @@ -30,7 +30,7 @@ public AzureKeyCredential resolve(AzureProperties properties) { @Override public boolean isResolvable(AzureProperties properties) { - return properties instanceof KeyAware; + return properties instanceof KeyProvider; } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java index 85dc73dfccd03..366e79fb5999d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureNamedKeyCredential; -import com.azure.spring.cloud.core.aware.authentication.NamedKeyAware; +import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.NamedKeyProperties; @@ -21,7 +21,7 @@ public AzureNamedKeyCredential resolve(AzureProperties properties) { return null; } - NamedKeyProperties namedKey = ((NamedKeyAware) properties).getNamedKey(); + NamedKeyProperties namedKey = ((NamedKeyProvider) properties).getNamedKey(); if (namedKey == null || !StringUtils.hasText(namedKey.getName()) || !StringUtils.hasText(namedKey.getKey())) { return null; } @@ -31,7 +31,7 @@ public AzureNamedKeyCredential resolve(AzureProperties properties) { @Override public boolean isResolvable(AzureProperties properties) { - return properties instanceof NamedKeyAware; + return properties instanceof NamedKeyProvider; } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java index 90a0586d6ad17..b2168caeb1615 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureSasCredential; -import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; @@ -20,7 +20,7 @@ public AzureSasCredential resolve(AzureProperties properties) { return null; } - String sasToken = ((SasTokenAware) properties).getSasToken(); + String sasToken = ((SasTokenProvider) properties).getSasToken(); if (!StringUtils.hasText(sasToken)) { return null; } @@ -30,6 +30,6 @@ public AzureSasCredential resolve(AzureProperties properties) { @Override public boolean isResolvable(AzureProperties properties) { - return properties instanceof SasTokenAware; + return properties instanceof SasTokenProvider; } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java index 4628b72414c49..0e904f79062cb 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java @@ -8,7 +8,7 @@ import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.identity.ManagedIdentityCredentialBuilder; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java index b4591ac14828e..5ff70fd160411 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java @@ -7,9 +7,9 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.amqp.ProxyOptions; import com.azure.core.util.ClientOptions; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -115,7 +115,7 @@ protected void configureRetry(T builder) { AmqpRetryOptions retryOptions = AMQP_RETRY_CONVERTER.convert((RetryOptionsProvider.AmqpRetryOptions) retry); consumeAmqpRetryOptions().accept(builder, retryOptions); } else { - LOGGER.debug("The provided retry options is not a RetryOptionsAware.AmqpRetry type."); + LOGGER.debug("The provided retry options is not a RetryOptionsProvider.AmqpRetryOptions type."); } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java index 166fedc2d7a37..956054ac1c554 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java @@ -14,9 +14,9 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Header; import com.azure.core.util.HttpClientOptions; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.http.DefaultHttpProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; @@ -218,7 +218,7 @@ protected List
getHeaders() { return null; } if (!(client instanceof ClientOptionsProvider.HttpClientOptions)) { - LOGGER.debug("The clientOptions passed in is not of ClientOptionsAware.HttpClientOptions."); + LOGGER.debug("The clientOptions passed in is not of ClientOptionsProvider.HttpClientOptions."); return null; } ClientOptionsProvider.HttpClientOptions httpClientOptions = (ClientOptionsProvider.HttpClientOptions) client; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java index 6a394b81757a7..7165e9175e213 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java @@ -7,11 +7,11 @@ import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.credential.AzureCredentialResolvers; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureTokenCredentialResolver; @@ -103,7 +103,7 @@ public abstract class AbstractAzureServiceClientBuilderFactory implements Azu protected abstract BiConsumer consumeConnectionString(); private String springIdentifier; - private ConnectionStringProvider connectionStringProvider; + private ServiceConnectionStringProvider connectionStringProvider; private boolean credentialConfigured = false; private final List> customizers = new ArrayList<>(); protected final Configuration configuration = new Configuration(); @@ -215,8 +215,8 @@ protected void configureCredential(T builder) { /** * Configure the connection string to the builder. It will try to resolve a connection string from the - * {@link AzureProperties}, if it is a {@link ConnectionStringAware} instance. If no connection string found from - * the {@link AzureProperties}, it will check if any {@link ConnectionStringProvider} is provided and get the + * {@link AzureProperties}, if it is a {@link ConnectionStringProvider} instance. If no connection string found from + * the {@link AzureProperties}, it will check if any {@link ServiceConnectionStringProvider} is provided and get the * connection string from the provider if set. If a connection string is resolved successfully, the * {@link #credentialConfigured} flag will be set to {@code true}. * @@ -226,8 +226,8 @@ protected void configureConnectionString(T builder) { AzureProperties azureProperties = getAzureProperties(); // connection string set to properties will advantage the one from connection string provider - if (azureProperties instanceof ConnectionStringAware) { - String connectionString = ((ConnectionStringAware) azureProperties).getConnectionString(); + if (azureProperties instanceof ConnectionStringProvider) { + String connectionString = ((ConnectionStringProvider) azureProperties).getConnectionString(); if (StringUtils.hasText(connectionString)) { consumeConnectionString().accept(builder, connectionString); @@ -334,7 +334,7 @@ public void setDefaultTokenCredential(TokenCredential defaultTokenCredential) { * Set the connection string provider. * @param connectionStringProvider The connection string provider. */ - public void setConnectionStringProvider(ConnectionStringProvider connectionStringProvider) { + public void setConnectionStringProvider(ServiceConnectionStringProvider connectionStringProvider) { this.connectionStringProvider = connectionStringProvider; } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java index 7d3df6f13890d..58fe12053592c 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java @@ -12,7 +12,7 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.identity.CredentialBuilderBase; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java index 8a04fefdf7f9f..77d18421fc3ce 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.AadCredentialBuilderBase; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java index de2752a6505fc..59a822a686f9c 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientCertificateCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.util.StringUtils; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java index 65eaf3b7efa1d..c45b55dd72a3e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientSecretCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java index 24d29102c090e..88496ee509453 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java index 98860fe412cc7..5dff7d3f3ea00 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ManagedIdentityCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java index 9b8ea5dae86aa..bc8a58e8330ac 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java index 5728b5683d94d..50deaeb86ec9c 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.AmqpClientProperties; import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; import com.azure.spring.cloud.core.properties.proxy.AmqpProxyProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java index 945d36f971933..14127bc8da968 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.HttpClientProperties; import com.azure.spring.cloud.core.properties.proxy.HttpProxyProperties; import com.azure.spring.cloud.core.properties.retry.RetryProperties; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java index 9e6f128d79bf2..ae34d299cefb7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java @@ -3,8 +3,8 @@ package com.azure.spring.cloud.core.implementation.util; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanWrapper; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java index ea1aa83181d8f..a363ca2a5488b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/AzureProperties.java @@ -3,10 +3,10 @@ package com.azure.spring.cloud.core.properties; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * Unified properties for Azure SDK clients. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java index 1124f2b5f9e52..99054abd0b666 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/authentication/TokenCredentialProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.properties.authentication; -import com.azure.spring.cloud.core.aware.authentication.TokenCredentialOptionsProvider; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * Azure properties used for getting token credential. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java index d5f1052cdb46c..248151f935e47 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/AmqpClientProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.properties.client; import com.azure.core.amqp.AmqpTransportType; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; /** * Properties shared by all amqp client builders. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java index c2a3711ed6954..463aad95b0ddc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/ClientProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.client; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; /** * Properties shared by all azure service client builders. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java index c842a03649f75..cdb36ce62f326 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpClientProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.client; -import com.azure.spring.cloud.core.aware.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; import java.time.Duration; import java.util.ArrayList; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java index 784b0b460124b..dd7de8dc75789 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/client/HttpLoggingProperties.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.properties.client; import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.spring.cloud.core.aware.HttpLoggingOptionsProvider; +import com.azure.spring.cloud.core.provider.HttpLoggingOptionsProvider; import java.util.HashSet; import java.util.Set; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java index 19a0b02d6a1c6..b1fe971ea48bc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.profile; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; /** * The AzureEnvironment defines all properties to Azure services, such as endpoints, resource ids, etc. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java index fafac41ef5ab7..dc80b583998c1 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.properties.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java index 4b8d68c20c65f..600590882b92b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.profile; -import com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; /** * The AzureProfile defines the properties related to an Azure subscription. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java index 8db9e62881f6f..01d717c073119 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/AmqpProxyProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Extend the proxy properties for AMQP connection diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java index 645a4d627b245..00c1a850307cb 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/HttpProxyProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Extend the proxy properties for HTTP connection diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java index b91c2cea5400b..8a93fa738df65 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/proxy/ProxyProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.proxy; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; /** * Common proxy properties for all Azure SDKs. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java index d051a0b2265c4..731d3996d6e72 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/AmqpRetryProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import java.time.Duration; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java index 5432a42ea5130..54448c837498d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/retry/RetryProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.properties.retry; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import java.time.Duration; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java similarity index 97% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java index 573a8daedd0b3..8692365d81728 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/AzureProfileOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware; +package com.azure.spring.cloud.core.provider; import java.util.HashMap; import java.util.Map; /** - * Interface to be implemented by classes that wish to be aware of the Azure profile. + * Interface to be implemented by classes that wish to provide the Azure profile options. */ public interface AzureProfileOptionsProvider { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ClientOptionsProvider.java similarity index 94% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ClientOptionsProvider.java index 9147366779b35..9e1b24ec1683e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ClientOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ClientOptionsProvider.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware; +package com.azure.spring.cloud.core.provider; import com.azure.core.amqp.AmqpTransportType; import com.azure.spring.cloud.core.properties.client.HeaderProperties; @@ -10,7 +10,7 @@ import java.util.List; /** - * Interface to be implemented by classes that wish to be aware of the client properties. + * Interface to be implemented by classes that wish to provide the client options. */ public interface ClientOptionsProvider { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/HttpLoggingOptionsProvider.java similarity index 91% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/HttpLoggingOptionsProvider.java index 990627ebc20b8..65b3848e11979 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/HttpLoggingOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/HttpLoggingOptionsProvider.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware; +package com.azure.spring.cloud.core.provider; import com.azure.core.http.policy.HttpLogDetailLevel; import java.util.Set; /** - * Interface to be implemented by classes that wish to describe logging options in http-based client sdks. + * Interface to be implemented by classes that wish to describe logging options in http-based client sdks options. * * For example, if you want to log the http request or response, you could set the level to * {@link HttpLogDetailLevel#BASIC} or some other levels. @@ -22,7 +22,7 @@ public interface HttpLoggingOptionsProvider { HttpLoggingOptions getLogging(); /** - * Interface to be implemented by classes that wish to describe logging options in http-based client sdks. + * Interface to be implemented by classes that wish to describe logging options in http-based client sdks options. *≤ * For example, if you want to log the http request or response, you could set the level to * {@link HttpLogDetailLevel#BASIC} or some other levels. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ProxyOptionsProvider.java similarity index 92% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ProxyOptionsProvider.java index 80afe1f270c82..e15b7e05a1cd8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/ProxyOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/ProxyOptionsProvider.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware; +package com.azure.spring.cloud.core.provider; /** - * Interface to be implemented by classes that wish to be aware of the proxy properties. + * Interface to be implemented by classes that wish to provide the proxy options. */ public interface ProxyOptionsProvider { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/RetryOptionsProvider.java similarity index 91% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/RetryOptionsProvider.java index a7bceba49e985..b0413cb048fb3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/RetryOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/RetryOptionsProvider.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware; +package com.azure.spring.cloud.core.provider; import java.time.Duration; /** - * Interface to be implemented by classes that wish to be aware of the retry properties. + * Interface to be implemented by classes that wish to provide the retry options. */ public interface RetryOptionsProvider { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/KeyAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/KeyProvider.java similarity index 53% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/KeyAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/KeyProvider.java index 1f715ddc9c245..3311f318bcd6f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/KeyAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/KeyProvider.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.authentication; /** - * Interface to be implemented by classes that wish to be aware of the key. + * Interface to be implemented by classes that wish to provide the key. */ -public interface KeyAware { +public interface KeyProvider { /** * Get the key diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/NamedKeyAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/NamedKeyProvider.java similarity index 64% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/NamedKeyAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/NamedKeyProvider.java index 44069aa72aee3..4a9a457b199bc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/NamedKeyAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/NamedKeyProvider.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.authentication; import com.azure.spring.cloud.core.properties.authentication.NamedKeyProperties; /** - * Interface to be implemented by classes that wish to be aware of the named key. + * Interface to be implemented by classes that wish to provide the named key. */ -public interface NamedKeyAware { +public interface NamedKeyProvider { /** * Get the named key properties diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/SasTokenAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/SasTokenProvider.java similarity index 54% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/SasTokenAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/SasTokenProvider.java index 5c5e3f19b6f4e..52651355a142a 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/SasTokenAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/SasTokenProvider.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.authentication; /** - * Interface to be implemented by classes that wish to be aware of the sas token. + * Interface to be implemented by classes that wish to provide the sas token. */ -public interface SasTokenAware { +public interface SasTokenProvider { /** * Get the SAS token diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/TokenCredentialOptionsProvider.java similarity index 90% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/TokenCredentialOptionsProvider.java index 1014cc45024aa..e2e2624b46290 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/TokenCredentialOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/TokenCredentialOptionsProvider.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.authentication; /** - * Interface to be implemented by classes that wish to be aware of the token credential. + * Interface to be implemented by classes that wish to provide the token credential options. */ public interface TokenCredentialOptionsProvider { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/package-info.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java similarity index 75% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/package-info.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java index dd5338f017f2e..75e509cabfb82 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/package-info.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java @@ -4,4 +4,4 @@ /** * Authentication aware abstraction for Azure service configuration properties. */ -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.authentication; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/ConnectionStringAware.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ConnectionStringProvider.java similarity index 54% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/ConnectionStringAware.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ConnectionStringProvider.java index 6c0f46a7788e7..b7bd410dba717 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/aware/authentication/ConnectionStringAware.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ConnectionStringProvider.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.aware.authentication; +package com.azure.spring.cloud.core.provider.connectionstring; /** - * Interface to be implemented by classes that wish to be aware of the connection string. + * Interface to be implemented by classes that wish to provide the connection string. */ -public interface ConnectionStringAware { +public interface ConnectionStringProvider { /** * Get the connection string diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ServiceConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ServiceConnectionStringProvider.java new file mode 100644 index 0000000000000..5bd5f7613c670 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/ServiceConnectionStringProvider.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.spring.cloud.core.provider.connectionstring; + +/** + * Service connection string provider to provide the connection string for a service type. + */ +public interface ServiceConnectionStringProvider extends ConnectionStringProvider { + + /** + * Provide the service type this provider supports. + * @return The service type. + */ + T getServiceType(); + +} diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/StaticConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/StaticConnectionStringProvider.java similarity index 80% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/StaticConnectionStringProvider.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/StaticConnectionStringProvider.java index acfeb19b09687..6a183a5d4bd04 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/StaticConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/StaticConnectionStringProvider.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.cloud.core.connectionstring; +package com.azure.spring.cloud.core.provider.connectionstring; /** - * A static implementation of {@link ConnectionStringProvider}, with static value of connection string. + * A static implementation of {@link ServiceConnectionStringProvider}, with static value of connection string. */ -public final class StaticConnectionStringProvider implements ConnectionStringProvider { +public final class StaticConnectionStringProvider implements ServiceConnectionStringProvider { private final String connectionString; private final T serviceType; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/package-info.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/package-info.java similarity index 73% rename from sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/package-info.java rename to sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/package-info.java index 88a6c8e0bc2ec..0683ce594b67e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/connectionstring/package-info.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/connectionstring/package-info.java @@ -4,4 +4,4 @@ /** * Connection string abstraction for Azure service client builder. */ -package com.azure.spring.cloud.core.connectionstring; +package com.azure.spring.cloud.core.provider.connectionstring; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/package-info.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/package-info.java new file mode 100644 index 0000000000000..43e56b9acd391 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/package-info.java @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Provider abstraction for Azure service configuration properties. + */ +package com.azure.spring.cloud.core.provider; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java index 0d9c5d9070d06..92887b72ea8f6 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/service/AzureServiceType.java @@ -3,11 +3,11 @@ package com.azure.spring.cloud.core.service; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; /** * Describes an Azure service type. This is only used for cases when build an instance of type like - * {@link ConnectionStringProvider}. + * {@link ServiceConnectionStringProvider}. */ public final class AzureServiceType { diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/credential/AzureCredentialResolversTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/credential/AzureCredentialResolversTests.java index 6e7b87d955151..375b64f9c566f 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/credential/AzureCredentialResolversTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/credential/AzureCredentialResolversTests.java @@ -7,9 +7,9 @@ import com.azure.core.credential.AzureNamedKeyCredential; import com.azure.core.credential.AzureSasCredential; import com.azure.core.credential.TokenCredential; -import com.azure.spring.cloud.core.aware.authentication.KeyAware; -import com.azure.spring.cloud.core.aware.authentication.NamedKeyAware; -import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; +import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureKeyCredentialResolver; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureNamedKeyCredentialResolver; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureSasCredentialResolver; @@ -91,7 +91,7 @@ void shouldResolveTokenCredentialWithTwoResolversWithComparatorProvided() { } private static class AzureTestProperties extends AzureHttpSdkProperties - implements KeyAware, SasTokenAware, NamedKeyAware { + implements KeyProvider, SasTokenProvider, NamedKeyProvider { private String key; private final NamedKeyProperties namedKey = new NamedKeyProperties(); diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java index 2e666ba3f54e6..7844045193dde 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/factory/AbstractAzureServiceClientBuilderFactoryTests.java @@ -5,9 +5,9 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.util.Configuration; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; -import com.azure.spring.cloud.core.connectionstring.StaticConnectionStringProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.StaticConnectionStringProvider; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureServiceClientBuilderFactory; @@ -204,7 +204,7 @@ public void setCustomizedTimes(int customizedTimes) { } } - static class AzureTestProperties extends AzureSdkProperties implements ConnectionStringAware, RetryOptionsProvider { + static class AzureTestProperties extends AzureSdkProperties implements ConnectionStringProvider, RetryOptionsProvider { private String connectionString; private final ClientProperties client = new ClientProperties(); private final ProxyProperties proxy = new ProxyProperties(); diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java index c4c0063ddd43c..08e17b141776a 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverterTests.java @@ -5,7 +5,7 @@ import com.azure.core.amqp.AmqpRetryMode; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java index 09edd641299c5..e4a8687fbae78 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpRetryOptionsConverterTests.java @@ -6,7 +6,7 @@ import com.azure.core.http.policy.ExponentialBackoffOptions; import com.azure.core.http.policy.FixedDelayOptions; import com.azure.core.http.policy.RetryOptions; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.retry.RetryProperties; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolverTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolverTests.java index 6bf7cb5f3a01d..7a7180a9ed8e0 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolverTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolverTests.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; -import com.azure.spring.cloud.core.aware.authentication.KeyAware; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import com.azure.spring.cloud.core.implementation.properties.AzureHttpSdkProperties; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,7 +34,7 @@ void notKeyAwareShouldNotResolve() { Assertions.assertFalse(resolver.isResolvable(properties)); } - private static class AzurePropertiesWithKey extends AzureHttpSdkProperties implements KeyAware { + private static class AzurePropertiesWithKey extends AzureHttpSdkProperties implements KeyProvider { private String key; diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolverTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolverTests.java index 5e8e12a20f90b..09ca6bb236d37 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolverTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolverTests.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; -import com.azure.spring.cloud.core.aware.authentication.NamedKeyAware; +import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; import com.azure.spring.cloud.core.implementation.properties.AzureAmqpSdkProperties; import com.azure.spring.cloud.core.properties.authentication.NamedKeyProperties; import org.junit.jupiter.api.Assertions; @@ -42,7 +42,7 @@ void notNamedKeyAwareShouldNotResolve() { Assertions.assertFalse(resolver.isResolvable(properties)); } - private static class AzurePropertiesWithNamedKey extends AzureAmqpSdkProperties implements NamedKeyAware { + private static class AzurePropertiesWithNamedKey extends AzureAmqpSdkProperties implements NamedKeyProvider { private NamedKeyProperties namedKey; diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolverTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolverTests.java index b105d066f4dbb..4eaf33d4a0426 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolverTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolverTests.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; -import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.implementation.properties.AzureAmqpSdkProperties; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,7 +34,7 @@ void notSasTokenAwareShouldResolve() { Assertions.assertFalse(resolver.isResolvable(properties)); } - private static class AzurePropertiesWithSasToken extends AzureAmqpSdkProperties implements SasTokenAware { + private static class AzurePropertiesWithSasToken extends AzureAmqpSdkProperties implements SasTokenProvider { private String sasToken; diff --git a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java index a0023a5ce9176..b676034fb57aa 100644 --- a/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java +++ b/sdk/spring/spring-cloud-azure-core/src/test/java/com/azure/spring/cloud/core/util/AzurePropertiesUtilsTests.java @@ -4,7 +4,7 @@ package com.azure.spring.cloud.core.util; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.TokenCredentialProperties; @@ -17,9 +17,9 @@ import java.time.Duration; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; -import static com.azure.spring.cloud.core.aware.AzureProfileOptionsProvider.CloudType.OTHER; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.AZURE_CHINA; +import static com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider.CloudType.OTHER; /** diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java index ab5245e4cb2a2..6700070ee4746 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java @@ -4,14 +4,14 @@ package com.azure.spring.cloud.resourcemanager.implementation.connectionstring; import com.azure.resourcemanager.AzureResourceManager; -import com.azure.spring.cloud.core.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.properties.resource.AzureResourceMetadata; /** * To provide an Azure service connection string from Azure Resource Manager (ARM). * @param The Azure service type. */ -public abstract class ArmConnectionStringProvider implements ConnectionStringProvider { +public abstract class ArmConnectionStringProvider implements ServiceConnectionStringProvider { private final AzureResourceManager azureResourceManager; private final AzureResourceMetadata azureResourceMetadata; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java index 73a76ae310bf5..81c3fdf65849b 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java @@ -4,14 +4,14 @@ package com.azure.spring.cloud.service.implementation.appconfiguration; import com.azure.data.appconfiguration.ConfigurationServiceVersion; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Properties for Azure App Configuration Client {@link com.azure.data.appconfiguration.ConfigurationClient}. */ -public interface ConfigurationClientProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { +public interface ConfigurationClientProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringProvider { /** * Get the service endpoint. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java index 64ec3b069ac7a..36f53bd389e88 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java @@ -11,7 +11,7 @@ import com.azure.cosmos.DirectConnectionConfig; import com.azure.cosmos.GatewayConnectionConfig; import com.azure.cosmos.ThrottlingRetryOptions; -import com.azure.spring.cloud.core.aware.ProxyOptionsProvider; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.KeyAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java index 9832d64da7171..92db4f55ce7d2 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java @@ -6,7 +6,7 @@ import com.azure.cosmos.ConnectionMode; import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.ThrottlingRetryOptions; -import com.azure.spring.cloud.core.aware.authentication.KeyAware; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import java.time.Duration; @@ -15,7 +15,7 @@ /** * Configuration properties for Cosmos database, consistency, telemetry, connection, query metrics and diagnostics. */ -public interface CosmosClientProperties extends AzureProperties, KeyAware { +public interface CosmosClientProperties extends AzureProperties, KeyProvider { /** * Get the cosmos service endpoint. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java index 8dff83bada0ae..38d6a7a21b21b 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java @@ -3,14 +3,14 @@ package com.azure.spring.cloud.service.implementation.eventhubs.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Azure Event Hubs common related properties. */ -public interface EventHubClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { +public interface EventHubClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringProvider { /** * Get the fully qualified namespace. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java index 3355c9f067480..a2a5448320e3d 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.keyvault; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; /** diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java index 86d20b6a6b38d..044ed59fb7379 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java @@ -3,15 +3,15 @@ package com.azure.spring.cloud.service.implementation.servicebus.properties; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; /** * */ -public interface ServiceBusClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringAware { +public interface ServiceBusClientCommonProperties extends AzureProperties, RetryOptionsProvider, ConnectionStringProvider { String getFullyQualifiedNamespace(); diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java index b14041a5caa9e..b17ed305c2d4a 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverter.java @@ -9,7 +9,7 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.lang.NonNull; -import static com.azure.spring.cloud.core.aware.RetryOptionsProvider.RetryMode.EXPONENTIAL; +import static com.azure.spring.cloud.core.provider.RetryOptionsProvider.RetryMode.EXPONENTIAL; /** * Converts a {@link StorageRetry} to a {@link RequestRetryOptions}. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java index e62473cda811b..0e72586b2c4a6 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/AbstractAzureStorageClientBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.service.implementation.storage.common; import com.azure.core.http.policy.RetryPolicy; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.storage.common.policy.RequestRetryOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,7 +36,7 @@ protected void configureRetry(T builder) { if (azureProperties instanceof RetryOptionsProvider) { retry = ((RetryOptionsProvider) azureProperties).getRetry(); } else { - LOGGER.warn("The properties {} is not of type RetryOptionsAware", azureProperties.getClass().getName()); + LOGGER.warn("The properties {} is not of type RetryOptionsProvider", azureProperties.getClass().getName()); return; } diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java index 87a600044274e..2e702acf6e5db 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java @@ -3,15 +3,15 @@ package com.azure.spring.cloud.service.implementation.storage.common; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; -import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.properties.AzureProperties; /** * Common properties for all Azure Storage services. */ -public interface StorageProperties extends AzureProperties, RetryOptionsProvider, SasTokenAware, ConnectionStringAware { +public interface StorageProperties extends AzureProperties, RetryOptionsProvider, SasTokenProvider, ConnectionStringProvider { /** * Get the storage endpoint. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java index ff70bf2e1ac81..0b5caae754f6a 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageRetry.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.storage.common; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import java.time.Duration; diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java index a93c378f69c3f..23508a1c363c3 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/credential/AzureGlobalTestProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.credential; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.TokenCredentialProperties; import com.azure.spring.cloud.core.properties.client.ClientProperties; diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonTestProperties.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonTestProperties.java index 69e3fc03b89b2..042d71ab21fef 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonTestProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonTestProperties.java @@ -3,8 +3,8 @@ package com.azure.spring.cloud.service.implementation.servicebus.properties; -import com.azure.spring.cloud.core.aware.authentication.NamedKeyAware; -import com.azure.spring.cloud.core.aware.authentication.SasTokenAware; +import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.implementation.connectionstring.ServiceBusConnectionString; import com.azure.spring.cloud.core.implementation.properties.AzureAmqpSdkProperties; import com.azure.spring.cloud.core.properties.authentication.NamedKeyProperties; @@ -12,7 +12,7 @@ public class ServiceBusClientCommonTestProperties extends AzureAmqpSdkProperties - implements ServiceBusClientCommonProperties, SasTokenAware, NamedKeyAware { + implements ServiceBusClientCommonProperties, SasTokenProvider, NamedKeyProvider { private String domainName = "servicebus.windows.net"; private String namespace; diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java index d280c857daec0..2d25673d1af63 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/AzureStorageRetryOptionsConverterTests.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.service.implementation.storage; -import com.azure.spring.cloud.core.aware.RetryOptionsProvider; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.service.implementation.storage.common.StorageRetryProperties; import com.azure.storage.common.policy.RequestRetryOptions; import org.junit.jupiter.api.Test; diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/core/properties/CommonProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/core/properties/CommonProperties.java index 58e82f70695e2..8e94458652f6e 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/core/properties/CommonProperties.java +++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/core/properties/CommonProperties.java @@ -3,7 +3,7 @@ package com.azure.spring.messaging.eventhubs.core.properties; -import com.azure.spring.cloud.core.aware.authentication.ConnectionStringAware; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.implementation.connectionstring.EventHubsConnectionString; import com.azure.spring.cloud.core.implementation.properties.AzureAmqpSdkProperties; import com.azure.spring.cloud.service.implementation.eventhubs.properties.EventHubClientCommonProperties; @@ -11,7 +11,7 @@ /** * Common properties shared by event hub namespace, a producer, and a consumer. */ -abstract class CommonProperties extends AzureAmqpSdkProperties implements EventHubClientCommonProperties, ConnectionStringAware { +abstract class CommonProperties extends AzureAmqpSdkProperties implements EventHubClientCommonProperties, ConnectionStringProvider { private String domainName = "servicebus.windows.net"; From 416f3431cafb9e9c87caa1ee79815c30ff98ca8b Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 12:46:12 +0800 Subject: [PATCH 04/14] rename AzureEnvironment to AzureEnvironmentOptions --- .../core/profile/AzureProfileConfigurationProperties.java | 4 ++-- .../properties/profile/AzureEnvironmentProperties.java | 2 +- .../properties/profile/AzureProfileOptionsAdapter.java | 6 +++--- .../cloud/core/provider/AzureProfileOptionsProvider.java | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java index 50251ac49276e..d14d480982049 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java @@ -77,7 +77,7 @@ public AzureEnvironmentConfigurationProperties getEnvironment() { /** * */ - public static final class AzureEnvironmentConfigurationProperties implements AzureProfileOptionsProvider.AzureEnvironment { + public static final class AzureEnvironmentConfigurationProperties implements AzureProfileOptionsProvider.AzureEnvironmentOptions { /** * The management portal URL. */ @@ -352,7 +352,7 @@ private AzureEnvironmentConfigurationProperties(com.azure.core.management.AzureE } @Override - public AzureProfileOptionsProvider.AzureEnvironment fromAzureManagementEnvironment(AzureEnvironment environment) { + public AzureProfileOptionsProvider.AzureEnvironmentOptions fromAzureManagementEnvironment(AzureEnvironment environment) { return new AzureEnvironmentConfigurationProperties(environment); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java index b1fe971ea48bc..52ca76cc6cee8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java @@ -8,7 +8,7 @@ /** * The AzureEnvironment defines all properties to Azure services, such as endpoints, resource ids, etc. */ -public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.AzureEnvironment { +public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.AzureEnvironmentOptions { /** * The management portal URL. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java index dc80b583998c1..2529029719e76 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java @@ -16,7 +16,7 @@ public abstract class AzureProfileOptionsAdapter implements AzureProfileOptionsP * Change the environment according to the cloud type set. */ protected void changeEnvironmentAccordingToCloud() { - AzureProfileOptionsProvider.AzureEnvironment defaultEnvironment = decideAzureEnvironment(this.getCloudType()); + AzureProfileOptionsProvider.AzureEnvironmentOptions defaultEnvironment = decideAzureEnvironment(this.getCloudType()); AzurePropertiesUtils.copyPropertiesIgnoreNull(defaultEnvironment, this.getEnvironment()); } @@ -24,9 +24,9 @@ protected void changeEnvironmentAccordingToCloud() { * Get the Azure environment. * @return The Azure environment. */ - public abstract AzureProfileOptionsProvider.AzureEnvironment getEnvironment(); + public abstract AzureProfileOptionsProvider.AzureEnvironmentOptions getEnvironment(); - private AzureProfileOptionsProvider.AzureEnvironment decideAzureEnvironment(AzureProfileOptionsProvider.CloudType cloud) { + private AzureProfileOptionsProvider.AzureEnvironmentOptions decideAzureEnvironment(AzureProfileOptionsProvider.CloudType cloud) { AzureEnvironment managementAzureEnvironment = decideManagementAzureEnvironment(cloud, null); return getEnvironment().fromAzureManagementEnvironment(managementAzureEnvironment); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java index 8692365d81728..3606fe9dd05fb 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java @@ -44,7 +44,7 @@ interface ProfileOptions { * Get the AzureEnvironment implementation. * @return the AzureEnvironment implementation. */ - AzureEnvironment getEnvironment(); + AzureEnvironmentOptions getEnvironment(); } @@ -62,9 +62,9 @@ enum CloudType { } /** - * Interface to be implemented by classes that wish to describe an Azure cloud environment. + * Interface to be implemented by classes that wish to describe an Azure cloud environment options. */ - interface AzureEnvironment { + interface AzureEnvironmentOptions { /** * @return The management portal URL. @@ -149,7 +149,7 @@ interface AzureEnvironment { * @param environment the azure core AzureEnvironment. * @return the AzureEnvironment implementation. */ - AzureEnvironment fromAzureManagementEnvironment(com.azure.core.management.AzureEnvironment environment); + AzureEnvironmentOptions fromAzureManagementEnvironment(com.azure.core.management.AzureEnvironment environment); /** * @return the azure core {@link com.azure.core.management.AzureEnvironment}. From b40a4867a240828e8f689d37d7aff3627dfd50df Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 12:48:04 +0800 Subject: [PATCH 05/14] rename method --- .../aad/properties/AadProfileEnvironmentProperties.java | 2 +- .../core/properties/profile/AzureProfileOptionsAdapter.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java index 3df71d4b99e6a..0ca2d9f2abb21 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileEnvironmentProperties.java @@ -58,7 +58,7 @@ public void setMicrosoftGraphEndpoint(String microsoftGraphEndpoint) { * @param cloudType The cloud type. */ public void updatePropertiesByCloudType(AzureProfileOptionsProvider.CloudType cloudType) { - AzureEnvironment knownAzureEnvironment = AzureProfileOptionsAdapter.decideManagementAzureEnvironment(cloudType, AzureEnvironment.AZURE); + AzureEnvironment knownAzureEnvironment = AzureProfileOptionsAdapter.decideAzureManagementEnvironment(cloudType, AzureEnvironment.AZURE); if (this.activeDirectoryEndpoint == null) { this.activeDirectoryEndpoint = knownAzureEnvironment.getActiveDirectoryEndpoint(); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java index 2529029719e76..948be9cd2b778 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java @@ -4,8 +4,8 @@ package com.azure.spring.cloud.core.properties.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; /** * Skeleton implementation of a {@link AzureProfileOptionsProvider.ProfileOptions}. @@ -27,7 +27,7 @@ protected void changeEnvironmentAccordingToCloud() { public abstract AzureProfileOptionsProvider.AzureEnvironmentOptions getEnvironment(); private AzureProfileOptionsProvider.AzureEnvironmentOptions decideAzureEnvironment(AzureProfileOptionsProvider.CloudType cloud) { - AzureEnvironment managementAzureEnvironment = decideManagementAzureEnvironment(cloud, null); + AzureEnvironment managementAzureEnvironment = decideAzureManagementEnvironment(cloud, null); return getEnvironment().fromAzureManagementEnvironment(managementAzureEnvironment); } @@ -37,7 +37,7 @@ private AzureProfileOptionsProvider.AzureEnvironmentOptions decideAzureEnvironme * @param defaultManagementEnvironment The default management {@link AzureEnvironment}. * @return The corresponding {@link AzureEnvironment}. */ - public static AzureEnvironment decideManagementAzureEnvironment(AzureProfileOptionsProvider.CloudType cloudType, + public static AzureEnvironment decideAzureManagementEnvironment(AzureProfileOptionsProvider.CloudType cloudType, AzureEnvironment defaultManagementEnvironment) { switch (cloudType) { case AZURE_CHINA: From 15f05e5ea73c1c8838d1466382bd9b06e7adf2fb Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Tue, 8 Mar 2022 13:07:52 +0800 Subject: [PATCH 06/14] Update AzureServiceBusJmsProperties.java --- .../AzureServiceBusJmsProperties.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java index 37034e9cbc9aa..3f25111b67486 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java @@ -25,7 +25,7 @@ public class AzureServiceBusJmsProperties implements InitializingBean { private static final String AMQP_URI_FORMAT = "amqps://%s?amqp.idleTimeout=%d"; /** - * Connection string to connect to a service bus. + * Connection string to connect to a Service Bus namesapce. */ private String connectionString; /** @@ -122,32 +122,32 @@ public JmsPoolConnectionFactoryProperties getPool() { } /** - * Get the connection string to connect to a service bus. - * @return the connection string to connect to a service bus. + * Get the connection string to connect to a Service Bus namesapce. + * @return the connection string to connect to a Service Bus namesapce. */ public String getConnectionString() { return connectionString; } /** - * Set the connection string to connect to a service bus. - * @param connectionString the connection string to connect to a service bus. + * Set the connection string to connect to a Service Bus namesapce. + * @param connectionString the connection string to connect to a Service Bus namesapce. */ public void setConnectionString(String connectionString) { this.connectionString = connectionString; } /** - * Get the Service bus topic client ID. - * @return the Service bus topic client ID. + * Get the Service Bus topic client ID. + * @return the Service Bus topic client ID. */ public String getTopicClientId() { return topicClientId; } /** - * Set the Service bus topic client ID. - * @param topicClientId the Service bus topic client ID. + * Set the Service Bus topic client ID. + * @param topicClientId the Service Bus topic client ID. */ public void setTopicClientId(String topicClientId) { this.topicClientId = topicClientId; From 6558e65d807de77646bd42d3f29a5a4e1a8674c1 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Tue, 8 Mar 2022 13:14:15 +0800 Subject: [PATCH 07/14] Update ServiceBusJmsContainerConfiguration.java --- .../autoconfigure/jms/ServiceBusJmsContainerConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java index 25e87d98ddadd..b3d654892293e 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/ServiceBusJmsContainerConfiguration.java @@ -40,7 +40,7 @@ public ServiceBusJmsContainerConfiguration(AzureServiceBusJmsProperties azureSer * Autoconfigure the {@link JmsListenerContainerFactory} for Service Bus queues. * @param configurer the configurer to configure the container factory. * @param connectionFactory the connection factory for the container factory. - * @return the jms listener container factory for service bus queues. + * @return the jms listener container factory for Service Bus queues. */ @Bean @ConditionalOnMissingBean From b561fd74a0b8c9531ac048668a0a0316f446d816 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:26:31 +0800 Subject: [PATCH 08/14] correct the AzureAmqpProxyOptionsConverter --- .../AzureAmqpProxyOptionsConverter.java | 27 +++++++++---------- ...AbstractAzureAmqpClientBuilderFactory.java | 14 ++++++---- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java index 2c24b48e64242..0d4e5bfd5c7f7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpProxyOptionsConverter.java @@ -16,9 +16,9 @@ import java.util.Locale; /** - * Converts a {@link ProxyOptionsProvider.ProxyOptions} to a {@link ProxyOptions}. + * Converts a {@link ProxyOptionsProvider.AmqpProxyOptions} to a {@link ProxyOptions}. */ -public final class AzureAmqpProxyOptionsConverter implements Converter { +public final class AzureAmqpProxyOptionsConverter implements Converter { private static final Logger LOGGER = LoggerFactory.getLogger(AzureAmqpProxyOptionsConverter.class); public static final AzureAmqpProxyOptionsConverter AMQP_PROXY_CONVERTER = new AzureAmqpProxyOptionsConverter(); @@ -28,7 +28,7 @@ private AzureAmqpProxyOptionsConverter() { } @Override - public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { + public ProxyOptions convert(ProxyOptionsProvider.AmqpProxyOptions proxy) { if (!StringUtils.hasText(proxy.getHostname()) || proxy.getPort() == null) { LOGGER.debug("Proxy hostname or port is not set."); return null; @@ -39,18 +39,15 @@ public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { } ProxyAuthenticationType authenticationType = ProxyAuthenticationType.NONE; - if (proxy instanceof ProxyOptionsProvider.AmqpProxyOptions) { - ProxyOptionsProvider.AmqpProxyOptions amqpProxy = (ProxyOptionsProvider.AmqpProxyOptions) proxy; - if (amqpProxy.getAuthenticationType() != null) { - switch (amqpProxy.getAuthenticationType().toLowerCase(Locale.ROOT)) { - case "basic": - authenticationType = ProxyAuthenticationType.BASIC; - break; - case "digest": - authenticationType = ProxyAuthenticationType.DIGEST; - break; - default: - } + if (proxy.getAuthenticationType() != null) { + switch (proxy.getAuthenticationType().toLowerCase(Locale.ROOT)) { + case "basic": + authenticationType = ProxyAuthenticationType.BASIC; + break; + case "digest": + authenticationType = ProxyAuthenticationType.DIGEST; + break; + default: } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java index 5ff70fd160411..c0c3d20844828 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureAmqpClientBuilderFactory.java @@ -7,10 +7,10 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.amqp.ProxyOptions; import com.azure.core.util.ClientOptions; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.ClientOptionsProvider; import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -126,11 +126,15 @@ protected void configureProxy(T builder) { return; } - final ProxyOptions proxyOptions = AMQP_PROXY_CONVERTER.convert(proxy); - if (proxyOptions != null) { - consumeProxyOptions().accept(builder, proxyOptions); + if (proxy instanceof ProxyOptionsProvider.AmqpProxyOptions) { + final ProxyOptions proxyOptions = AMQP_PROXY_CONVERTER.convert((ProxyOptionsProvider.AmqpProxyOptions) proxy); + if (proxyOptions != null) { + consumeProxyOptions().accept(builder, proxyOptions); + } else { + LOGGER.debug("No AMQP proxy properties available."); + } } else { - LOGGER.debug("No AMQP proxy properties available."); + LOGGER.debug("The provided proxy options is not a ProxyOptionsProvider.AmqpProxyOptions type."); } } From 8ad05c9cf553ec318e717ab04dd91baa9434ccd8 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:55:26 +0800 Subject: [PATCH 09/14] refactor the converters --- .../converter/AzureAmqpRetryOptionsConverter.java | 2 +- .../converter/AzureHttpProxyOptionsConverter.java | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java index e4367dfee3ac1..7046fa9480418 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureAmqpRetryOptionsConverter.java @@ -5,8 +5,8 @@ import com.azure.core.amqp.AmqpRetryMode; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.springframework.core.convert.converter.Converter; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java index 289c3b71c8008..2e074bf84eecc 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/converter/AzureHttpProxyOptionsConverter.java @@ -13,9 +13,9 @@ import java.net.InetSocketAddress; /** - * Converts a {@link ProxyOptionsProvider.ProxyOptions} to a {@link ProxyOptions}. + * Converts a {@link ProxyOptionsProvider.HttpProxyOptions} to a {@link ProxyOptions}. */ -public final class AzureHttpProxyOptionsConverter implements Converter { +public final class AzureHttpProxyOptionsConverter implements Converter { private static final Logger LOGGER = LoggerFactory.getLogger(AzureHttpProxyOptionsConverter.class); public static final AzureHttpProxyOptionsConverter HTTP_PROXY_CONVERTER = new AzureHttpProxyOptionsConverter(); @@ -25,7 +25,7 @@ private AzureHttpProxyOptionsConverter() { } @Override - public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { + public ProxyOptions convert(ProxyOptionsProvider.HttpProxyOptions proxy) { if (!StringUtils.hasText(proxy.getHostname()) || proxy.getPort() == null) { LOGGER.debug("Proxy hostname or port is not set."); return null; @@ -49,11 +49,8 @@ public ProxyOptions convert(ProxyOptionsProvider.ProxyOptions proxy) { proxyOptions.setCredentials(proxy.getUsername(), proxy.getPassword()); } - if (proxy instanceof ProxyOptionsProvider.HttpProxyOptions) { - ProxyOptionsProvider.HttpProxyOptions httpProxyProperties = (ProxyOptionsProvider.HttpProxyOptions) proxy; - if (StringUtils.hasText(httpProxyProperties.getNonProxyHosts())) { - proxyOptions.setNonProxyHosts(httpProxyProperties.getNonProxyHosts()); - } + if (StringUtils.hasText(proxy.getNonProxyHosts())) { + proxyOptions.setNonProxyHosts(proxy.getNonProxyHosts()); } return proxyOptions; } From 8be059d50ea94ee5cefe7bd249387cd584841623 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:55:38 +0800 Subject: [PATCH 10/14] optimize imports --- .../http/KeyVaultSecretUserAgentTests.java | 2 +- .../resolver/AzureKeyCredentialResolver.java | 2 +- .../AzureNamedKeyCredentialResolver.java | 2 +- .../resolver/AzureSasCredentialResolver.java | 2 +- .../AzureTokenCredentialResolver.java | 2 +- ...AbstractAzureHttpClientBuilderFactory.java | 16 ++++--- ...tractAzureServiceClientBuilderFactory.java | 8 ++-- ...AbstractAzureCredentialBuilderFactory.java | 2 +- .../AzureAadCredentialBuilderFactory.java | 2 +- ...ntCertificateCredentialBuilderFactory.java | 2 +- .../ClientSecretCredentialBuilderFactory.java | 2 +- .../DefaultAzureCredentialBuilderFactory.java | 2 +- ...nagedIdentityCredentialBuilderFactory.java | 2 +- ...rnamePasswordCredentialBuilderFactory.java | 2 +- .../properties/AzureAmqpSdkProperties.java | 4 +- .../properties/AzureHttpSdkProperties.java | 2 +- .../util/AzurePropertiesUtils.java | 2 +- .../provider/authentication/package-info.java | 2 +- .../AbstractAzureStorageProtocolResolver.java | 5 +- .../AzureStorageBlobProtocolResolver.java | 3 +- .../AzureStorageFileProtocolResolver.java | 3 +- .../core/resource/AzureStorageResource.java | 6 +-- .../core/resource/AzureStorageUtils.java | 3 +- .../core/resource/StorageFileResource.java | 11 +++-- .../cosmos/CosmosClientBuilderFactory.java | 47 +++++-------------- 25 files changed, 60 insertions(+), 76 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/http/KeyVaultSecretUserAgentTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/http/KeyVaultSecretUserAgentTests.java index 12de3d82061c0..697306cc0a6b9 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/http/KeyVaultSecretUserAgentTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/useragent/http/KeyVaultSecretUserAgentTests.java @@ -37,7 +37,7 @@ public void userAgentTest(CapturedOutput output) { "spring.cloud.azure.keyvault.secret.client.logging.allowed-header-names=User-Agent", "spring.cloud.azure.keyvault.secret.retry.base-delay=1", "spring.cloud.azure.keyvault.secret.retry.max-retries=0", - "spring.cloud.azure.keyvault.certificate.retry.mode=fixed" + "spring.cloud.azure.keyvault.secret.retry.mode=fixed" ) .withBean(AzureGlobalProperties.class, AzureGlobalProperties::new) .run(context -> { diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java index 063ca8f48c7e8..a498c4fefaf55 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureKeyCredentialResolver.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureKeyCredential; -import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import org.springframework.util.StringUtils; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java index 366e79fb5999d..7ff5a349f2d28 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureNamedKeyCredentialResolver.java @@ -4,10 +4,10 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureNamedKeyCredential; -import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.properties.authentication.NamedKeyProperties; +import com.azure.spring.cloud.core.provider.authentication.NamedKeyProvider; import org.springframework.util.StringUtils; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java index b2168caeb1615..3bb78a1f808e3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureSasCredentialResolver.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.credential.resolver; import com.azure.core.credential.AzureSasCredential; -import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; import org.springframework.util.StringUtils; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java index 0e904f79062cb..3a012ede8cbe8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/credential/resolver/AzureTokenCredentialResolver.java @@ -8,9 +8,9 @@ import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.identity.ManagedIdentityCredentialBuilder; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import org.springframework.util.StringUtils; import java.util.function.Function; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java index 956054ac1c554..1dc9280d7384b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureHttpClientBuilderFactory.java @@ -14,11 +14,11 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Header; import com.azure.core.util.HttpClientOptions; +import com.azure.spring.cloud.core.implementation.http.DefaultHttpProvider; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.ClientOptionsProvider; import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; -import com.azure.spring.cloud.core.implementation.http.DefaultHttpProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -116,11 +116,15 @@ protected void configureProxy(T builder) { return; } - ProxyOptions proxyOptions = HTTP_PROXY_CONVERTER.convert(proxy); - if (proxyOptions != null) { - this.httpClientOptions.setProxyOptions(proxyOptions); + if (proxy instanceof ProxyOptionsProvider.HttpProxyOptions) { + ProxyOptions proxyOptions = HTTP_PROXY_CONVERTER.convert((ProxyOptionsProvider.HttpProxyOptions) proxy); + if (proxyOptions != null) { + this.httpClientOptions.setProxyOptions(proxyOptions); + } else { + LOGGER.debug("No HTTP proxy properties available."); + } } else { - LOGGER.debug("No HTTP proxy properties available."); + LOGGER.debug("The provided proxy options is not a ProxyOptionsProvider.HttpProxyOptions type."); } } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java index 7165e9175e213..23195622e2173 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java @@ -7,15 +7,15 @@ import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.spring.cloud.core.AzureSpringIdentifier; -import com.azure.spring.cloud.core.provider.ClientOptionsProvider; -import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.credential.AzureCredentialResolver; import com.azure.spring.cloud.core.credential.AzureCredentialResolvers; -import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; +import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.resolver.AzureTokenCredentialResolver; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.ClientOptionsProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java index 58fe12053592c..b6978ef73787a 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AbstractAzureCredentialBuilderFactory.java @@ -12,10 +12,10 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.identity.CredentialBuilderBase; -import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java index 77d18421fc3ce..2bd49498aab9e 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/AzureAadCredentialBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.AadCredentialBuilderBase; -import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import java.util.concurrent.ExecutorService; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java index 59a822a686f9c..d8d024066fd7b 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientCertificateCredentialBuilderFactory.java @@ -4,8 +4,8 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientCertificateCredentialBuilder; -import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import org.springframework.util.StringUtils; /** diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java index c45b55dd72a3e..e7576c1c161a0 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ClientSecretCredentialBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ClientSecretCredentialBuilder; -import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * A credential builder factory for the {@link ClientSecretCredentialBuilder}. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java index 88496ee509453..1f649a95760b7 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/DefaultAzureCredentialBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import java.util.concurrent.ExecutorService; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java index 5dff7d3f3ea00..550f4fd74b8d3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/ManagedIdentityCredentialBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.ManagedIdentityCredentialBuilder; -import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * A credential builder factory for the {@link ManagedIdentityCredentialBuilder}. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java index bc8a58e8330ac..13a49f839eab8 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/credential/UsernamePasswordCredentialBuilderFactory.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.core.implementation.factory.credential; import com.azure.identity.UsernamePasswordCredentialBuilder; -import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; /** * A credential builder factory for the {@link UsernamePasswordCredentialBuilder}. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java index 50deaeb86ec9c..8190f2d4593b0 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureAmqpSdkProperties.java @@ -3,10 +3,10 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.AmqpClientProperties; -import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; import com.azure.spring.cloud.core.properties.proxy.AmqpProxyProperties; +import com.azure.spring.cloud.core.properties.retry.AmqpRetryProperties; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; /** * Unified properties for Azure SDK clients. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java index 14127bc8da968..161584e37c0ba 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/properties/AzureHttpSdkProperties.java @@ -3,10 +3,10 @@ package com.azure.spring.cloud.core.implementation.properties; -import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.client.HttpClientProperties; import com.azure.spring.cloud.core.properties.proxy.HttpProxyProperties; import com.azure.spring.cloud.core.properties.retry.RetryProperties; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; /** * Unified properties for Azure SDK clients. diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java index ae34d299cefb7..2934edca414fd 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/util/AzurePropertiesUtils.java @@ -3,9 +3,9 @@ package com.azure.spring.cloud.core.implementation.util; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.ClientOptionsProvider; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java index 75e509cabfb82..6be766b0dc65d 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/authentication/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Authentication aware abstraction for Azure service configuration properties. + * Authentication provider abstraction for Azure service configuration properties. */ package com.azure.spring.cloud.core.provider.authentication; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AbstractAzureStorageProtocolResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AbstractAzureStorageProtocolResolver.java index 28bca1546b074..d3bcb4ba847bb 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AbstractAzureStorageProtocolResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AbstractAzureStorageProtocolResolver.java @@ -3,8 +3,6 @@ package com.azure.spring.cloud.core.resource; -import java.io.IOException; -import java.util.stream.Stream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -19,6 +17,9 @@ import org.springframework.util.AntPathMatcher; import org.springframework.util.ClassUtils; +import java.io.IOException; +import java.util.stream.Stream; + /** * Abstract protocolResolver for Storage */ diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageBlobProtocolResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageBlobProtocolResolver.java index 532287b93b88d..f746118657b97 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageBlobProtocolResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageBlobProtocolResolver.java @@ -10,10 +10,11 @@ import com.azure.storage.blob.models.BlobListDetails; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.ListBlobsOptions; -import java.util.stream.Stream; import org.springframework.core.io.ProtocolResolver; import org.springframework.core.io.Resource; +import java.util.stream.Stream; + /** * A {@link ProtocolResolver} implementation for the {@code azure-blob://} protocol. */ diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageFileProtocolResolver.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageFileProtocolResolver.java index c3b4566630fd2..fa6aeaaa684d3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageFileProtocolResolver.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageFileProtocolResolver.java @@ -7,10 +7,11 @@ import com.azure.storage.file.share.ShareServiceClient; import com.azure.storage.file.share.models.ListSharesOptions; import com.azure.storage.file.share.models.ShareItem; -import java.util.stream.Stream; import org.springframework.core.io.ProtocolResolver; import org.springframework.core.io.Resource; +import java.util.stream.Stream; + /** * A {@link ProtocolResolver} implementation for the {@code azure-file://} protocol. */ diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageResource.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageResource.java index 3d2eff98a11e4..1446f01a6d548 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageResource.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageResource.java @@ -3,18 +3,18 @@ package com.azure.spring.cloud.core.resource; -import java.net.URLConnection; -import java.util.Locale; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.WritableResource; import org.springframework.lang.NonNull; import org.springframework.util.Assert; import org.springframework.util.StringUtils; +import java.net.URLConnection; +import java.util.Locale; + /** * Abstract implementation of {@link WritableResource} for reading and writing objects in Azure StorageAccount. * - * @author Warren Zhu */ abstract class AzureStorageResource extends AbstractResource implements WritableResource { private static final String PATH_DELIMITER = "/"; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageUtils.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageUtils.java index cea7855258511..8c41b79bdf5b3 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageUtils.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/AzureStorageUtils.java @@ -3,9 +3,10 @@ package com.azure.spring.cloud.core.resource; -import java.util.Locale; import org.springframework.util.Assert; +import java.util.Locale; + /** * Azure storage resource utility class */ diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/StorageFileResource.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/StorageFileResource.java index 37fdfe41c9489..16ae2ee6c1dd1 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/StorageFileResource.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/resource/StorageFileResource.java @@ -10,17 +10,18 @@ import com.azure.storage.file.share.StorageFileOutputStream; import com.azure.storage.file.share.models.ShareFileHttpHeaders; import com.azure.storage.file.share.models.ShareStorageException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.Resource; +import org.springframework.core.io.WritableResource; +import org.springframework.util.StringUtils; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.core.io.Resource; -import org.springframework.core.io.WritableResource; -import org.springframework.util.StringUtils; /** * Implements {@link WritableResource} for reading and writing objects in Azure StorageAccount file. An instance of this diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java index 36f53bd389e88..93844510075a8 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientBuilderFactory.java @@ -10,14 +10,13 @@ import com.azure.cosmos.CosmosClientBuilder; import com.azure.cosmos.DirectConnectionConfig; import com.azure.cosmos.GatewayConnectionConfig; -import com.azure.cosmos.ThrottlingRetryOptions; -import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.KeyAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureServiceClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.ProxyOptionsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +39,6 @@ public class CosmosClientBuilderFactory extends AbstractAzureServiceClientBuilde private final CosmosClientProperties cosmosClientProperties; private ProxyOptions proxyOptions; - private ThrottlingRetryOptions throttlingRetryOptions; /** * Create a {@link CosmosClientBuilderFactory} instance with a {@link CosmosClientProperties}. @@ -71,9 +69,14 @@ protected List> getAuthenticationDescriptors(CosmosC @Override protected void configureProxy(CosmosClientBuilder builder) { ProxyOptionsProvider.ProxyOptions proxy = this.cosmosClientProperties.getProxy(); - this.proxyOptions = HTTP_PROXY_CONVERTER.convert(proxy); - if (this.proxyOptions == null) { - LOGGER.debug("No proxy properties available."); + + if (proxy instanceof ProxyOptionsProvider.HttpProxyOptions) { + this.proxyOptions = HTTP_PROXY_CONVERTER.convert((ProxyOptionsProvider.HttpProxyOptions) proxy); + if (this.proxyOptions == null) { + LOGGER.debug("No proxy properties available."); + } + } else { + LOGGER.debug("The provided proxy options is not a ProxyOptionsProvider.HttpProxyOptions type."); } } @@ -96,7 +99,7 @@ protected void configureService(CosmosClientBuilder builder) { map.from(this.cosmosClientProperties.getReadRequestsFallbackEnabled()).to(builder::readRequestsFallbackEnabled); map.from(this.cosmosClientProperties.getSessionCapturingOverrideEnabled()).to(builder::sessionCapturingOverrideEnabled); map.from(this.cosmosClientProperties.getPreferredRegions()).whenNot(List::isEmpty).to(builder::preferredRegions); - configureThrottlingRetryOptions(builder, map); + map.from(this.cosmosClientProperties.getThrottlingRetryOptions()).to(builder::throttlingRetryOptions); configureConnection(builder, map); } @@ -127,34 +130,6 @@ private void configureConnection(CosmosClientBuilder builder, PropertyMapper map } } - /** - * Configure ThrottlingRetryOptions. - * If not configured the retry options of ThrottlingRetryOptions, then will try to use the root retry options of Cosmos properties. - * @param builder Cosmos client builder - * @param map Property mapper - */ - private void configureThrottlingRetryOptions(CosmosClientBuilder builder, PropertyMapper map) { - ThrottlingRetryOptions retryOptions = this.cosmosClientProperties.getThrottlingRetryOptions(); - if (this.throttlingRetryOptions != null && isDefaultThrottlingRetryOptions(retryOptions)) { - map.from(this.throttlingRetryOptions).to(builder::throttlingRetryOptions); - LOGGER.debug("The throttling retry options is not configured, " - + "then the Azure Spring Retry configuration will be applied to Cosmos service builder."); - } else { - map.from(retryOptions).to(builder::throttlingRetryOptions); - } - } - - /** - * Check if the retry option is the default value, which is defined in azure-cosmos SDK. - * @param retryOptions retry options to be checked - * @return result - */ - private boolean isDefaultThrottlingRetryOptions(ThrottlingRetryOptions retryOptions) { - ThrottlingRetryOptions defaultOptions = new ThrottlingRetryOptions(); - return defaultOptions.getMaxRetryAttemptsOnThrottledRequests() == retryOptions.getMaxRetryAttemptsOnThrottledRequests() - && defaultOptions.getMaxRetryWaitTime().equals(retryOptions.getMaxRetryWaitTime()); - } - @Override protected BiConsumer consumeApplicationId() { return CosmosClientBuilder::userAgentSuffix; From 122cf56ca2f61d888745ec7a5e1b5c579a8d2af9 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:56:24 +0800 Subject: [PATCH 11/14] optimize imports --- .../appconfiguration/ConfigurationClientBuilderFactory.java | 2 +- .../appconfiguration/ConfigurationClientProperties.java | 2 +- .../service/implementation/cosmos/CosmosClientProperties.java | 2 +- .../eventhubs/factory/EventHubClientBuilderFactory.java | 2 +- .../eventhubs/factory/EventProcessorClientBuilderFactory.java | 2 +- .../eventhubs/properties/EventHubClientCommonProperties.java | 2 +- .../service/implementation/keyvault/KeyVaultProperties.java | 2 +- .../certificates/CertificateClientBuilderFactory.java | 2 +- .../keyvault/secrets/SecretClientBuilderFactory.java | 2 +- .../servicebus/factory/ServiceBusClientBuilderFactory.java | 2 +- .../properties/ServiceBusClientCommonProperties.java | 2 +- .../storage/blob/BlobServiceClientBuilderFactory.java | 2 +- .../implementation/storage/common/StorageProperties.java | 4 ++-- .../storage/fileshare/ShareServiceClientBuilderFactory.java | 2 +- .../storage/queue/QueueServiceClientBuilderFactory.java | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientBuilderFactory.java index eea27291b56d2..342a35557e14c 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientBuilderFactory.java @@ -15,8 +15,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import java.util.Arrays; import java.util.List; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java index 81c3fdf65849b..e098fed7ab1e4 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/appconfiguration/ConfigurationClientProperties.java @@ -4,9 +4,9 @@ package com.azure.spring.cloud.service.implementation.appconfiguration; import com.azure.data.appconfiguration.ConfigurationServiceVersion; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; /** * Properties for Azure App Configuration Client {@link com.azure.data.appconfiguration.ConfigurationClient}. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java index 92db4f55ce7d2..e2a27ef9ce30a 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/cosmos/CosmosClientProperties.java @@ -6,8 +6,8 @@ import com.azure.cosmos.ConnectionMode; import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.ThrottlingRetryOptions; -import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.authentication.KeyProvider; import java.time.Duration; import java.util.List; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventHubClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventHubClientBuilderFactory.java index 87b08c45208f2..388f1f7d656e2 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventHubClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventHubClientBuilderFactory.java @@ -15,8 +15,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureAmqpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.implementation.eventhubs.properties.EventHubClientCommonProperties; import com.azure.spring.cloud.service.implementation.eventhubs.properties.EventHubConsumerProperties; import com.azure.spring.cloud.service.implementation.eventhubs.properties.EventHubsNamespaceProperties; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventProcessorClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventProcessorClientBuilderFactory.java index ece54ea96bb8e..096d903f96538 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventProcessorClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/factory/EventProcessorClientBuilderFactory.java @@ -20,8 +20,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureAmqpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.eventhubs.consumer.EventHubsBatchMessageListener; import com.azure.spring.cloud.service.eventhubs.consumer.EventHubsErrorHandler; import com.azure.spring.cloud.service.eventhubs.consumer.EventHubsMessageListener; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java index 38d6a7a21b21b..18f323c900fd1 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/eventhubs/properties/EventHubClientCommonProperties.java @@ -3,9 +3,9 @@ package com.azure.spring.cloud.service.implementation.eventhubs.properties; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; /** * Azure Event Hubs common related properties. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java index a2a5448320e3d..8b14dc6e7f9b8 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/KeyVaultProperties.java @@ -3,8 +3,8 @@ package com.azure.spring.cloud.service.implementation.keyvault; -import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.RetryOptionsProvider; /** * Common properties for Azure Key Vault diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/certificates/CertificateClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/certificates/CertificateClientBuilderFactory.java index d9f49dd7b68db..b0bb32520de55 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/certificates/CertificateClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/certificates/CertificateClientBuilderFactory.java @@ -15,8 +15,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/secrets/SecretClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/secrets/SecretClientBuilderFactory.java index 382c29e2fb1cf..19b9809516125 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/secrets/SecretClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/keyvault/secrets/SecretClientBuilderFactory.java @@ -15,8 +15,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureHttpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusClientBuilderFactory.java index a01c88ae6350b..a78ff35fcb265 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusClientBuilderFactory.java @@ -15,8 +15,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.factory.AbstractAzureAmqpClientBuilderFactory; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.implementation.servicebus.properties.ServiceBusClientCommonProperties; import com.azure.spring.cloud.service.implementation.servicebus.properties.ServiceBusNamespaceProperties; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java index 044ed59fb7379..eebd37d727eb1 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java @@ -3,9 +3,9 @@ package com.azure.spring.cloud.service.implementation.servicebus.properties; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; /** diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/blob/BlobServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/blob/BlobServiceClientBuilderFactory.java index df4b30eefcc8d..b38b0bd4a7a47 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/blob/BlobServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/blob/BlobServiceClientBuilderFactory.java @@ -13,8 +13,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.implementation.storage.common.AbstractAzureStorageClientBuilderFactory; import com.azure.spring.cloud.service.implementation.storage.common.credential.StorageSharedKeyAuthenticationDescriptor; import com.azure.storage.blob.BlobServiceClientBuilder; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java index 2e702acf6e5db..4be2f0be933cc 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/common/StorageProperties.java @@ -3,10 +3,10 @@ package com.azure.spring.cloud.service.implementation.storage.common; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; -import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; import com.azure.spring.cloud.core.provider.authentication.SasTokenProvider; -import com.azure.spring.cloud.core.properties.AzureProperties; +import com.azure.spring.cloud.core.provider.connectionstring.ConnectionStringProvider; /** * Common properties for all Azure Storage services. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/fileshare/ShareServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/fileshare/ShareServiceClientBuilderFactory.java index 6c44d42672c9f..52656f06b7a54 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/fileshare/ShareServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/fileshare/ShareServiceClientBuilderFactory.java @@ -12,8 +12,8 @@ import com.azure.core.util.Configuration; import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.implementation.storage.common.AbstractAzureStorageClientBuilderFactory; import com.azure.spring.cloud.service.implementation.storage.common.credential.StorageSharedKeyAuthenticationDescriptor; import com.azure.storage.common.policy.RequestRetryOptions; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/queue/QueueServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/queue/QueueServiceClientBuilderFactory.java index 0be8447aae4b2..7d6e2e2b2e4d5 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/queue/QueueServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/storage/queue/QueueServiceClientBuilderFactory.java @@ -13,8 +13,8 @@ import com.azure.spring.cloud.core.implementation.credential.descriptor.AuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.SasAuthenticationDescriptor; import com.azure.spring.cloud.core.implementation.credential.descriptor.TokenAuthenticationDescriptor; -import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.core.implementation.properties.PropertyMapper; +import com.azure.spring.cloud.core.properties.AzureProperties; import com.azure.spring.cloud.service.implementation.storage.common.AbstractAzureStorageClientBuilderFactory; import com.azure.spring.cloud.service.implementation.storage.common.credential.StorageSharedKeyAuthenticationDescriptor; import com.azure.storage.common.policy.RequestRetryOptions; From 876c9c29e12041188a7a4a4e89f8ac4b7916fcaf Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:56:57 +0800 Subject: [PATCH 12/14] optimize imports --- .../connectionstring/ArmConnectionStringProvider.java | 2 +- .../connectionstring/EventHubsArmConnectionStringProvider.java | 2 +- .../connectionstring/ServiceBusArmConnectionStringProvider.java | 2 +- .../StorageQueueArmConnectionStringProvider.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java index 6700070ee4746..2438d35fab916 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ArmConnectionStringProvider.java @@ -4,8 +4,8 @@ package com.azure.spring.cloud.resourcemanager.implementation.connectionstring; import com.azure.resourcemanager.AzureResourceManager; -import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; import com.azure.spring.cloud.core.properties.resource.AzureResourceMetadata; +import com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider; /** * To provide an Azure service connection string from Azure Resource Manager (ARM). diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/EventHubsArmConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/EventHubsArmConnectionStringProvider.java index 2e337b12d4097..99eb1792f2c6c 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/EventHubsArmConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/EventHubsArmConnectionStringProvider.java @@ -6,8 +6,8 @@ import com.azure.resourcemanager.AzureResourceManager; import com.azure.resourcemanager.eventhubs.models.AuthorizationRule; import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationKey; -import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.core.properties.resource.AzureResourceMetadata; +import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubNamespaceCrud; /** diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ServiceBusArmConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ServiceBusArmConnectionStringProvider.java index edbb723154ef7..c4488e1538c8c 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ServiceBusArmConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/ServiceBusArmConnectionStringProvider.java @@ -6,8 +6,8 @@ import com.azure.resourcemanager.AzureResourceManager; import com.azure.resourcemanager.servicebus.models.AuthorizationKeys; import com.azure.resourcemanager.servicebus.models.AuthorizationRule; -import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.core.properties.resource.AzureResourceMetadata; +import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.resourcemanager.implementation.crud.ServiceBusNamespaceCrud; /** diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/StorageQueueArmConnectionStringProvider.java b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/StorageQueueArmConnectionStringProvider.java index 0f13642bb84df..79f8a9a4e268c 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/StorageQueueArmConnectionStringProvider.java +++ b/sdk/spring/spring-cloud-azure-resourcemanager/src/main/java/com/azure/spring/cloud/resourcemanager/implementation/connectionstring/StorageQueueArmConnectionStringProvider.java @@ -5,8 +5,8 @@ import com.azure.resourcemanager.AzureResourceManager; import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.core.properties.resource.AzureResourceMetadata; +import com.azure.spring.cloud.core.service.AzureServiceType; import com.azure.spring.cloud.resourcemanager.implementation.crud.StorageAccountCrud; /** From 6d9876defe49f43256732272191e83c498448e60 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai Date: Tue, 8 Mar 2022 13:57:30 +0800 Subject: [PATCH 13/14] optimize imports --- .../core/profile/AzureProfileConfigurationProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java index d14d480982049..96ea602d70c15 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java @@ -4,8 +4,8 @@ package com.azure.spring.cloud.autoconfigure.properties.core.profile; import com.azure.core.management.AzureEnvironment; -import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.properties.profile.AzureProfileOptionsAdapter; +import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; /** * The AzureProfile defines the properties related to an Azure subscription. From fac8a54a95706f96f5ec91bedccac687df347316 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Tue, 8 Mar 2022 17:20:43 +0800 Subject: [PATCH 14/14] Update SpringCloudAzureCompatibilityVerifierProperties.java --- .../SpringCloudAzureCompatibilityVerifierProperties.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java index d97a9d3884ef5..a5e97073b5781 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/compatibility/SpringCloudAzureCompatibilityVerifierProperties.java @@ -19,7 +19,7 @@ public class SpringCloudAzureCompatibilityVerifierProperties { */ private boolean enabled; /** - * Comma-delimited list of compatible Spring Boot versions. + * Comma-delimited list of Spring Boot versions that are compatible with current Spring Cloud Azure's version. */ private List compatibleBootVersions = Arrays.asList("2.5.x", "2.6.x"); @@ -40,7 +40,7 @@ public void setEnabled(boolean enabled) { } /** - * Get the list of compatible Spring Boot versions. + * Get the list of Spring Boot versions that are compatible with current Spring Cloud Azure's version. * @return the compatible Spring Boot versions. */ public List getCompatibleBootVersions() { @@ -48,7 +48,7 @@ public List getCompatibleBootVersions() { } /** - * Set the list of compatible Spring Boot versions. + * Set the list of Spring Boot versions that are compatible with current Spring Cloud Azure's version. * @param compatibleBootVersions the compatible Spring Boot versions. */ public void setCompatibleBootVersions(List compatibleBootVersions) {