-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage common property configuration supports all Storage featur…
…es (#29094) add storage common property configuration
- Loading branch information
Showing
26 changed files
with
1,391 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ring/cloud/autoconfigure/implementation/properties/utils/AzureServicePropertiesUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.spring.cloud.autoconfigure.implementation.properties.utils; | ||
|
||
import com.azure.spring.cloud.autoconfigure.implementation.storage.common.AzureStorageProperties; | ||
import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; | ||
import com.azure.spring.cloud.core.properties.AzureProperties; | ||
|
||
/** | ||
* Util class for processing Azure Service properties. | ||
*/ | ||
public final class AzureServicePropertiesUtils { | ||
|
||
public AzureServicePropertiesUtils() { | ||
} | ||
|
||
/** | ||
* Load the default value to an Azure Service properties from the Azure Storage properties. | ||
* | ||
* @param source The Azure Storage properties. | ||
* @param target The properties of an Azure Service, such as Storage Blob properties. Some common components of the | ||
* service's properties have default value as set to the Azure properties. For example, the proxy of | ||
* the Storage Blob properties takes the proxy set to the Azure properties as default. | ||
* @param <T> The type of the properties of an Azure Service. | ||
* @return The Azure Service's properties. | ||
*/ | ||
public static <T extends AzureProperties> T loadStorageProperties(AzureStorageProperties source, T target) { | ||
AzurePropertiesUtils.copyAzureCommonPropertiesIgnoreNull(source, target); | ||
AzurePropertiesUtils.copyPropertiesIgnoreNull(source, target); | ||
return target; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/azure/spring/cloud/autoconfigure/storage/AzureStorageConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.spring.cloud.autoconfigure.storage; | ||
|
||
import com.azure.spring.cloud.autoconfigure.AzureServiceConfigurationBase; | ||
import com.azure.spring.cloud.autoconfigure.context.AzureGlobalProperties; | ||
import com.azure.spring.cloud.autoconfigure.implementation.storage.common.AzureStorageProperties; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Common configuration for Azure Storage support. | ||
* | ||
* @since 4.3.0 | ||
*/ | ||
@Configuration | ||
public class AzureStorageConfiguration extends AzureServiceConfigurationBase { | ||
|
||
AzureStorageConfiguration(AzureGlobalProperties azureGlobalProperties) { | ||
super(azureGlobalProperties); | ||
} | ||
|
||
@Bean | ||
@ConfigurationProperties(AzureStorageProperties.PREFIX) | ||
AzureStorageProperties azureStorageProperties() { | ||
return loadProperties(getAzureGlobalProperties(), new AzureStorageProperties()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.