diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 34d31698767e7..2faf09c40d5c7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -116,9 +116,6 @@ # ServiceLabel: %ARO # ServiceOwners: @mjudeikis @jim-minter @julienstroheker @amanohar -# PRLabel: %graalvm -/sdk/aot/ @srnagar @jonathangiles - # ServiceLabel: %graalvm # AzureSdkOwners: @srnagar diff --git a/.vscode/cspell.json b/.vscode/cspell.json index a047849643896..1141fc83e4a26 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -66,11 +66,8 @@ "**/src/**/samples/**/*.ipynb", "**/sdk/**/swagger/**", "**/src/**/resources/**", - "sdk/aot/azure-aot-graalvm-samples/**", "sdk/agrifood/azure-verticals-agrifood-farming/**", - "sdk/aot/azure-aot-graalvm-support-netty/**", "sdk/anomalydetector/azure-ai-anomalydetector/**", - "sdk/aot/azure-aot-graalvm-support/**", "sdk/appconfiguration/azure-spring-cloud-test-appconfiguration-config/**", "sdk/appconfiguration/azure-spring-cloud-starter-appconfiguration-config/**", "sdk/appconfiguration/azure-spring-cloud-feature-management-web/**", 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 ebf634c2a2415..019165e9fbd01 100644 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -40,19 +40,6 @@ - - - - - - - - - @@ -161,7 +148,7 @@ - + diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index ea96e0bc08385..cfce3feec6627 100644 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1714,24 +1714,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/eng/scripts/aggregate_javadoc_configuration.txt b/eng/scripts/aggregate_javadoc_configuration.txt index fb0f3e793226f..50144e1906d86 100644 --- a/eng/scripts/aggregate_javadoc_configuration.txt +++ b/eng/scripts/aggregate_javadoc_configuration.txt @@ -20,7 +20,6 @@ Group;Azure Core - Test;com.azure.core.test* Group;Azure Core - Tracing - OpenTelemetry;com.azure.core.tracing.opentelemetry* Group;Azure Agrifood;com.azure.verticals.agrifood.farming* Group;Azure Anomaly Detector;com.azure.ai.anomalydetector* -Group;Azure AOT - GraalVM;com.azure.aot.graalvm* Group;Azure App Configuration;com.azure.data.appconfiguration* Group;Azure Communication;com.azure.communication* Group;Azure Confidential Ledger;com.azure.security.confidentialledger* diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index a8fe028ca1af7..ef81e4752a922 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -87,8 +87,6 @@ org.glassfish.tyrus:tyrus-client;1.16 org.openjfx:javafx-graphics;17.0.6 org.graalvm.buildtools:junit-platform-native;0.9.19 org.graalvm.buildtools:native-maven-plugin;0.9.19 -org.graalvm.sdk:graal-sdk;22.0.0.2 -org.graalvm.nativeimage:svm;22.0.0.2 org.postgresql:postgresql;42.3.9 org.slf4j:slf4j-api;1.7.36 org.slf4j:slf4j-nop;1.7.36 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5d91fecd79163..686bdd78619a8 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -63,10 +63,6 @@ com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.15;1.0.0-beta.16 com.azure:azure-analytics-synapse-spark;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.4;1.0.0-beta.5 -com.azure:azure-aot-graalvm-support;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-aot-graalvm-samples;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-code-customization-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-callautomation;1.3.1;1.4.0-beta.2 com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5 diff --git a/pom.xml b/pom.xml index 6d0fed5556e45..77207810316cc 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,6 @@ sdk/ai sdk/alertsmanagement sdk/anomalydetector - sdk/aot sdk/apicenter sdk/apimanagement sdk/appcomplianceautomation diff --git a/sdk/aot/azure-aot-graalvm-perf/CHANGELOG.md b/sdk/aot/azure-aot-graalvm-perf/CHANGELOG.md deleted file mode 100644 index 92fbcde772d12..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Release History - -## 1.0.0-beta.1 (Unreleased) -Version 1.0.0-beta.1 is an early preview release of our performance testing framework related to our efforts in supporting GraalVM in the Azure SDK for Java. - -## Features Added -- Initial release. Please see the README and wiki for information on using the new library. diff --git a/sdk/aot/azure-aot-graalvm-perf/README.md b/sdk/aot/azure-aot-graalvm-perf/README.md deleted file mode 100644 index 1d246214786f6..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Azure GraalVM performance testing configuration client library for Java - -## Getting started - -### Prerequisites -- A [Java Development Kit (JDK)][jdk_link], version 8 or later. -- [Azure Subscription][azure_subscription] -- [GraalVM][graalvm] - -### Include the package - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-perf;current}) -```xml - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -## Key concepts - -## Examples - -## Troubleshooting - -## Next steps - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License -Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the -PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this -once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable -[azure_subscription]: https://azure.microsoft.com/free -[graalvm]: https://www.graalvm.org/downloads/ - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-perf%2FREADME.png) diff --git a/sdk/aot/azure-aot-graalvm-perf/pom.xml b/sdk/aot/azure-aot-graalvm-perf/pom.xml deleted file mode 100644 index de61eb787592e..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - 4.0.0 - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - jar - Microsoft Azure SDK for Java GraalVM performance testing framework - This package contains GraalVM configuration for running Azure SDK for Java performance tests. - - com.azure - azure-perf-test-parent - 1.0.0-beta.1 - ../../parents/azure-perf-test-parent - - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - scm:git:https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - UTF-8 - - - - - - microsoft - Microsoft - - - diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-formrecognizer/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-formrecognizer/reflect-config.json deleted file mode 100644 index 47b9d8e765dd9..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-formrecognizer/reflect-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "name": "com.azure.ai.formrecognizer.perf.DocumentModelAnalysisTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-textanalytics/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-textanalytics/reflect-config.json deleted file mode 100644 index 3c70a10fce742..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-ai-textanalytics/reflect-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "name": "com.azure.ai.textanalytics.perf.DetectLanguageTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json deleted file mode 100644 index 0c22bd11bf419..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "name": "com.azure.perf.test.core.PerfStressOptions", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.MockEventProcessorTest$MockEventProcessorPerfOptions", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.MockBatchReceiverTest$MockReceiverOptions", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.HttpPipelineOptions", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.ExceptionTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.MockBatchReceiverTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.MockEventProcessorTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.NoOpTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.SleepTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.perf.test.core.HttpPipelineTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.beust.jcommander.validators.NoValueValidator", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.beust.jcommander.validators.NoValidator", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.BooleanConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.IntegerConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.StringConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.EnumConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.DoubleConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.FloatConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.LongConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.URIConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name":"com.beust.jcommander.converters.URLConverter", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json deleted file mode 100644 index 66e222bb78f32..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "name": "com.azure.data.appconfiguration.perf.ListConfigurationSettingsTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-tables/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-tables/reflect-config.json deleted file mode 100644 index 545ea73709c49..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-data-tables/reflect-config.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "name": "com.azure.data.tables.perf.CreateEntityWithAllTypes", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.tables.perf.CreateEntityWithAllTypesUsingTransaction", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.tables.perf.CreateEntityWithStringsOnly", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.tables.perf.CreateEntityWithStringsOnlyUsingTransaction", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.tables.perf.ListEntitiesWithStringsOnlyTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.tables.perf.ListEntitiesWithAllTypesTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-monitor-query/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-monitor-query/reflect-config.json deleted file mode 100644 index a5ea62bf281c9..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-monitor-query/reflect-config.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "name": "com.azure.monitor.query.perf.LogsBatchQueryTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.monitor.query.perf.LogsQueryAsModelTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.monitor.query.perf.MetricsQueryTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-search-documents/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-search-documents/reflect-config.json deleted file mode 100644 index 71aa3861dc57d..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-search-documents/reflect-config.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "name": "com.azure.search.perf.AutocompleteTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.search.perf.IndexDocumentsTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.search.perf.SearchDocumentsTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.search.perf.SuggestTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault/reflect-config.json deleted file mode 100644 index 6c0fd2311815d..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault/reflect-config.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "name": "com.azure.security.keyvault.certificates.perf.GetCertificateTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.keys.perf.DecryptTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.keys.perf.GetKeyTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.keys.perf.SignTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.keys.perf.UnwrapTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.secrets.perf.GetSecretTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.security.keyvault.secrets.perf.ListSecretsTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/reflect-config.json b/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/reflect-config.json deleted file mode 100644 index 1608799d429a2..0000000000000 --- a/sdk/aot/azure-aot-graalvm-perf/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/reflect-config.json +++ /dev/null @@ -1,116 +0,0 @@ -[ - { - "name": "com.azure.storage.blob.perf.DownloadBlobTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.ListBlobsTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.UploadBlobNoLengthTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.UploadBlobTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.UploadBlockBlobTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.UploadFromFileTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.UploadOutputStreamTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.StoragePerfStressOptions", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.share.perf.DownloadFileShareTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.share.perf.DownloadToFileShareTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.share.perf.UploadFileShareTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.share.perf.UploadFromFileShareTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.datalake.perf.AppendFileDatalakeTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.datalake.perf.ReadFileDatalakeTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.datalake.perf.UploadFileDatalakeTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.datalake.perf.UploadFromFileDatalakeTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.file.datalake.perf.UploadFromFileDatalakeTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.DownloadBlobToFileTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.storage.blob.perf.DownloadBlobNonSharedClientTest", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-samples/CHANGELOG.md b/sdk/aot/azure-aot-graalvm-samples/CHANGELOG.md deleted file mode 100644 index 8f79f2cc94481..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Release History - -## 1.0.0-beta.1 (Unreleased) -Version 1.0.0-beta.1 is a first preview release of sample code that demonstrates many common scenarios, and their ability to be executed as native images using GraalVM native image compilation. - -## Features Added -- Initial release. Please see the README and wiki for information on using the new library. diff --git a/sdk/aot/azure-aot-graalvm-samples/README.md b/sdk/aot/azure-aot-graalvm-samples/README.md deleted file mode 100644 index cf63467605b36..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Azure GraalVM samples client library for Java - -## Getting started - -### Prerequisites -- A [Java Development Kit (JDK)][jdk_link], version 8 or later. -- [Azure Subscription][azure_subscription] -- [GraalVM][graalvm] -### Include the package - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-samples;current}) -```xml - - com.azure - azure-aot-graalvm-samples - 1.0.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -## Key concepts - -## Examples - -## Troubleshooting - -## Next steps - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License -Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the -PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this -once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable -[azure_subscription]: https://azure.microsoft.com/free -[graalvm]: https://www.graalvm.org/downloads/ - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-samples%2FREADME.png) diff --git a/sdk/aot/azure-aot-graalvm-samples/pom.xml b/sdk/aot/azure-aot-graalvm-samples/pom.xml deleted file mode 100644 index f0750930583d5..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/pom.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - 4.0.0 - - com.azure - azure-aot-graalvm-samples - 1.0.0-beta.1 - - jar - Microsoft Azure SDK for Java GraalVM samples - This package contains samples for using Azure SDK for Java with GraalVM. - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - scm:git:https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - UTF-8 - - true - - - - - - microsoft - Microsoft - - - - - - - com.azure - azure-data-appconfiguration - 1.7.3 - - - com.azure - azure-identity - 1.15.0 - - - com.azure - azure-security-keyvault-keys - 4.9.1 - - - com.azure - azure-storage-blob - 12.29.0 - - - - com.azure - azure-security-keyvault-secrets - 4.9.1 - - - com.azure - azure-security-keyvault-certificates - 4.7.1 - - - - com.azure - azure-messaging-eventhubs - 5.19.2 - - - com.azure - azure-cosmos - 4.66.0 - - - com.azure - azure-ai-formrecognizer - 4.1.12 - - - com.azure - azure-ai-textanalytics - 5.5.4 - - - - - - org.junit.jupiter - junit-jupiter-api - 5.11.2 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.11.2 - test - - - org.junit.jupiter - junit-jupiter-params - 5.11.2 - test - - - org.graalvm.buildtools - junit-platform-native - 0.9.19 - test - - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - com.azure.aot.graalvm.samples.AzureGraalVmSamples - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.7.1 - - - jar-with-dependencies - - - - com.azure.aot.graalvm.samples.AzureGraalVmSamples - - - false - - - - make-assembly - package - - single - - - - - - - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - com.azure.aot.graalvm.samples.AzureGraalVmSamples - azure-aot-graalvm-sample - - - - build-native - - build - - package - - - - - - - - - diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/AzureGraalVmSamples.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/AzureGraalVmSamples.java deleted file mode 100644 index f636da8e54723..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/AzureGraalVmSamples.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples; - -import com.azure.aot.graalvm.samples.appconfiguration.AppConfigurationSample; -import com.azure.aot.graalvm.samples.eventhubs.EventHubsSample; -import com.azure.aot.graalvm.samples.formrecognizer.FormRecognizerSample; -import com.azure.aot.graalvm.samples.keyvault.certificates.KeyVaultCertificatesSample; -import com.azure.aot.graalvm.samples.keyvault.keys.KeyVaultKeysSample; -import com.azure.aot.graalvm.samples.keyvault.secrets.KeyVaultSecretsSample; -import com.azure.aot.graalvm.samples.storage.blob.StorageBlobSample; -import com.azure.aot.graalvm.samples.textanalytics.TextAnalyticsSample; -import java.io.IOException; - -/** - * Main class to run Azure client samples using GraalVM. - */ -public final class AzureGraalVmSamples { - /** - * Main method to run the samples. - * @param args args to samples. - */ - public static void main(String[] args) throws IOException { - AppConfigurationSample.runSample(); - EventHubsSample.runSample(); - FormRecognizerSample.runSample(); - KeyVaultCertificatesSample.runSample(); - KeyVaultKeysSample.runSample(); - KeyVaultSecretsSample.runSample(); - StorageBlobSample.runSample(); - TextAnalyticsSample.runSample(); - - // GraalVM does not support AfterBurner and Cosmos explicitly adds AfterBurner - // CosmosSample runs successfully if afterburner registration is removed in Cosmos - // https://github.com/micronaut-projects/micronaut-core/issues/2575 - // https://github.com/awslabs/aws-serverless-java-container/issues/428 - // CosmosSample.runSample(); - } - - private AzureGraalVmSamples() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/appconfiguration/AppConfigurationSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/appconfiguration/AppConfigurationSample.java deleted file mode 100644 index dde0d0fdb71ab..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/appconfiguration/AppConfigurationSample.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.appconfiguration; - -import com.azure.data.appconfiguration.ConfigurationClient; -import com.azure.data.appconfiguration.ConfigurationClientBuilder; -import com.azure.data.appconfiguration.models.ConfigurationSetting; -import com.azure.identity.DefaultAzureCredentialBuilder; - -/** - * A sample to demonstrate setting and getting a config from Azure Application Configuration operations using GraalVM. - */ -public final class AppConfigurationSample { - private static final String AZURE_APP_CONFIGURATION_CONNECTION_STRING - = System.getenv("AZURE_APP_CONFIGURATION_CONNECTION_STRING"); - - /** - * The method to run the app configuration sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting App Configuration Sample"); - System.out.println("================================================================"); - - final ConfigurationClientBuilder configurationClientBuilder = new ConfigurationClientBuilder(); - - if (AZURE_APP_CONFIGURATION_CONNECTION_STRING != null && !AZURE_APP_CONFIGURATION_CONNECTION_STRING.isEmpty()) { - configurationClientBuilder.connectionString(AZURE_APP_CONFIGURATION_CONNECTION_STRING); - } else { - configurationClientBuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - - final ConfigurationClient configurationClient = configurationClientBuilder.buildClient(); - - System.out.println("Setting configuration"); - ConfigurationSetting setting = configurationClient.setConfigurationSetting("key", "label", "value"); - System.out.println("Done: " + setting.getLastModified()); - - setting = configurationClient.getConfigurationSetting("key", "label"); - System.out.println("Retrieved setting again, value is " + setting.getValue()); - - System.out.println("\n================================================================"); - System.out.println(" App Configuration Sample Complete"); - System.out.println("================================================================"); - } - - private AppConfigurationSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Address.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Address.java deleted file mode 100644 index 1ea5b1940a03b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Address.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -/** - * The address model. - */ -public class Address { - private String state = ""; - private String county = ""; - private String city = ""; - - /** - * Creates a new instance of {@link Address}. - */ - public Address() { - } - - /** - * Returns the state. - * @return the state. - */ - public String getState() { - return state; - } - - /** - * Sets the state. - * @param state the state. - */ - public void setState(String state) { - this.state = state; - } - - /** - * Returns the county. - * @return the county. - */ - public String getCounty() { - return county; - } - - /** - * Sets the county. - * @param county the county. - */ - public void setCounty(String county) { - this.county = county; - } - - /** - * Returns the city. - * @return the city. - */ - public String getCity() { - return city; - } - - /** - * Sets the city. - * @param city the city. - */ - public void setCity(String city) { - this.city = city; - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Child.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Child.java deleted file mode 100644 index 884da1813e3ca..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Child.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -import java.util.Arrays; - -/** - * The child model. - */ -public class Child { - private String familyName; - private String firstName; - private String gender; - private int grade; - private Pet[] pets = { }; - - /** - * Creates a new instance of {@link Child}. - */ - public Child() { - } - - /** - * Returns the family name. - * @return the family name. - */ - public String getFamilyName() { - return familyName; - } - - /** - * Sets the family name. - * @param familyName the family name. - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * Returns the first name. - * @return the first name. - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets the first name. - * @param firstName the first name. - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * Returns the gender. - * @return the gender. - */ - public String getGender() { - return gender; - } - - /** - * Sets the gender. - * @param gender the gender. - */ - public void setGender(String gender) { - this.gender = gender; - } - - /** - * Returns the grade. - * @return the grade. - */ - public int getGrade() { - return grade; - } - - /** - * Sets the grade. - * @param grade the grade. - */ - public void setGrade(int grade) { - this.grade = grade; - } - - /** - * Returns the pets array. - * @return the pets array. - */ - public Pet[] getPets() { - return Arrays.copyOf(pets, pets.length); - } - - /** - * Sets the pets array. - * @param pets the pets array. - */ - public void setPets(Pet[] pets) { - this.pets = Arrays.copyOf(pets, pets.length); - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/CosmosSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/CosmosSample.java deleted file mode 100644 index 11853383c7cb2..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/CosmosSample.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -import com.azure.cosmos.ConsistencyLevel; -import com.azure.cosmos.CosmosClient; -import com.azure.cosmos.CosmosClientBuilder; -import com.azure.cosmos.CosmosContainer; -import com.azure.cosmos.CosmosDatabase; -import com.azure.cosmos.CosmosException; -import com.azure.cosmos.models.CosmosContainerProperties; -import com.azure.cosmos.models.CosmosContainerResponse; -import com.azure.cosmos.models.CosmosDatabaseResponse; -import com.azure.cosmos.models.CosmosItemRequestOptions; -import com.azure.cosmos.models.CosmosItemResponse; -import com.azure.cosmos.models.CosmosQueryRequestOptions; -import com.azure.cosmos.models.PartitionKey; -import com.azure.cosmos.models.ThroughputProperties; -import com.azure.cosmos.util.CosmosPagedIterable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * A sample to demonstrate creating containers, databases and items in Cosmos DB using GraalVM. - */ -public final class CosmosSample { - private static final String AZURE_COSMOS_ENDPOINT = System.getenv("AZURE_COSMOS_ENDPOINT"); - private static final String AZURE_COSMOS_KEY = System.getenv("AZURE_COSMOS_KEY"); - - private CosmosClient client; - - private final String databaseName = "AzureSampleFamilyDB"; - private final String containerName = "FamilyContainer"; - - private CosmosDatabase database; - private CosmosContainer container; - - private static final Logger LOGGER = LoggerFactory.getLogger(CosmosSample.class); - - /** - * The method to run the cosmos sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting Cosmos Sample"); - System.out.println("================================================================"); - - if (AZURE_COSMOS_ENDPOINT == null || AZURE_COSMOS_ENDPOINT.isEmpty()) { - System.err.println("azure_cosmos_endpoint environment variable is not set - exiting"); - return; - } - - if (AZURE_COSMOS_KEY == null || AZURE_COSMOS_KEY.isEmpty()) { - System.err.println("azure_cosmos_key environment variable is not set - exiting"); - return; - } - - CosmosSample sample = new CosmosSample(); - - try { - sample.startSample(); - System.out.println("Demo complete, please hold while resources are released"); - } catch (Exception e) { - System.out.println("Error running Cosmos sample " + e.getMessage()); - e.printStackTrace(); - } finally { - System.out.println("Closing the client"); - sample.shutdown(); - } - - System.out.println("\n================================================================"); - System.out.println(" Cosmos Sample Complete"); - System.out.println("================================================================"); - } - - private void startSample() throws Exception { - // Create sync client - client = new CosmosClientBuilder().endpoint(AZURE_COSMOS_ENDPOINT) - .key(AZURE_COSMOS_KEY) - .preferredRegions(Arrays.asList("West US")) - .consistencyLevel(ConsistencyLevel.EVENTUAL) - .contentResponseOnWriteEnabled(true) - .buildClient(); - - createDatabaseIfNotExists(); - System.out.println("Creating container"); - createContainerIfNotExists(); - - // Setup family items to create - List familiesToCreate = new ArrayList<>(); - familiesToCreate.add(Families.getAndersenFamilyItem()); - familiesToCreate.add(Families.getWakefieldFamilyItem()); - familiesToCreate.add(Families.getJohnsonFamilyItem()); - familiesToCreate.add(Families.getSmithFamilyItem()); - - // Creates several items in the container - // Also applies an upsert operation to one of the items (create if not present, otherwise replace) - createFamilies(familiesToCreate); - - System.out.println("Reading items."); - readItems(familiesToCreate); - - System.out.println("Replacing items."); - replaceItems(familiesToCreate); - - System.out.println("Querying items."); - queryItems(); - - System.out.println("Delete an item."); - deleteItem(familiesToCreate.get(0)); - } - - private void createDatabaseIfNotExists() throws Exception { - System.out.println("Create database " + databaseName + " if not exists."); - - // Create database if not exists - // - CosmosDatabaseResponse databaseResponse = client.createDatabaseIfNotExists(databaseName); - database = client.getDatabase(databaseResponse.getProperties().getId()); - - // - - System.out.println("Checking database " + database.getId() + " completed!\n"); - } - - private void createContainerIfNotExists() throws Exception { - System.out.println("Create container " + containerName + " if not exists."); - - // Create container if not exists - // - CosmosContainerProperties containerProperties = new CosmosContainerProperties(containerName, "/lastName"); - - // Create container with 400 RU/s - ThroughputProperties throughputProperties = ThroughputProperties.createManualThroughput(400); - CosmosContainerResponse containerResponse - = database.createContainerIfNotExists(containerProperties, throughputProperties); - container = database.getContainer(containerResponse.getProperties().getId()); - // - - System.out.println("Checking container " + container.getId() + " completed!\n"); - } - - private void createFamilies(List families) throws Exception { - double totalRequestCharge = 0; - for (Family family : families) { - - // - // Create item using container that we created using sync client - - // Use lastName as partitionKey for cosmos item - // Using appropriate partition key improves the performance of database operations - CosmosItemRequestOptions cosmosItemRequestOptions = new CosmosItemRequestOptions(); - CosmosItemResponse item - = container.createItem(family, new PartitionKey(family.getLastName()), cosmosItemRequestOptions); - // - - // Get request charge and other properties like latency, and diagnostics strings, etc. - System.out.println(String.format("Created item with request charge of %.2f within duration %s", - item.getRequestCharge(), item.getDuration())); - - totalRequestCharge += item.getRequestCharge(); - } - System.out.println( - String.format("Created %d items with total request charge of %.2f", families.size(), totalRequestCharge)); - - Family familyToUpsert = families.get(0); - System.out.println(String.format("Upserting the item with id %s after modifying the isRegistered field...", - familyToUpsert.getId())); - familyToUpsert.setRegistered(!familyToUpsert.isRegistered()); - - CosmosItemResponse item = container.upsertItem(familyToUpsert); - - // Get upsert request charge and other properties like latency, and diagnostics strings, etc. - System.out.println(String.format("Upserted item with request charge of %.2f within duration %s", - item.getRequestCharge(), item.getDuration())); - } - - private void readItems(List familiesToCreate) { - // Using partition key for point read scenarios. - // This will help fast look up of items because of partition key - familiesToCreate.forEach(family -> { - // - try { - CosmosItemResponse item - = container.readItem(family.getId(), new PartitionKey(family.getLastName()), Family.class); - double requestCharge = item.getRequestCharge(); - Duration requestLatency = item.getDuration(); - System.out.println( - String.format("Item successfully read with id %s with a charge of %.2f and within duration %s", - item.getItem().getId(), requestCharge, requestLatency)); - } catch (CosmosException e) { - e.printStackTrace(); - System.out.println(String.format("Read Item failed with %s", e)); - } - // - }); - } - - private void replaceItems(List familiesToCreate) { - familiesToCreate.forEach(family -> { - // - try { - String district = family.getDistrict(); - family.setDistrict(district + "_newDistrict"); - CosmosItemResponse item = container.replaceItem(family, family.getId(), - new PartitionKey(family.getLastName()), new CosmosItemRequestOptions()); - double requestCharge = item.getRequestCharge(); - Duration requestLatency = item.getDuration(); - System.out.printf("Item successfully replaced with id: %s, district: %s, charge: %s, duration: %s", - item.getItem().getId(), item.getItem().getDistrict(), requestCharge, requestLatency); - } catch (CosmosException e) { - LOGGER.error(String.format("Replace Item failed with %s", e)); - } - // - }); - } - - private void queryItems() { - // - - // Set some common query options - int preferredPageSize = 10; - CosmosQueryRequestOptions queryOptions = new CosmosQueryRequestOptions(); - //queryOptions.setEnableCrossPartitionQuery(true); //No longer necessary in SDK v4 - // Set populate query metrics to get metrics around query executions - queryOptions.setQueryMetricsEnabled(true); - - CosmosPagedIterable familiesPagedIterable - = container.queryItems("SELECT * FROM Family WHERE Family.lastName IN ('Andersen', 'Wakefield', 'Johnson')", - queryOptions, Family.class); - - familiesPagedIterable.iterableByPage(preferredPageSize).forEach(cosmosItemPropertiesFeedResponse -> { - System.out.println("Got a page of query result with " + cosmosItemPropertiesFeedResponse.getResults().size() - + " items(s)" + " and request charge of " + cosmosItemPropertiesFeedResponse.getRequestCharge()); - - System.out.println("Item Ids " + cosmosItemPropertiesFeedResponse.getResults() - .stream() - .map(Family::getId) - .collect(Collectors.toList())); - }); - // - } - - private void deleteItem(Family item) { - container.deleteItem(item.getId(), new PartitionKey(item.getLastName()), new CosmosItemRequestOptions()); - } - - private void shutdown() { - try { - //Clean shutdown - System.out.println("Deleting Cosmos DB resources"); - System.out.println("-Deleting container..."); - if (container != null) { - container.delete(); - } - System.out.println("-Deleting database..."); - if (database != null) { - database.delete(); - } - System.out.println("-Closing the client..."); - } catch (Exception err) { - LOGGER.error( - "Deleting Cosmos DB resources failed, will still attempt to close the client. See stack trace below."); - err.printStackTrace(); - } - client.close(); - System.out.println("Done."); - } - - private CosmosSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Families.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Families.java deleted file mode 100644 index 23fc5bf231787..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Families.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -/** - * Helper class to get family details. - */ -public final class Families { - - /** - * Returns the family details of Andersen family. - * @return the family details of Andersen family. - */ - public static Family getAndersenFamilyItem() { - Family andersenFamily = new Family(); - andersenFamily.setId("Andersen-" + System.currentTimeMillis()); - andersenFamily.setLastName("Andersen"); - - Parent parent1 = new Parent(); - parent1.setFirstName("Thomas"); - - Parent parent2 = new Parent(); - parent2.setFirstName("Mary Kay"); - - andersenFamily.setParents(new Parent[] { parent1, parent2 }); - - Child child1 = new Child(); - child1.setFirstName("Henriette Thaulow"); - child1.setGender("female"); - child1.setGrade(5); - - Pet pet1 = new Pet(); - pet1.setGivenName("Fluffy"); - - child1.setPets(new Pet[] { pet1 }); - - andersenFamily.setDistrict("WA5"); - Address address = new Address(); - address.setCity("Seattle"); - address.setCounty("King"); - address.setState("WA"); - - andersenFamily.setAddress(address); - andersenFamily.setRegistered(true); - andersenFamily.setChildren(new Child[] { child1 }); - - return andersenFamily; - } - - /** - * Returns the family details of Wakefield family. - * @return the family details of Wakefield family. - */ - public static Family getWakefieldFamilyItem() { - Family wakefieldFamily = new Family(); - wakefieldFamily.setId("Wakefield-" + System.currentTimeMillis()); - wakefieldFamily.setLastName("Wakefield"); - - Parent parent1 = new Parent(); - parent1.setFamilyName("Wakefield"); - parent1.setFirstName("Robin"); - - Parent parent2 = new Parent(); - parent2.setFamilyName("Miller"); - parent2.setFirstName("Ben"); - - wakefieldFamily.setParents(new Parent[] { parent1, parent2 }); - - Child child1 = new Child(); - child1.setFirstName("Jesse"); - child1.setFamilyName("Merriam"); - child1.setGrade(8); - - Pet pet1 = new Pet(); - pet1.setGivenName("Goofy"); - - Pet pet2 = new Pet(); - pet2.setGivenName("Shadow"); - - child1.setPets(new Pet[] { pet1, pet2 }); - - Child child2 = new Child(); - child2.setFirstName("Lisa"); - child2.setFamilyName("Miller"); - child2.setGrade(1); - child2.setGender("female"); - - wakefieldFamily.setChildren(new Child[] { child1, child2 }); - - Address address = new Address(); - address.setCity("NY"); - address.setCounty("Manhattan"); - address.setState("NY"); - - wakefieldFamily.setAddress(address); - wakefieldFamily.setDistrict("NY23"); - wakefieldFamily.setRegistered(true); - wakefieldFamily.setChildren(new Child[] { child1, child2 }); - return wakefieldFamily; - } - - /** - * Returns the family details of Johnson family. - * @return the family details of Johnson family. - */ - public static Family getJohnsonFamilyItem() { - Family johnsonFamily = new Family(); - johnsonFamily.setId("Johnson-" + System.currentTimeMillis()); - johnsonFamily.setLastName("Johnson"); - - Parent parent1 = new Parent(); - parent1.setFirstName("John"); - - Parent parent2 = new Parent(); - parent2.setFirstName("Lili"); - - johnsonFamily.setParents(new Parent[] { parent1, parent2 }); - - return johnsonFamily; - } - - /** - * Returns the family details of Smith family. - * @return the family details of Smith family. - */ - public static Family getSmithFamilyItem() { - Family smithFamily = new Family(); - smithFamily.setId("Smith-" + System.currentTimeMillis()); - smithFamily.setLastName("Smith"); - - Parent parent1 = new Parent(); - parent1.setFirstName("John"); - - Parent parent2 = new Parent(); - parent2.setFirstName("Cynthia"); - smithFamily.setParents(new Parent[] { parent1, parent2 }); - - return smithFamily; - } - - private Families() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Family.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Family.java deleted file mode 100644 index f7e9f4f2137d0..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Family.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -import java.util.Arrays; - -/** - * The family model. - */ -public class Family { - private String id = ""; - private String lastName = ""; - private String district = ""; - private Parent[] parents = { }; - private Child[] children = { }; - private Address address = new Address(); - private boolean isRegistered = false; - - /** - * Creates a new instance of {@link Family}. - */ - public Family() { - } - - /** - * Returns the family id. - * @return the family id. - */ - public String getId() { - return id; - } - - /** - * Sets the family id. - * @param id the family id. - */ - public void setId(String id) { - this.id = id; - } - - /** - * Returns the family last name. - * @return the family last name. - */ - public String getLastName() { - return lastName; - } - - /** - * Sets the family last name. - * @param lastName the family last name. - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Returns the district. - * @return the district. - */ - public String getDistrict() { - return district; - } - - /** - * Sets the district. - * @param district the district. - */ - public void setDistrict(String district) { - this.district = district; - } - - /** - * Returns the parents array. - * @return the parents array. - */ - public Parent[] getParents() { - return Arrays.copyOf(parents, parents.length); - } - - /** - * Sets the parents array. - * @param parents the parents array. - */ - public void setParents(Parent[] parents) { - this.parents = Arrays.copyOf(parents, parents.length); - } - - /** - * Returns the children array. - * @return the children array. - */ - public Child[] getChildren() { - return Arrays.copyOf(children, children.length); - } - - /** - * Sets the children array. - * @param children the children array. - */ - public void setChildren(Child[] children) { - this.children = Arrays.copyOf(children, children.length); - } - - /** - * Returns the address. - * @return the address. - */ - public Address getAddress() { - return address; - } - - /** - * Sets the address. - * @param address the address. - */ - public void setAddress(Address address) { - this.address = address; - } - - /** - * Returns true if the family is registered. - * @return true if the family is registered. - */ - public boolean isRegistered() { - return isRegistered; - } - - /** - * Sets the registration state of the family. - * @param isRegistered the registration state of the family - */ - public void setRegistered(boolean isRegistered) { - this.isRegistered = isRegistered; - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Parent.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Parent.java deleted file mode 100644 index 1b6a205f9f9a3..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Parent.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -/** - * The parent model. - */ -public class Parent { - private String familyName; - private String firstName; - - /** - * The empty constructor to create a parent instance. - */ - public Parent() { - } - - /** - * The constructor to create a parent instance with a first name. - * @param firstName the first name of the parent. - */ - public Parent(String firstName) { - this.firstName = firstName; - } - - /** - * Returns the family name. - * @return the family name. - */ - public String getFamilyName() { - return familyName; - } - - /** - * Sets the family name. - * @param familyName the family name. - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * Returns the first name. - * @return the first name. - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets the first name. - * @param firstName the first name. - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Pet.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Pet.java deleted file mode 100644 index 274b576f5345b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/cosmos/Pet.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.cosmos; - -/** - * The pet model. - */ -public class Pet { - private String givenName; - - /** - * Creates a new instance of {@link Pet}. - */ - public Pet() { - } - - /** - * Returns the name of the pet. - * @return the name of the pet. - */ - public String getGivenName() { - return givenName; - } - - /** - * Sets the name of the pet. - * @param givenName the name of the pet. - */ - public void setGivenName(String givenName) { - this.givenName = givenName; - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/eventhubs/EventHubsSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/eventhubs/EventHubsSample.java deleted file mode 100644 index a894cb12b0e45..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/eventhubs/EventHubsSample.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.eventhubs; - -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.messaging.eventhubs.EventData; -import com.azure.messaging.eventhubs.EventHubClientBuilder; -import com.azure.messaging.eventhubs.EventHubProducerClient; - -import java.util.Arrays; - -/** - * An Event Hubs sample to demonstrate sending events to Event Hubs using GraalVM. - */ -public final class EventHubsSample { - private static final String AZURE_EVENT_HUBS_CONNECTION_STRING - = Configuration.getGlobalConfiguration().get("AZURE_EVENT_HUBS_CONNECTION_STRING", ""); - private static final String AZURE_EVENT_HUBS_NAMESPACE - = Configuration.getGlobalConfiguration().get("AZURE_EVENT_HUBS_NAMESPACE", ""); - private static final String AZURE_EVENT_HUBS_NAME - = Configuration.getGlobalConfiguration().get("AZURE_EVENT_HUBS_NAME", ""); - - /** - * The method to run Event Hubs sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting Event Hubs Sender Sample"); - System.out.println("================================================================"); - - if (AZURE_EVENT_HUBS_CONNECTION_STRING.isEmpty() - || (AZURE_EVENT_HUBS_NAMESPACE.isEmpty() && AZURE_EVENT_HUBS_NAME.isEmpty())) { - System.err.println("AZURE_EVENT_HUBS_CONNECTION_STRING environment variable should be set or " - + "AZURE_EVENT_HUBS_NAMESPACE and AZURE_EVENT_HUBS_NAME environment variables should be set to " - + "run this sample."); - return; - - } - EventHubClientBuilder eventHubClientBuilder = new EventHubClientBuilder(); - - if (AZURE_EVENT_HUBS_CONNECTION_STRING.isEmpty()) { - eventHubClientBuilder.credential(AZURE_EVENT_HUBS_NAMESPACE, AZURE_EVENT_HUBS_NAME, - new DefaultAzureCredentialBuilder().build()); - } else { - eventHubClientBuilder.connectionString(AZURE_EVENT_HUBS_CONNECTION_STRING); - } - - final EventHubProducerClient eventHubProducerClient = eventHubClientBuilder.buildProducerClient(); - - System.out.println("Event Hub producer client created"); - eventHubProducerClient.send(Arrays.asList(new EventData("Test event - graalvm"))); - System.out.println("Sent message to Event Hub"); - - eventHubProducerClient.close(); - - System.out.println("\n================================================================"); - System.out.println(" Event Hubs Sender Sample Complete"); - System.out.println("================================================================"); - } - - private EventHubsSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/formrecognizer/FormRecognizerSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/formrecognizer/FormRecognizerSample.java deleted file mode 100644 index d9cef62410d07..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/formrecognizer/FormRecognizerSample.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.formrecognizer; - -import com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisClient; -import com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisClientBuilder; -import com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult; -import com.azure.ai.formrecognizer.documentanalysis.models.AnalyzedDocument; -import com.azure.ai.formrecognizer.documentanalysis.models.DocumentField; -import com.azure.ai.formrecognizer.documentanalysis.models.DocumentFieldType; -import com.azure.ai.formrecognizer.documentanalysis.models.OperationResult; -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -import java.io.IOException; -import java.io.InputStream; -import java.time.LocalDate; -import java.util.List; -import java.util.Map; - -/** - * A sample to demonstrate Form Recognizer's functionality to recognize receipts using GraalVM. - */ -public final class FormRecognizerSample { - private static final String AZURE_FORM_RECOGNIZER_ENDPOINT = System.getenv("AZURE_FORM_RECOGNIZER_ENDPOINT"); - private static final String AZURE_FORM_RECOGNIZER_KEY = System.getenv("AZURE_FORM_RECOGNIZER_KEY"); - - /** - * The method to run the formrecognizer sample. - * @throws IOException if the input image cannot be read. - */ - public static void runSample() throws IOException { - System.out.println("\n================================================================"); - System.out.println(" Starting Form Recognizer Sample"); - System.out.println("================================================================"); - - // Instantiate a client that will be used to call the service. - DocumentAnalysisClient client - = new DocumentAnalysisClientBuilder().credential(new AzureKeyCredential(AZURE_FORM_RECOGNIZER_KEY)) - .endpoint(AZURE_FORM_RECOGNIZER_ENDPOINT) - .buildClient(); - - String fileName = "contoso-allinone.jpg"; - InputStream resourceAsStream = FormRecognizerSample.class.getClassLoader().getResourceAsStream(fileName); - BinaryData imageData = BinaryData.fromStream(resourceAsStream); - byte[] bytes = imageData.toBytes(); - BinaryData requestContent = BinaryData.fromBytes(bytes); - SyncPoller analyzeReceiptPoller - = client.beginAnalyzeDocument("prebuilt-receipt", requestContent); - - AnalyzeResult receiptResults = analyzeReceiptPoller.getFinalResult(); - - for (int i = 0; i < receiptResults.getDocuments().size(); i++) { - AnalyzedDocument analyzedReceipt = receiptResults.getDocuments().get(i); - Map receiptFields = analyzedReceipt.getFields(); - System.out.printf("----------- Analyzing receipt info %d -----------%n", i); - DocumentField merchantNameField = receiptFields.get("MerchantName"); - if (merchantNameField != null) { - if (DocumentFieldType.STRING == merchantNameField.getType()) { - String merchantName = merchantNameField.getValueAsString(); - System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, - merchantNameField.getConfidence()); - } - } - - DocumentField merchantPhoneNumberField = receiptFields.get("MerchantPhoneNumber"); - if (merchantPhoneNumberField != null) { - if (DocumentFieldType.PHONE_NUMBER == merchantPhoneNumberField.getType()) { - String merchantAddress = merchantPhoneNumberField.getValueAsPhoneNumber(); - System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, - merchantPhoneNumberField.getConfidence()); - } - } - - DocumentField merchantAddressField = receiptFields.get("MerchantAddress"); - if (merchantAddressField != null) { - if (DocumentFieldType.STRING == merchantAddressField.getType()) { - String merchantAddress = merchantAddressField.getValueAsString(); - System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, - merchantAddressField.getConfidence()); - } - } - - DocumentField transactionDateField = receiptFields.get("TransactionDate"); - if (transactionDateField != null) { - if (DocumentFieldType.DATE == transactionDateField.getType()) { - LocalDate transactionDate = transactionDateField.getValueAsDate(); - System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, - transactionDateField.getConfidence()); - } - } - - DocumentField receiptItemsField = receiptFields.get("Items"); - if (receiptItemsField != null) { - System.out.printf("Receipt Items: %n"); - if (DocumentFieldType.LIST == receiptItemsField.getType()) { - List receiptItems = receiptItemsField.getValueAsList(); - receiptItems.stream() - .filter(receiptItem -> DocumentFieldType.MAP == receiptItem.getType()) - .map(formField -> formField.getValueAsMap()) - .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (DocumentFieldType.STRING == formField.getType()) { - String name = formField.getValueAsString(); - System.out.printf("Name: %s, confidence: %.2fs%n", name, formField.getConfidence()); - } - } - if ("Quantity".equals(key)) { - if (DocumentFieldType.DOUBLE == formField.getType()) { - Double quantity = formField.getValueAsDouble(); - System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, - formField.getConfidence()); - } - } - if ("Price".equals(key)) { - if (DocumentFieldType.DOUBLE == formField.getType()) { - Double price = formField.getValueAsDouble(); - System.out.printf("Price: %f, confidence: %.2f%n", price, - formField.getConfidence()); - } - } - if ("TotalPrice".equals(key)) { - if (DocumentFieldType.DOUBLE == formField.getType()) { - Double totalPrice = formField.getValueAsDouble(); - System.out.printf("Total Price: %f, confidence: %.2f%n", totalPrice, - formField.getConfidence()); - } - } - })); - } - } - } - - System.out.println("\n================================================================"); - System.out.println(" Form Recognizer Sample Complete"); - System.out.println("================================================================"); - } - - private FormRecognizerSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/certificates/KeyVaultCertificatesSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/certificates/KeyVaultCertificatesSample.java deleted file mode 100644 index 180d48edd990e..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/certificates/KeyVaultCertificatesSample.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.keyvault.certificates; - -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.keyvault.certificates.CertificateClient; -import com.azure.security.keyvault.certificates.CertificateClientBuilder; -import com.azure.security.keyvault.certificates.models.CertificateIssuer; -import com.azure.security.keyvault.certificates.models.CertificateKeyCurveName; -import com.azure.security.keyvault.certificates.models.CertificateKeyType; -import com.azure.security.keyvault.certificates.models.CertificateOperation; -import com.azure.security.keyvault.certificates.models.CertificatePolicy; -import com.azure.security.keyvault.certificates.models.DeletedCertificate; -import com.azure.security.keyvault.certificates.models.KeyVaultCertificate; -import com.azure.security.keyvault.certificates.models.KeyVaultCertificateWithPolicy; -import com.azure.security.keyvault.certificates.models.SubjectAlternativeNames; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** - * A Key Vault Certificate sample to demonstrate CRUD operations using GraalVM. - */ -public final class KeyVaultCertificatesSample { - private static final String AZURE_KEY_VAULT_URL = System.getenv("AZURE_KEY_VAULT_URL"); - - /** - * The method to run Key Vault certificates sample. - */ - public static void runSample() { - System.out.println("================================================================"); - System.out.println(" Starting Key Vault Certificates Sample"); - System.out.println("================================================================"); - - if (AZURE_KEY_VAULT_URL == null || AZURE_KEY_VAULT_URL.isEmpty()) { - System.err.println("azure_key_vault_url environment variable is not set - exiting"); - return; - } - - // Instantiate a certificate client that will be used to call the service. Notice that the client is using default Azure - // credentials. To make default credentials work, ensure that environment variables 'AZURE_CLIENT_ID', - // 'AZURE_CLIENT_KEY' and 'AZURE_TENANT_ID' are set with the service principal credentials. - CertificateClient certificateClient = new CertificateClientBuilder().vaultUrl(AZURE_KEY_VAULT_URL) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); - System.out.println("Created Certificate client"); - - // Let's create a self signed certificate valid for 1 year. if the certificate - // already exists in the key vault, then a new version of the certificate is created. - CertificatePolicy policy = new CertificatePolicy("Self", "CN=SelfSignedJavaPkcs12") - .setSubjectAlternativeNames(new SubjectAlternativeNames().setEmails(Arrays.asList("wow@gmail.com"))) - .setKeyReusable(true) - .setKeyType(CertificateKeyType.EC) - .setKeyCurveName(CertificateKeyCurveName.P_256) - .setValidityInMonths(12); - Map tags = new HashMap<>(); - tags.put("foo", "bar"); - - System.out.println("Creating new certificate"); - String certificateName1 = "certificateName2" + UUID.randomUUID(); - SyncPoller certificatePoller - = certificateClient.beginCreateCertificate(certificateName1, policy, true, tags); - certificatePoller.waitUntil(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); - - // Let's Get the latest version of the certificate from the key vault. - System.out.println("Retrieving the new certificate from the key vault"); - KeyVaultCertificate certificate = certificateClient.getCertificate(certificateName1); - System.out.printf("Certificate is returned with name %s and secret id %s %n", - certificate.getProperties().getName(), certificate.getSecretId()); - - // After some time, we need to disable the certificate temporarily, so we update the enabled status of the certificate. - // The update method can be used to update the enabled status of the certificate. - certificate.getProperties().setEnabled(false); - KeyVaultCertificate updatedCertificate - = certificateClient.updateCertificateProperties(certificate.getProperties()); - System.out.printf("Certificate's updated enabled status is %s %n", - updatedCertificate.getProperties().isEnabled()); - - //Let's create a certificate issuer. - CertificateIssuer issuer = new CertificateIssuer("myIssuer", "Test"); - CertificateIssuer myIssuer = certificateClient.createIssuer(issuer); - System.out.printf("Issuer created with name %s and provider %s", myIssuer.getName(), myIssuer.getProvider()); - - // Let's fetch the issuer we just created from the key vault. - myIssuer = certificateClient.getIssuer("myIssuer"); - System.out.printf("Issuer retrieved with name %s and provider %s", myIssuer.getName(), myIssuer.getProvider()); - - //Let's create a certificate signed by our issuer. - String certificateName2 = "myCertificate" + UUID.randomUUID(); - certificateClient - .beginCreateCertificate(certificateName2, new CertificatePolicy("myIssuer", "CN=SelfSignedJavaPkcs12"), - true, tags) - .waitUntil(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); - - // Let's Get the latest version of our certificate from the key vault. - KeyVaultCertificate myCert = certificateClient.getCertificate(certificateName2); - System.out.printf("Certificate is returned with name %s and secret id %s %n", myCert.getProperties().getName(), - myCert.getSecretId()); - - // The certificates and issuers are no longer needed, need to delete it from the key vault. - SyncPoller deletedCertificatePoller - = certificateClient.beginDeleteCertificate(certificateName1); - // Deleted Certificate is accessible as soon as polling beings. - PollResponse pollResponse = deletedCertificatePoller.poll(); - System.out.printf("Deleted certificate with name %s and recovery id %s", pollResponse.getValue().getName(), - pollResponse.getValue().getRecoveryId()); - deletedCertificatePoller.waitForCompletion(); - - SyncPoller deletedCertPoller - = certificateClient.beginDeleteCertificate(certificateName2); - // Deleted Certificate is accessible as soon as polling beings. - PollResponse deletePollResponse = deletedCertPoller.poll(); - System.out.printf("Deleted certificate with name %s and recovery id %s", - deletePollResponse.getValue().getName(), deletePollResponse.getValue().getRecoveryId()); - deletedCertPoller.waitForCompletion(); - - CertificateIssuer deleteCertificateIssuer = certificateClient.deleteIssuer("myIssuer"); - System.out.printf("Certificate issuer is permanently deleted with name %s and provider is %s %n", - deleteCertificateIssuer.getName(), deleteCertificateIssuer.getProvider()); - - // If the keyvault is soft-delete enabled, then for permanent deletion deleted certificates need to be purged. - certificateClient.purgeDeletedCertificate(certificateName1); - certificateClient.purgeDeletedCertificate(certificateName2); - - System.out.println("\n================================================================"); - System.out.println(" Key Vault Keys Certificates Complete"); - System.out.println("================================================================"); - } - - private KeyVaultCertificatesSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/keys/KeyVaultKeysSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/keys/KeyVaultKeysSample.java deleted file mode 100644 index 7d5a8024ef81c..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/keys/KeyVaultKeysSample.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.keyvault.keys; - -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.keyvault.keys.KeyClient; -import com.azure.security.keyvault.keys.KeyClientBuilder; -import com.azure.security.keyvault.keys.models.KeyVaultKey; - -/** - * A sample to demonstrate getting a key from Azure Key Vault using GraalVM. - */ -public final class KeyVaultKeysSample { - - private static final String AZURE_KEY_VAULT_URL = System.getenv("AZURE_KEY_VAULT_URL"); - - /** - * The method to run the Key Vault Keys sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting Key Vault Keys Sample"); - System.out.println("================================================================"); - - if (AZURE_KEY_VAULT_URL == null || AZURE_KEY_VAULT_URL.isEmpty()) { - System.err.println("AZURE_KEY_VAULT_URL environment variable is not set - exiting"); - } - - KeyClient keyClient = new KeyClientBuilder().vaultUrl(AZURE_KEY_VAULT_URL) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); - - System.out.println("Getting key from Key Vault"); - KeyVaultKey key = keyClient.getKey("testkey"); - System.out.println(key.getName() + " " + key.getId()); - - System.out.println("\n================================================================"); - System.out.println(" Key Vault Keys Sample Complete"); - System.out.println("================================================================"); - } - - private KeyVaultKeysSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/secrets/KeyVaultSecretsSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/secrets/KeyVaultSecretsSample.java deleted file mode 100644 index 28b59a9bdb748..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/secrets/KeyVaultSecretsSample.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.keyvault.secrets; - -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.keyvault.secrets.SecretClient; -import com.azure.security.keyvault.secrets.SecretClientBuilder; -import com.azure.security.keyvault.secrets.models.DeletedSecret; -import com.azure.security.keyvault.secrets.models.KeyVaultSecret; -import com.azure.security.keyvault.secrets.models.SecretProperties; - -import java.time.OffsetDateTime; - -/** - * A sample to demonstrate CRUD operations for Azure Key Vault secrets using GraalVM. - */ -public final class KeyVaultSecretsSample { - private static final String AZURE_KEY_VAULT_URL = System.getenv("AZURE_KEY_VAULT_URL"); - - /** - * The method to run the Key Vault secrets sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting Key Vault Secrets Sample"); - System.out.println("================================================================"); - - if (AZURE_KEY_VAULT_URL == null || AZURE_KEY_VAULT_URL.isEmpty()) { - System.err.println("azure_key_vault_url environment variable is not set - exiting"); - return; - } - - // Instantiate a secret client that will be used to call the service. Notice that the client is using default Azure - // credentials. To make default credentials work, ensure that environment variables 'AZURE_CLIENT_ID', - // 'AZURE_CLIENT_KEY' and 'AZURE_TENANT_ID' are set with the service principal credentials. - SecretClient secretClient = new SecretClientBuilder().vaultUrl(AZURE_KEY_VAULT_URL) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); - - // Let's create a secret holding bank account credentials valid for 1 year. if the secret - // already exists in the key vault, then a new version of the secret is created. - secretClient.setSecret(new KeyVaultSecret("BankAccountPassword", "f4G34fMh8v") - .setProperties(new SecretProperties().setExpiresOn(OffsetDateTime.now().plusYears(1)))); - - // Let's Get the bank secret from the key vault. - KeyVaultSecret bankSecret = secretClient.getSecret("BankAccountPassword"); - System.out.printf("Secret is returned with name %s and value %s %n", bankSecret.getName(), - bankSecret.getValue()); - - // After one year, the bank account is still active, we need to update the expiry time of the secret. - // The update method can be used to update the expiry attribute of the secret. It cannot be used to update - // the value of the secret. - bankSecret.getProperties().setExpiresOn(OffsetDateTime.now().plusYears(1)); - SecretProperties updatedSecret = secretClient.updateSecretProperties(bankSecret.getProperties()); - System.out.printf("Secret's updated expiry time %s %n", updatedSecret.getExpiresOn()); - - // Bank forced a password update for security purposes. Let's change the value of the secret in the key vault. - // To achieve this, we need to create a new version of the secret in the key vault. The update operation cannot - // change the value of the secret. - secretClient.setSecret(new KeyVaultSecret("BankAccountPassword", "bhjd4DDgsa") - .setProperties(new SecretProperties().setExpiresOn(OffsetDateTime.now().plusYears(1)))); - - // The bank account was closed, need to delete its credentials from the key vault. - SyncPoller deletedBankSecretPoller = secretClient.beginDeleteSecret("BankAccountPassword"); - - PollResponse deletedBankSecretPollResponse = deletedBankSecretPoller.poll(); - - System.out.println("Deleted Date %s" + deletedBankSecretPollResponse.getValue().getDeletedOn().toString()); - System.out.printf("Deleted Secret's Recovery Id %s", deletedBankSecretPollResponse.getValue().getRecoveryId()); - - // Key is being deleted on server. - deletedBankSecretPoller.waitForCompletion(); - - // If the key vault is soft-delete enabled, then for permanent deletion deleted secrets need to be purged. - secretClient.purgeDeletedSecret("BankAccountPassword"); - - System.out.println("\n================================================================"); - System.out.println(" Key Vault Keys Secrets Complete"); - System.out.println("================================================================"); - } - - private KeyVaultSecretsSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/storage/blob/StorageBlobSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/storage/blob/StorageBlobSample.java deleted file mode 100644 index 970ff794bfeef..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/storage/blob/StorageBlobSample.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.storage.blob; - -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.storage.blob.BlobClient; -import com.azure.storage.blob.BlobContainerClient; -import com.azure.storage.blob.BlobServiceClient; -import com.azure.storage.blob.BlobServiceClientBuilder; - -import java.util.Random; - -/** - * A sample to demonstrate uploading a blob to Azure Blob Storage using GraalVM. - */ -public final class StorageBlobSample { - private static final String AZURE_STORAGE_CONNECTION_STRING = System.getenv("AZURE_STORAGE_CONNECTION_STRING"); - private static final Random RANDOM = new Random(); - - /** - * The method to run the storage blob sample. - */ - public static void runSample() { - - System.out.println("\n================================================================"); - System.out.println(" Starting Blob Storage Sample"); - System.out.println("================================================================"); - - final BlobServiceClientBuilder blobServiceClientBuilder = new BlobServiceClientBuilder(); - if (AZURE_STORAGE_CONNECTION_STRING != null && !AZURE_STORAGE_CONNECTION_STRING.isEmpty()) { - blobServiceClientBuilder.connectionString(AZURE_STORAGE_CONNECTION_STRING); - } else { - blobServiceClientBuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - - final BlobServiceClient blobServiceClient = blobServiceClientBuilder.buildClient(); - - final String containerName = "graal-uploads-" + RANDOM.nextInt(100); - BlobContainerClient blobContainerClient = blobServiceClient.getBlobContainerClient(containerName); - if (!blobContainerClient.exists()) { - blobContainerClient = blobServiceClient.createBlobContainer(containerName); - } - - System.out.println("Beginning upload"); - final BlobClient blobClient = blobContainerClient.getBlobClient("graalvm-test.bin"); - - byte[] bytes = new byte[1024 * 1024]; - RANDOM.nextBytes(bytes); - blobClient.upload(BinaryData.fromBytes(bytes)); - - System.out.println("Upload complete"); - - blobContainerClient.delete(); - - System.out.println("\n================================================================"); - System.out.println(" Blob Storage Sample Complete"); - System.out.println("================================================================"); - } - - private StorageBlobSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/textanalytics/TextAnalyticsSample.java b/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/textanalytics/TextAnalyticsSample.java deleted file mode 100644 index 3d0a95016d2b5..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/textanalytics/TextAnalyticsSample.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.samples.textanalytics; - -import com.azure.ai.textanalytics.TextAnalyticsClient; -import com.azure.ai.textanalytics.TextAnalyticsClientBuilder; -import com.azure.ai.textanalytics.models.DocumentSentiment; -import com.azure.ai.textanalytics.models.SentimentConfidenceScores; -import com.azure.core.credential.AzureKeyCredential; - -/** - * A GraalVM sample to demonstrate analyzing sentiment of a sentence using Azure Text Analytics. - */ -public final class TextAnalyticsSample { - private static final String AZURE_TEXT_ANALYTICS_KEY = System.getenv("AZURE_TEXT_ANALYTICS_KEY"); - private static final String AZURE_TEXT_ANALYTICS_ENDPOINT = System.getenv("AZURE_TEXT_ANALYTICS_ENDPOINT"); - - /** - * The method to run the text analytics sample. - */ - public static void runSample() { - System.out.println("\n================================================================"); - System.out.println(" Starting Text Analytics Sample"); - System.out.println("================================================================"); - - // Instantiate a client that will be used to call the service. - TextAnalyticsClient client - = new TextAnalyticsClientBuilder().credential(new AzureKeyCredential(AZURE_TEXT_ANALYTICS_KEY)) - .endpoint(AZURE_TEXT_ANALYTICS_ENDPOINT) - .buildClient(); - - // The text that needs be analyzed. - String document = "The hotel was dark and unclean. I like Microsoft."; - - final DocumentSentiment documentSentiment = client.analyzeSentiment(document); - SentimentConfidenceScores scores = documentSentiment.getConfidenceScores(); - System.out.printf( - "Recognized document sentiment: %s, positive score: %f, neutral score: %f, negative score: %f.%n", - documentSentiment.getSentiment(), scores.getPositive(), scores.getNeutral(), scores.getNegative()); - - documentSentiment.getSentences().forEach(sentenceSentiment -> { - SentimentConfidenceScores sentenceScores = sentenceSentiment.getConfidenceScores(); - System.out.printf( - "Recognized sentence sentiment: %s, positive score: %f, neutral score: %f, negative score: %f.%n", - sentenceSentiment.getSentiment(), sentenceScores.getPositive(), sentenceScores.getNeutral(), - sentenceScores.getNegative()); - }); - - System.out.println("\n================================================================"); - System.out.println(" Text Analytics Sample Complete"); - System.out.println("================================================================"); - } - - private TextAnalyticsSample() { - } -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/reflect-config.json b/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/reflect-config.json deleted file mode 100644 index 9a0ab2bb25aa6..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/reflect-config.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "name": "com.azure.aot.graalvm.samples.cosmos.Family", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.aot.graalvm.samples.cosmos.Address", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.aot.graalvm.samples.cosmos.Child", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.aot.graalvm.samples.cosmos.Parent", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.aot.graalvm.samples.cosmos.Pet", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.aot.graalvm.samples.cosmos.Families", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/resource-config.json b/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/resource-config.json deleted file mode 100644 index 5a7d962862f6c..0000000000000 --- a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/META-INF/native-image/com.azure/azure-aot-graalvm-samples/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "contoso-allinone.jpg" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/contoso-allinone.jpg b/sdk/aot/azure-aot-graalvm-samples/src/main/resources/contoso-allinone.jpg deleted file mode 100644 index 1aaad34387ecd..0000000000000 Binary files a/sdk/aot/azure-aot-graalvm-samples/src/main/resources/contoso-allinone.jpg and /dev/null differ diff --git a/sdk/aot/azure-aot-graalvm-support-netty/CHANGELOG.md b/sdk/aot/azure-aot-graalvm-support-netty/CHANGELOG.md deleted file mode 100644 index 5c86ecb5c8914..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# Release History - -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.3 (2023-04-04) - -### Other Changes -- Marked this library as deprecated. Please refer to the [blog post](https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries/) for more details on GraalVM support in Azure SDK for Java. - -#### Dependency Updates -- Updated `azure-aot-graalvm-support` version to 1.0.0-beta.3 - -## 1.0.0-beta.2 (2022-04-25) - -### Other Changes - -#### Dependency Updates -- Updated `azure-aot-graalvm-support` version to 1.0.0-beta.2 - -## 1.0.0-beta.1 (2022-04-08) - -Version 1.0.0-beta.1 is a preview of our efforts in creating a client library for Azure GraalVM Netty Support that is -developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as -possible. The principles that guide our efforts can be found in the -[Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html). - -## Features Added -- Initial release. Please see the README and wiki for information on using the new library. diff --git a/sdk/aot/azure-aot-graalvm-support-netty/README.md b/sdk/aot/azure-aot-graalvm-support-netty/README.md deleted file mode 100644 index c417bfbe90adb..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Azure GraalVM Netty Support client library for Java - -> **IMPORTANT** Please note that this package is deprecated and will no longer be updated. The necessary configuration files to support -> native image compilation using GraalVM is now directly available on respective client libraries. It is no longer required -> to add this package as a dependency to build native images with Azure SDK for Java. - Marked this library as deprecated. -> Please refer to the [blog post](https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries/) for more details on GraalVM support in Azure SDK for Java. - -The Azure GraalVM Netty Support client library provides support for applications using -[Azure client libraries](https://azure.github.io/azure-sdk/releases/latest/java.html) that take a dependency on -[azure-core-http-netty](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/core/azure-core-http-netty) to be -built as [GraalVM native images](https://www.graalvm.org/22.0/reference-manual/native-image/). The library contains all the necessary -[configuration files](https://www.graalvm.org/22.0/reference-manual/native-image/BuildConfiguration/) and [GraalVM -features](https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/hosted/Feature.html) required to build -a native image of an application that uses Azure client libraries. - -**NOTE:**: This library is a preview and is intended to enable applications using Azure client libraries to quickly -build and validate native images. However, this is not a stable, GA version and is not officially supported to use in production -environments. - -## Getting started - -### Prerequisites -- A [Java Development Kit (JDK)][jdk_link], version 8 or later. -- [Azure Subscription][azure_subscription] -- [GraalVM](https://www.graalvm.org/downloads/) version 22 or later. -- [GraalVM Native Image](https://www.graalvm.org/22.0/reference-manual/native-image/) - -### Include the package - -Include both the packages below: - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support;current}) -```xml - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - -``` -[//]: # ({x-version-update-end}) - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support-netty;current}) -```xml - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - -``` -[//]: # ({x-version-update-end}) -## Key concepts - -Please refer to the [Key Concepts](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-support#key-concepts) section of the azure-aot-graalvm-support library. - -## Examples - -Please refer to the [Examples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-support#examples) section of the -`azure-aot-graalvm-support` library. - -## Troubleshooting -Please refer to the [Troubleshooting](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-support#troubleshooting) section of the -`azure-aot-graalvm-support` library. - -## Next steps -Please refer to the [Next Steps](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-support#next-steps) section of the -`azure-aot-graalvm-support` library. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License -Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the -PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this -once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable -[azure_subscription]: https://azure.microsoft.com/free - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support-netty%2FREADME.png) diff --git a/sdk/aot/azure-aot-graalvm-support-netty/pom.xml b/sdk/aot/azure-aot-graalvm-support-netty/pom.xml deleted file mode 100644 index dda38a3c7ac3b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/pom.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - 4.0.0 - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.4 - - jar - Microsoft Azure SDK for GraalVM Netty support - - This package is deprecated will have no further updates. Dependency on this library is no longer required to build native images with Azure SDK for Java. - For more details, please refer to https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - scm:git:https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - UTF-8 - - - - - - microsoft - Microsoft - - - - - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.4 - - - io.netty - netty-handler - 4.1.115.Final - - - io.netty - netty-handler-proxy - 4.1.115.Final - - - io.netty - netty-buffer - 4.1.115.Final - - - io.netty - netty-codec-http - 4.1.115.Final - - - - io.netty - netty-codec-http2 - 4.1.115.Final - - - io.netty - netty-transport-native-unix-common - 4.1.115.Final - - - io.netty - netty-transport-native-epoll - 4.1.115.Final - linux-x86_64 - - - io.netty - netty-transport-native-kqueue - 4.1.115.Final - osx-x86_64 - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.5.0 - - - - - io.netty:netty-buffer:[4.1.115.Final] - io.netty:netty-codec-http:[4.1.115.Final] - io.netty:netty-codec-http2:[4.1.115.Final] - io.netty:netty-handler:[4.1.115.Final] - io.netty:netty-handler-proxy:[4.1.115.Final] - io.netty:netty-transport-native-unix-common:[4.1.115.Final] - io.netty:netty-transport-native-epoll:[4.1.115.Final] - io.netty:netty-transport-native-kqueue:[4.1.115.Final] - - - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.10.1 - - - attach-javadocs - - jar - - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - empty-javadoc-jar-with-readme - package - - jar - - - javadoc - ${project.basedir}/javadocTemp - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 3.1.0 - - - copy-readme-to-javadocTemp - prepare-package - - - Deleting existing ${project.basedir}/javadocTemp - - - - Copying ${project.basedir}/README.md to - ${project.basedir}/javadocTemp/README.md - - - - - - run - - - - - - - - diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/NettySubstitutions.java b/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/NettySubstitutions.java deleted file mode 100644 index e7f7555cdaa76..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/NettySubstitutions.java +++ /dev/null @@ -1,478 +0,0 @@ -/* - * Copyright (C) 2018 The Quarkus Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/* - * Portions Copyright (c) Microsoft Corporation - */ -package com.azure.aot.graalvm.support.netty.implementation.features; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.RecomputeFieldValue.Kind; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; -import com.oracle.svm.core.jdk.JDK11OrLater; -import com.oracle.svm.core.jdk.JDK8OrEarlier; -import io.netty.buffer.ByteBufAllocator; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.compression.ZlibCodecFactory; -import io.netty.handler.codec.compression.ZlibWrapper; -import io.netty.handler.ssl.ApplicationProtocolConfig; -import io.netty.handler.ssl.ApplicationProtocolConfig.SelectorFailureBehavior; -import io.netty.handler.ssl.CipherSuiteFilter; -import io.netty.handler.ssl.ClientAuth; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextOption; -import io.netty.handler.ssl.SslProvider; - -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLException; -import javax.net.ssl.TrustManagerFactory; -import java.security.PrivateKey; -import java.security.Provider; -import java.security.cert.X509Certificate; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.BooleanSupplier; - -import static io.netty.handler.codec.http.HttpHeaderValues.DEFLATE; -import static io.netty.handler.codec.http.HttpHeaderValues.GZIP; -import static io.netty.handler.codec.http.HttpHeaderValues.X_DEFLATE; -import static io.netty.handler.codec.http.HttpHeaderValues.X_GZIP; - -@TargetClass( - className = "io.netty.util.internal.logging.InternalLoggerFactory", - onlyWith = TargetIoNettyUtilInternalLoggingInternalLoggerFactory.OnlyIfInClassPath.class) -final class TargetIoNettyUtilInternalLoggingInternalLoggerFactory { - - static class OnlyIfInClassPath implements BooleanSupplier { - @Override - public boolean getAsBoolean() { - try { - Class.forName("io.netty.util.internal.logging.InternalLoggerFactory", false, - Thread.currentThread().getContextClassLoader()); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } - } -} - -//********************************************************* -// Taken from -// https://github.com/quarkusio/quarkus/blob/main/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/graal/NettySubstitutions.java -//********************************************************* - -// SSL -// This whole section is mostly about removing static analysis references to openssl/tcnative - -@TargetClass(className = "io.netty.handler.ssl.SslProvider") -final class TargetIoNettyHandlerSslSslProvider { - @Substitute - public static boolean isAlpnSupported(final SslProvider provider) { - switch (provider) { - case JDK: - return TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiator.isAlpnSupported(); - - case OPENSSL: - case OPENSSL_REFCNT: - return false; - - default: - throw new RuntimeException("SslProvider unsupported " + provider); - } - } -} - -@TargetClass( - className = "io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator", - onlyWith = TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiator.OnlyIfInClassPath.class) -final class TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiator { - @Alias - static boolean isAlpnSupported() { - return true; - } - - static class OnlyIfInClassPath implements BooleanSupplier { - @Override - public boolean getAsBoolean() { - try { - Class.forName("io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator", false, - Thread.currentThread().getContextClassLoader()); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } - } -} - -/** - * Hardcode io.netty.handler.ssl.OpenSsl as non-available - */ -@TargetClass(className = "io.netty.handler.ssl.OpenSsl") -final class TargetIoNettyHandlerSslOpenSsl { - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - private static Throwable UNAVAILABILITY_CAUSE = new RuntimeException("OpenSsl unsupported"); - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - static List DEFAULT_CIPHERS = Collections.emptyList(); - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - static Set AVAILABLE_CIPHER_SUITES = Collections.emptySet(); - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - private static Set AVAILABLE_OPENSSL_CIPHER_SUITES = Collections.emptySet(); - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - private static Set AVAILABLE_JAVA_CIPHER_SUITES = Collections.emptySet(); - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - private static boolean SUPPORTS_KEYMANAGER_FACTORY = false; - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - private static boolean SUPPORTS_OCSP = false; - - @Alias - @RecomputeFieldValue(kind = Kind.FromAlias) - static Set SUPPORTED_PROTOCOLS_SET = Collections.emptySet(); - - @Substitute - public static boolean isAvailable() { - return false; - } - - @Substitute - public static int version() { - return -1; - } - - @Substitute - public static String versionString() { - return null; - } - - @Substitute - public static boolean isCipherSuiteAvailable(String cipherSuite) { - return false; - } -} - -@TargetClass(className = "io.netty.handler.ssl.JdkSslServerContext") -final class TargetIoNettyHandlerSslJdkSslServerContext { - - @Alias - TargetIoNettyHandlerSslJdkSslServerContext(Provider provider, X509Certificate[] trustCertCollection, - TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, - KeyManagerFactory keyManagerFactory, Iterable ciphers, CipherSuiteFilter cipherFilter, - ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout, ClientAuth clientAuth, - String[] protocols, boolean startTls, String keyStore) throws SSLException { - } -} - -@TargetClass(className = "io.netty.handler.ssl.JdkSslClientContext") -final class TargetIoNettyHandlerSslJdkSslClientContext { - - @Alias - TargetIoNettyHandlerSslJdkSslClientContext(Provider sslContextProvider, X509Certificate[] trustCertCollection, - TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, - KeyManagerFactory keyManagerFactory, Iterable ciphers, CipherSuiteFilter cipherFilter, - ApplicationProtocolConfig apn, String[] protocols, long sessionCacheSize, long sessionTimeout, - String keyStoreType) throws SSLException { - } -} - -@TargetClass(className = "io.netty.handler.ssl.SslHandler$SslEngineType") -final class TargetIoNettyHandlerSslSslHandler$SslEngineType { - - @Alias - public static TargetIoNettyHandlerSslSslHandler$SslEngineType JDK; - - @Substitute - static TargetIoNettyHandlerSslSslHandler$SslEngineType forEngine(SSLEngine engine) { - return JDK; - } -} - -@TargetClass( - className = "io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$AlpnWrapper", - onlyWith = JDK11OrLater.class) -@SuppressWarnings("deprecation") -final class TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapper { - @Substitute - public SSLEngine wrapSslEngine(SSLEngine engine, ByteBufAllocator alloc, - io.netty.handler.ssl.JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer) { - return (SSLEngine) (Object) new TargetIoNettyHandlerSslJdkAlpnSslEngine(engine, applicationNegotiator, - isServer); - } - -} - -@TargetClass( - className = "io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$AlpnWrapper", - onlyWith = JDK8OrEarlier.class) -@SuppressWarnings("deprecation") -final class TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapperJava8 { - @Substitute - public SSLEngine wrapSslEngine(SSLEngine engine, ByteBufAllocator alloc, - io.netty.handler.ssl.JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer) { - if (TargetIoNettyHandlerSslJettyAlpnSslEngine.isAvailable()) { - return isServer - ? (SSLEngine) (Object) TargetIoNettyHandlerSslJettyAlpnSslEngine.newServerEngine(engine, - applicationNegotiator) - : (SSLEngine) (Object) TargetIoNettyHandlerSslJettyAlpnSslEngine.newClientEngine(engine, - applicationNegotiator); - } - throw new RuntimeException("Unable to wrap SSLEngine of type " + engine.getClass().getName()); - } - -} - -@TargetClass(className = "io.netty.handler.ssl.JettyAlpnSslEngine", onlyWith = JDK8OrEarlier.class) -@SuppressWarnings("deprecation") -final class TargetIoNettyHandlerSslJettyAlpnSslEngine { - @Substitute - static boolean isAvailable() { - return false; - } - - @Substitute - static TargetIoNettyHandlerSslJettyAlpnSslEngine newClientEngine(SSLEngine engine, - io.netty.handler.ssl.JdkApplicationProtocolNegotiator applicationNegotiator) { - return null; - } - - @Substitute - static TargetIoNettyHandlerSslJettyAlpnSslEngine newServerEngine(SSLEngine engine, - io.netty.handler.ssl.JdkApplicationProtocolNegotiator applicationNegotiator) { - return null; - } -} - -@TargetClass(className = "io.netty.handler.ssl.JdkAlpnSslEngine", onlyWith = JDK11OrLater.class) -@SuppressWarnings("deprecation") -final class TargetIoNettyHandlerSslJdkAlpnSslEngine { - @Alias - TargetIoNettyHandlerSslJdkAlpnSslEngine(final SSLEngine engine, - final io.netty.handler.ssl.JdkApplicationProtocolNegotiator applicationNegotiator, final boolean isServer) { - - } -} - -@TargetClass(className = "io.netty.handler.ssl.SslContext") -final class TargetIoNettyHandlerSslSslContext { - - @Substitute - @SafeVarargs - @SuppressWarnings("varargs") - static SslContext newServerContextInternal(SslProvider provider, Provider sslContextProvider, - X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, - PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable ciphers, - CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout, - ClientAuth clientAuth, String[] protocols, boolean startTls, boolean enableOcsp, String keyStoreType, - Map.Entry, Object>... ctxOptions) throws SSLException { - if (enableOcsp) { - throw new IllegalArgumentException("OCSP is not supported with this SslProvider: " + provider); - } - return (SslContext) (Object) new TargetIoNettyHandlerSslJdkSslServerContext(sslContextProvider, - trustCertCollection, trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory, ciphers, - cipherFilter, apn, sessionCacheSize, sessionTimeout, clientAuth, protocols, startTls, keyStoreType); - } - - @Substitute - @SafeVarargs - @SuppressWarnings("varargs") - static SslContext newClientContextInternal(SslProvider provider, Provider sslContextProvider, - X509Certificate[] trustCert, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, - PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable ciphers, - CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols, long sessionCacheSize, - long sessionTimeout, boolean enableOcsp, String keyStoreType, Map.Entry, Object>... options) - throws SSLException { - if (enableOcsp) { - throw new IllegalArgumentException("OCSP is not supported with this SslProvider: " + provider); - } - return (SslContext) (Object) new TargetIoNettyHandlerSslJdkSslClientContext(sslContextProvider, trustCert, - trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory, ciphers, cipherFilter, apn, - protocols, sessionCacheSize, sessionTimeout, keyStoreType); - } - -} - -@TargetClass(className = "io.netty.handler.ssl.JdkDefaultApplicationProtocolNegotiator") -final class TargetIoNettyHandlerSslJdkDefaultApplicationProtocolNegotiator { - - @Alias - public static TargetIoNettyHandlerSslJdkDefaultApplicationProtocolNegotiator INSTANCE; -} - -@TargetClass(className = "io.netty.handler.ssl.JdkSslContext") -@SuppressWarnings("deprecation") -final class TargetIoNettyHandlerSslJdkSslContext { - - @Substitute - static io.netty.handler.ssl.JdkApplicationProtocolNegotiator toNegotiator(ApplicationProtocolConfig config, - boolean isServer) { - if (config == null) { - return (io.netty.handler.ssl.JdkApplicationProtocolNegotiator) (Object) TargetIoNettyHandlerSslJdkDefaultApplicationProtocolNegotiator.INSTANCE; - } - - switch (config.protocol()) { - case NONE: - return (io.netty.handler.ssl.JdkApplicationProtocolNegotiator) (Object) TargetIoNettyHandlerSslJdkDefaultApplicationProtocolNegotiator.INSTANCE; - - case ALPN: - if (isServer) { - SelectorFailureBehavior behavior = config.selectorFailureBehavior(); - if (behavior == SelectorFailureBehavior.FATAL_ALERT) { - return new io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator(true, - config.supportedProtocols()); - } else if (behavior == SelectorFailureBehavior.NO_ADVERTISE) { - return new io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator(false, - config.supportedProtocols()); - } else { - throw new UnsupportedOperationException( - new StringBuilder("JDK provider does not support ").append(config.selectorFailureBehavior()) - .append(" failure behavior") - .toString()); - } - } else { - switch (config.selectedListenerFailureBehavior()) { - case ACCEPT: - return new io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator(false, - config.supportedProtocols()); - - case FATAL_ALERT: - return new io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator(true, - config.supportedProtocols()); - - default: - throw new UnsupportedOperationException(new StringBuilder("JDK provider does not support ") - .append(config.selectedListenerFailureBehavior()) - .append(" failure behavior") - .toString()); - } - } - default: - throw new UnsupportedOperationException( - new StringBuilder("JDK provider does not support ").append(config.protocol()) - .append(" protocol") - .toString()); - } - } - -} - -@TargetClass(className = "io.netty.buffer.AbstractReferenceCountedByteBuf") -final class TargetIoNettyBufferAbstractReferenceCountedByteBuf { - - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FieldOffset, name = "refCnt") - private static long REFCNT_FIELD_OFFSET; -} - -@TargetClass(className = "io.netty.util.AbstractReferenceCounted") -final class TargetIoNettyUtilAbstractReferenceCounted { - - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FieldOffset, name = "refCnt") - private static long REFCNT_FIELD_OFFSET; -} - -// This class is runtime-initialized by NettyProcessor -final class HolderIoNettyUtilConcurrentScheduledFutureTask { - static long START_TIME = System.nanoTime(); -} - -@TargetClass(className = "io.netty.util.concurrent.ScheduledFutureTask") -final class TargetIoNettyUtilConcurrentScheduledFutureTask { - - // The START_TIME field is kept but not used. - // All the accesses to it have been replaced with Holder_io_netty_util_concurrent_ScheduledFutureTask - - @Substitute - static long initialNanoTime() { - return HolderIoNettyUtilConcurrentScheduledFutureTask.START_TIME; - } - - @Substitute - static long nanoTime() { - return System.nanoTime() - HolderIoNettyUtilConcurrentScheduledFutureTask.START_TIME; - } - - @Alias - public long deadlineNanos() { - return 0; - } - - @Substitute - public long delayNanos(long currentTimeNanos) { - return Math.max(0, - deadlineNanos() - (currentTimeNanos - HolderIoNettyUtilConcurrentScheduledFutureTask.START_TIME)); - } -} - -@TargetClass(className = "io.netty.util.internal.NativeLibraryLoader") -final class TargetIoNettyUtilInternalNativeLibraryLoader { - - // This method can trick GraalVM into thinking that Classloader#defineClass is getting called - @Substitute - static Class tryToLoadClass(final ClassLoader loader, final Class helper) throws ClassNotFoundException { - return Class.forName(helper.getName(), false, loader); - } - -} - -@TargetClass(className = "io.netty.handler.codec.http.HttpContentDecompressor") -final class TargetIoNettyHandlerCodecHttpHttpContentDecompressor { - - @Alias - private boolean strict; - - @Alias - protected ChannelHandlerContext ctx; - - @Substitute - protected EmbeddedChannel newContentDecoder(String contentEncoding) throws Exception { - if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) { - return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(), - ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP)); - } - - if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) || X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) { - final ZlibWrapper wrapper = strict ? ZlibWrapper.ZLIB : ZlibWrapper.ZLIB_OR_NONE; - // To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly. - return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(), - ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper)); - } - - // 'identity' or unsupported - return null; - } -} - -public class NettySubstitutions { -} diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/package-info.java b/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/package-info.java deleted file mode 100644 index f2ce12d8dcb8b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/com/azure/aot/graalvm/support/netty/implementation/features/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * GraalVM Netty-specific configuration. - */ -package com.azure.aot.graalvm.support.netty.implementation.features; diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/module-info.java b/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/module-info.java deleted file mode 100644 index fafb28f904c9b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/java/module-info.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.aot.graalvm.support.netty { - requires com.azure.aot.graalvm.support; - requires io.netty.buffer; - requires io.netty.codec; - requires io.netty.codec.http; - requires io.netty.common; - requires io.netty.handler; - requires io.netty.transport; -} diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/jni-config.json b/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/jni-config.json deleted file mode 100644 index 115aedaa6ef77..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/jni-config.json +++ /dev/null @@ -1,968 +0,0 @@ -[ - { - "name": "io.netty.channel.ChannelException" - }, - { - "name": "io.netty.channel.unix.Buffer" - }, - { - "name": "io.netty.channel.unix.DatagramSocketAddress", - "methods": [ - { - "name": "", - "parameterTypes": [ - "byte[]", - "int", - "int", - "int", - "io.netty.channel.unix.DatagramSocketAddress" - ] - } - ] - }, - { - "name": "io.netty.channel.unix.ErrorsStaticallyReferencedJniMethods" - }, - { - "name": "io.netty.channel.unix.FileDescriptor" - }, - { - "name": "io.netty.channel.unix.LimitsStaticallyReferencedJniMethods" - }, - { - "name": "io.netty.channel.unix.Socket" - }, - { - "name": "io.netty.handler.ssl.ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback" - }, - { - "name": "io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier", - "methods": [ - { - "name": "verify", - "parameterTypes": [ - "long", - "byte[][]", - "java.lang.String" - ] - } - ] - }, - { - "name": "io.netty.resolver.dns.macos.DnsResolver[]" - }, - { - "name": "io.netty.internal.tcnative.Library" - }, - { - "name": "io.netty.internal.tcnative.Buffer", - "methods": [ - { - "name": "size", - "parameterTypes": [ - "java.nio.ByteBuffer" - ] - } - ] - }, - { - "name": "io.netty.internal.tcnative.NativeStaticallyReferencedJniMethods" - }, - { - "name": "io.netty.internal.tcnative.SSL", - "methods": [ - { - "name": "version", - "parameterTypes": [] - }, - { - "name": "versionString", - "parameterTypes": [] - }, - { - "name": "initialize", - "parameterTypes": [ - "java.lang.String" - ] - }, - { - "name": "getLastError", - "parameterTypes": [] - }, - { - "name": "newSSL", - "parameterTypes": [ - "long", - "boolean" - ] - }, - { - "name": "getError", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "bioSetByteBuffer", - "parameterTypes": [ - "long", - "long", - "int", - "boolean" - ] - }, - { - "name": "bioClearByteBuffer", - "parameterTypes": [ - "long" - ] - }, - { - "name": "bioFlushByteBuffer", - "parameterTypes": [ - "long" - ] - }, - { - "name": "bioLengthByteBuffer", - "parameterTypes": [ - "long" - ] - }, - { - "name": "bioLengthNonApplication", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sslPending", - "parameterTypes": [ - "long" - ] - }, - { - "name": "writeToSSL", - "parameterTypes": [ - "long", - "long", - "int" - ] - }, - { - "name": "readFromSSL", - "parameterTypes": [ - "long", - "long", - "int" - ] - }, - { - "name": "getShutdown", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setShutdown", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "freeSSL", - "parameterTypes": [ - "long" - ] - }, - { - "name": "freeBIO", - "parameterTypes": [ - "long" - ] - }, - { - "name": "shutdownSSL", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getLastErrorNumber", - "parameterTypes": [] - }, - { - "name": "getCipherForSSL", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getVersion", - "parameterTypes": [ - "long" - ] - }, - { - "name": "doHandshake", - "parameterTypes": [ - "long" - ] - }, - { - "name": "isInInit", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getNextProtoNegotiated", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getAlpnSelected", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getPeerCertChain", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getPeerCertificate", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getErrorString", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getTime", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getTimeout", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setTimeout", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "setVerify", - "parameterTypes": [ - "long", - "int", - "int" - ] - }, - { - "name": "setOptions", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "clearOptions", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "getOptions", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setMode", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "getMode", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getMaxWrapOverhead", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getCiphers", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setCipherSuites", - "parameterTypes": [ - "long", - "java.lang.String" - ] - }, - { - "name": "setCipherSuites", - "parameterTypes": [ - "long", - "java.lang.String", - "boolean" - ] - }, - { - "name": "getSessionId", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getHandshakeCount", - "parameterTypes": [ - "long" - ] - }, - { - "name": "clearError", - "parameterTypes": [] - }, - { - "name": "setTlsExtHostName", - "parameterTypes": [ - "long", - "java.lang.String" - ] - }, - { - "name": "setHostNameValidation", - "parameterTypes": [ - "long", - "int", - "java.lang.String" - ] - }, - { - "name": "authenticationMethods", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setCertificateChainBio", - "parameterTypes": [ - "long", - "long", - "boolean" - ] - }, - { - "name": "setCertificateBio", - "parameterTypes": [ - "long", - "long", - "long", - "java.lang.String" - ] - }, - { - "name": "loadPrivateKeyFromEngine", - "parameterTypes": [ - "java.lang.String", - "java.lang.String" - ] - }, - { - "name": "parsePrivateKey", - "parameterTypes": [ - "long", - "java.lang.String" - ] - }, - { - "name": "freePrivateKey", - "parameterTypes": [ - "long" - ] - }, - { - "name": "parseX509Chain", - "parameterTypes": [ - "long" - ] - }, - { - "name": "freeX509Chain", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setKeyMaterialServerSide", - "parameterTypes": [ - "long", - "long", - "long" - ] - }, - { - "name": "setKeyMaterial", - "parameterTypes": [ - "long", - "long", - "long" - ] - }, - { - "name": "setKeyMaterialClientSide", - "parameterTypes": [ - "long", - "long", - "long", - "long", - "long" - ] - }, - { - "name": "setSession", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "setOcspResponse", - "parameterTypes": [ - "long", - "byte[]" - ] - }, - { - "name": "getOcspResponse", - "parameterTypes": [ - "long" - ] - }, - { - "name": "fipsModeSet", - "parameterTypes": [ - "int" - ] - }, - { - "name": "getSniHostname", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getSigAlgs", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getMasterKey", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getServerRandom", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getClientRandom", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getTask", - "parameterTypes": [ - "long" - ] - }, - { - "name": "isSessionReused", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setSession", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "getSession", - "parameterTypes": [ - "long" - ] - } - ] - }, - { - "name": "io.netty.internal.tcnative.SSLContext", - "methods": [ - { - "name": "make", - "parameterTypes": [ - "int", - "int" - ] - }, - { - "name": "free", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setContextId", - "parameterTypes": [ - "long", - "java.lang.String" - ] - }, - { - "name": "setOptions", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "getOptions", - "parameterTypes": [ - "long" - ] - }, - { - "name": "clearOptions", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "setCipherSuite", - "parameterTypes": [ - "long", - "java.lang.String" - ] - }, - { - "name": "setCipherSuite", - "parameterTypes": [ - "long", - "java.lang.String", - "boolean" - ] - }, - { - "name": "setCertificateChainFile", - "parameterTypes": [ - "long", - "java.lang.String", - "boolean" - ] - }, - { - "name": "setCertificateChainBio", - "parameterTypes": [ - "long", - "long", - "boolean" - ] - }, - { - "name": "setCertificate", - "parameterTypes": [ - "long", - "java.lang.String", - "java.lang.String", - "java.lang.String" - ] - }, - { - "name": "setCertificateBio", - "parameterTypes": [ - "long", - "long", - "long", - "java.lang.String" - ] - }, - { - "name": "setSessionCacheSize", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "getSessionCacheSize", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setSessionCacheTimeout", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "getSessionCacheTimeout", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setSessionCacheMode", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "getSessionCacheMode", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionAccept", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionAcceptGood", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionAcceptRenegotiate", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionCacheFull", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionCbHits", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionConnect", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionConnectGood", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionConnectRenegotiate", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionHits", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionMisses", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionNumber", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionTimeouts", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionTicketKeyNew", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionTicketKeyResume", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionTicketKeyRenew", - "parameterTypes": [ - "long" - ] - }, - { - "name": "sessionTicketKeyFail", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setCACertificateBio", - "parameterTypes": [ - "long", - "long" - ] - }, - { - "name": "setVerify", - "parameterTypes": [ - "long", - "int", - "int" - ] - }, - { - "name": "setCertVerifyCallback", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.CertificateVerifier" - ] - }, - { - "name": "setCertRequestedCallback", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.CertificateRequestedCallback" - ] - }, - { - "name": "setCertificateCallback", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.CertificateCallback" - ] - }, - { - "name": "setSniHostnameMatcher", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.SniHostNameMatcher" - ] - }, - { - "name": "setNpnProtos", - "parameterTypes": [ - "long", - "java.lang.String[]", - "int" - ] - }, - { - "name": "setAlpnProtos", - "parameterTypes": [ - "long", - "java.lang.String[]", - "int" - ] - }, - { - "name": "setTmpDHLength", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "setSessionIdContext", - "parameterTypes": [ - "long", - "byte[]" - ] - }, - { - "name": "setMode", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "getMode", - "parameterTypes": [ - "long" - ] - }, - { - "name": "enableOcsp", - "parameterTypes": [ - "long", - "boolean" - ] - }, - { - "name": "disableOcsp", - "parameterTypes": [ - "long" - ] - }, - { - "name": "getSslCtx", - "parameterTypes": [ - "long" - ] - }, - { - "name": "setUseTasks", - "parameterTypes": [ - "long", - "boolean" - ] - }, - { - "name": "setPrivateKeyMethod", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.SSLPrivateKeyMethod" - ] - }, - { - "name": "setSSLSessionCache", - "parameterTypes": [ - "long", - "io.netty.internal.tcnative.SSLSessionCache" - ] - }, - { - "name": "setNumTickets", - "parameterTypes": [ - "long", - "int" - ] - }, - { - "name": "setSessionTicketKeys0", - "parameterTypes": [ - "long", - "byte[]" - ] - } - ] - }, - { - "name": "io.netty.channel.kqueue.KQueueStaticallyReferencedJniMethods" - }, - { - "name": "io.netty.channel.kqueue.Native" - }, - { - "name": "io.netty.channel.kqueue.BsdSocket", - "methods": [ - { - "name": "sendFile", - "parameterTypes": [ - "int", - "io.netty.channel.DefaultFileRegion", - "long", - "long", - "long" - ] - }, - { - "name": "getAcceptFilter", - "parameterTypes": [ - "int" - ] - }, - { - "name": "getTcpNoPush", - "parameterTypes": [ - "int" - ] - }, - { - "name": "getSndLowAt", - "parameterTypes": [ - "int" - ] - }, - { - "name": "getPeerCredentials", - "parameterTypes": [ - "int" - ] - }, - { - "name": "setAcceptFilter", - "parameterTypes": [ - "int", - "java.lang.String", - "java.lang.String" - ] - }, - { - "name": "setTcpNoPush", - "parameterTypes": [ - "int", - "int" - ] - }, - { - "name": "setSndLowAt", - "parameterTypes": [ - "int", - "int" - ] - } - ] - } -] diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/native-image.properties b/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/native-image.properties deleted file mode 100644 index a45294b369f3f..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/native-image.properties +++ /dev/null @@ -1,45 +0,0 @@ -Args=\ - --enable-url-protocols=http,https \ - --initialize-at-run-time=io.netty.buffer.AbstractReferenceCountedByteBuf,\ - io.netty.buffer.PooledByteBufAllocator,\ - io.netty.buffer.UnpooledDirectByteBuf,\ - io.netty.buffer.UnpooledHeapByteBuf,\ - io.netty.buffer.UnpooledUnsafeDirectByteBuf,\ - io.netty.channel.epoll.Epoll,\ - io.netty.channel.epoll.EpollEventArray,\ - io.netty.channel.epoll.EpollEventLoop,\ - io.netty.channel.epoll.LinuxSocket,\ - io.netty.channel.epoll.Native,\ - io.netty.channel.kqueue.KQueue,\ - io.netty.channel.kqueue.KQueueEventArray,\ - io.netty.channel.kqueue.KQueueEventLoop,\ - io.netty.channel.kqueue.Native,\ - io.netty.channel.unix.Errors,\ - io.netty.channel.unix.IovArray,\ - io.netty.channel.unix.Limits,\ - io.netty.channel.unix.Socket,\ - io.netty.handler.codec.compression.BrotliDecoder,\ - io.netty.handler.codec.compression.BrotliDecoder$1,\ - io.netty.handler.codec.http.HttpObjectEncoder,\ - io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder,\ - io.netty.handler.ssl.BouncyCastleAlpnSslUtils,\ - io.netty.handler.ssl.ConscryptAlpnSslEngine,\ - io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator,\ - io.netty.handler.ssl.JettyAlpnSslEngine$ClientEngine,\ - io.netty.handler.ssl.JettyAlpnSslEngine$ServerEngine,\ - io.netty.handler.ssl.JettyNpnSslEngine,\ - io.netty.handler.ssl.OpenSsl,\ - io.netty.handler.ssl.OpenSslPrivateKeyMethod,\ - io.netty.handler.ssl.ReferenceCountedOpenSslEngine,\ - io.netty.handler.ssl.ReferenceCountedOpenSslServerContext,\ - io.netty.handler.ssl.ReferenceCountedOpenSslClientContext,\ - io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator,\ - io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator,\ - io.netty.handler.ssl.util.ThreadLocalInsecureRandom,\ - io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod,\ - io.netty.internal.tcnative.CertificateVerifier,\ - io.netty.internal.tcnative.SSL,\ - io.netty.internal.tcnative.SSLPrivateKeyMethod,\ - io.netty.util.AbstractReferenceCounted,\ - io.netty.util.internal.logging.Log4JLogger - diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/reflect-config.json b/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/reflect-config.json deleted file mode 100644 index 9cfd276e55ce4..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/META-INF/native-image/com.azure/azure-core-http-netty/reflect-config.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "name": "io.netty.channel.socket.nio.NioSocketChannel", - "methods": [ - { - "name": "" - } - ] - } -] diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/azure-aot-graalvm-support-netty.properties b/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/azure-aot-graalvm-support-netty.properties deleted file mode 100644 index ca812989b4f27..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/main/resources/azure-aot-graalvm-support-netty.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/sdk/aot/azure-aot-graalvm-support-netty/src/samples/README.md b/sdk/aot/azure-aot-graalvm-support-netty/src/samples/README.md deleted file mode 100644 index 898a7879184bd..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support-netty/src/samples/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Azure GraalVM Netty Support client library for Java - -## Getting started -Getting started explained in detail [here][SDK_README_GETTING_STARTED]. - -## Key concepts -Key concepts are explained in detail [here][SDK_README_KEY_CONCEPTS]. - -## Examples -The following sections provide several code snippets covering some of the most common scenarios, including: - -## Troubleshooting -Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. - -## Next steps -See [Next steps][SDK_README_NEXT_STEPS]. - -## Contributing -This project welcomes contributions and suggestions. Find [more contributing][SDK_README_CONTRIBUTING] details here. - - -[SDK_README_CONTRIBUTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md#contributing -[SDK_README_GETTING_STARTED]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md#getting-started -[SDK_README_TROUBLESHOOTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md#troubleshooting -[SDK_README_KEY_CONCEPTS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md#key-concepts -[SDK_README_NEXT_STEPS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md#next-steps - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support-netty%2FREADME.png) diff --git a/sdk/aot/azure-aot-graalvm-support/CHANGELOG.md b/sdk/aot/azure-aot-graalvm-support/CHANGELOG.md deleted file mode 100644 index 5fbcba058d86d..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Release History - -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.3 (2023-04-04) - -### Other Changes -- Marked this library as deprecated. Please refer to the [blog post](https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries/) for more details on GraalVM support in Azure SDK for Java. -- Changed the proxy interface package names to match the 1.28.0 version of `azure-core` - -## 1.0.0-beta.2 (2022-04-25) - -### Features Added -- Added support for Storage File Share and Storage Queues - -## 1.0.0-beta.1 (2022-04-08) -Version 1.0.0-beta.1 is a preview of our efforts in creating a client library for Azure GraalVM Support that is -developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as -possible. The principles that guide our efforts can be found in the -[Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html). - -## Features Added -- Initial release. Please see the README and wiki for information on using the new library. diff --git a/sdk/aot/azure-aot-graalvm-support/README.md b/sdk/aot/azure-aot-graalvm-support/README.md deleted file mode 100644 index 91eb314f09e88..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# Azure GraalVM Support client library for Java - -> **IMPORTANT** Please note that this package is deprecated and will no longer be updated. The necessary configuration files to support -> native image compilation using GraalVM is now directly available on respective client libraries. It is no longer required -> to add this package as a dependency to build native images with Azure SDK for Java. -> Please refer to the [blog post](https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries/) for more details on GraalVM support in Azure SDK for Java. - -The Azure GraalVM Support client library provides support for applications using [Azure client libraries](https://azure.github.io/azure-sdk/releases/latest/java.html) to be built as [GraalVM native -images](https://www.graalvm.org/22.0/reference-manual/native-image/). The library contains all the necessary -[configuration files](https://www.graalvm.org/22.0/reference-manual/native-image/BuildConfiguration/) and [GraalVM -features](https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/hosted/Feature.html) required to build -a native image of an application that uses Azure client libraries. - -**NOTE:**: This library is a preview and is intended to enable applications using Azure client libraries to quickly -build and validate native images. However, this is not a stable, GA version and is not officially supported to use in production -environments. - -## Getting started - -### Prerequisites -- A [Java Development Kit (JDK)][jdk_link], version 8 or later. -- [Azure Subscription][azure_subscription] -- [GraalVM](https://www.graalvm.org/downloads/) version 22 or later. -- [GraalVM Native Image](https://www.graalvm.org/22.0/reference-manual/native-image/) - -For more details, please refer to [Getting started with GraalVM](https://www.graalvm.org/22.0/docs/getting-started/) -documentation. - -### Include the package - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support;current}) -```xml - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - -``` -[//]: # ({x-version-update-end}) - -Also, include the `azure-aot-graalvm-support-netty` package to bring in the configuration files required for Netty HTTP -client. For more details on this library, please refer to [this README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md). - -[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support-netty;current}) -```xml - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - -``` -[//]: # ({x-version-update-end}) - -## Key concepts - -### Native Image creation - -Native Image is a technology to compile your Java application ahead of time into a native image which can run as a -standalone application. The native image created through this ahead-of-time compilation will include all the -necessary classes from the application, it's dependencies and any other natively linked JDK code. For more details -on creating the native image please refer to [building a native image](https://www.graalvm.org/22.0/reference-manual/native-image/#build-a-native-image) documentation. - -### GraalVM configuration files - -GraalVM is a high-performance runtime that creates native images by compiling the Java code ahead of time. Due to -this ahead-of-time compilation into a native image, the native image creation requires statically analyzing all -classes of the application and their dependencies to determine which classes and methods are reachable during the -application execution. However, there are scenarios where Java allows looking up classes, methods and fields at -runtime through reflection. While GraalVM does a best-effort discovery of all classes ahead of time, it will not be -able to detect all classes that are reflectively accessed. So, developers can provide configuration files that -contain details of all necessary classes that are reflectively accessed. This supplementary information is then used -to create the native image and make these classes available at runtime. - -This library provides all the necessary configuration files for using Azure client libraries. - -## Examples - -#### App Configuration -- [Sample demonstrating the creation and use of App Configuration client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/appconfiguration/AppConfigurationSample.java) - -Please refer to [Application Configuration](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-data-appconfiguration) client library documentation for more details. - -#### Key Vault -- [Sample demonstrating the creation and use of Key Vault Certificates client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/certificates/KeyVaultCertificatesSample.java) -- [Sample demonstrating the creation and use of Key Vault Keys client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/keys/KeyVaultKeysSample.java) -- [Sample demonstrating the creation and use of Key Vault Secrets client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/secrets/KeyVaultSecretsSample.java) - -Please refer to [Key Vault](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/keyvault) client library documentation for more details. - -#### Storage Blob -- [Sample demonstrating the creation and use of Storage Blob client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/storage/blob/StorageBlobSample.java) - -Please refer to [Storage Blob](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-blob) client library documentation for more details. - -#### Event Hubs -- [Sample demonstrating the creation and use of Event Hubs producer client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/eventhubs/EventHubsSample.java) - -Please refer to [Event Hubs](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/eventhubs/azure-messaging-eventhubs) client library documentation for more details. - -#### Form Recognizer -- [Sample demonstrating the creation and use of Form Recognizer client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/formrecognizer/FormRecognizerSample.java) - -Please refer to [Form Recognizer](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/formrecognizer/azure-ai-formrecognizer) client library documentation for more details. - -#### Text Analytics -- [Sample demonstrating the creation and use of Text Analytics client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/textanalytics/TextAnalyticsSample.java) - -Please refer to [Text Analytics](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/textanalytics/azure-ai-textanalytics) client library documentation for more details. - -## Troubleshooting - -## Next steps -The [azure-aot-graalvm-samples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-samples) -library consists of all above samples bundled into a single Maven project that can be compiled with `mvn clean -install -Pnative` to build the native image and execute all the samples. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License -Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the -PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this -once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable -[azure_subscription]: https://azure.microsoft.com/free - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support%2FREADME.png) diff --git a/sdk/aot/azure-aot-graalvm-support/pom.xml b/sdk/aot/azure-aot-graalvm-support/pom.xml deleted file mode 100644 index 84a238bb80308..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/pom.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - 4.0.0 - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.4 - - jar - Microsoft Azure GraalVM support - - This package is deprecated will have no further updates. Dependency on this library is no longer required to build native images with Azure SDK for Java. - For more details, please refer to https://devblogs.microsoft.com/azure-sdk/announcing-graalvm-support-in-azure-sdk-for-java-and-spring-cloud-azure-libraries - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - scm:git:https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - UTF-8 - - - - - - microsoft - Microsoft - - - - - - org.graalvm.sdk - graal-sdk - 22.0.0.2 - - - org.graalvm.nativeimage - svm - 22.0.0.2 - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.5.0 - - - - - org.graalvm.sdk:graal-sdk:[22.0.0.2] - org.graalvm.nativeimage:svm:[22.0.0.2] - - - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.10.1 - - - attach-javadocs - - jar - - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - empty-javadoc-jar-with-readme - package - - jar - - - javadoc - ${project.basedir}/javadocTemp - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 3.1.0 - - - copy-readme-to-javadocTemp - prepare-package - - - Deleting existing ${project.basedir}/javadocTemp - - - - Copying ${project.basedir}/README.md to - ${project.basedir}/javadocTemp/README.md - - - - - - run - - - - - - - - diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/ClassReflectionAttributes.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/ClassReflectionAttributes.java deleted file mode 100644 index 0d65eaf0581e2..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/ClassReflectionAttributes.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.support.implementation; - -import java.util.EnumSet; -import java.util.Objects; - -/** - * Represents the attributes of a given class that should be made available reflectively as part of a GraalVM native - * image compilation. - */ -public final class ClassReflectionAttributes { - private final String name; - private final EnumSet set; - - public enum ReflectionAttributes { - DECLARED_FIELDS, - PUBLIC_FIELDS, - DECLARED_CONSTRUCTORS, - PUBLIC_CONSTRUCTORS, - DECLARED_METHODS, - PUBLIC_METHODS, - DECLARED_CLASSES, - PUBLIC_CLASSES - } - - private ClassReflectionAttributes(String name, EnumSet set) { - this.name = Objects.requireNonNull(name); - this.set = set; - } - - public static ClassReflectionAttributes createWithAll(String name) { - return create(name, EnumSet.allOf(ReflectionAttributes.class)); - } - - public static ClassReflectionAttributes create(String name, EnumSet attributes) { - return new ClassReflectionAttributes(name, attributes); - } - - public static ClassReflectionAttributes createWithAllDeclared(String name) { - return new ClassReflectionAttributes(name, - EnumSet.of(ReflectionAttributes.DECLARED_CLASSES, ReflectionAttributes.DECLARED_FIELDS, - ReflectionAttributes.DECLARED_CONSTRUCTORS, ReflectionAttributes.DECLARED_METHODS)); - } - - public static ClassReflectionAttributes createWithAllPublic(String name) { - return new ClassReflectionAttributes(name, - EnumSet.of(ReflectionAttributes.PUBLIC_CLASSES, ReflectionAttributes.PUBLIC_FIELDS, - ReflectionAttributes.PUBLIC_CONSTRUCTORS, ReflectionAttributes.PUBLIC_METHODS)); - } - - public String getName() { - return name; - } - - public boolean includeDeclaredFields() { - return set.contains(ReflectionAttributes.DECLARED_FIELDS); - } - - public boolean includePublicFields() { - return set.contains(ReflectionAttributes.PUBLIC_FIELDS); - } - - public boolean includeDeclaredConstructors() { - return set.contains(ReflectionAttributes.DECLARED_CONSTRUCTORS); - } - - public boolean includePublicConstructors() { - return set.contains(ReflectionAttributes.PUBLIC_CONSTRUCTORS); - } - - public boolean includeDeclaredMethods() { - return set.contains(ReflectionAttributes.DECLARED_METHODS); - } - - public boolean includePublicMethods() { - return set.contains(ReflectionAttributes.PUBLIC_METHODS); - } - - public boolean includeDeclaredClasses() { - return set.contains(ReflectionAttributes.DECLARED_CLASSES); - } - - public boolean includePublicClasses() { - return set.contains(ReflectionAttributes.PUBLIC_CLASSES); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ClassReflectionAttributes that = (ClassReflectionAttributes) o; - return name.equals(that.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeature.java deleted file mode 100644 index 5829a660af5f9..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeature.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.support.implementation; - -import org.graalvm.nativeimage.hosted.Feature; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Set; -import java.util.TreeSet; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.findClass; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.getClassesForPackage; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.registerClass; - -/** - * Implementations of this interface should configure the features specific to the Azure SDK client libraries. - */ -public interface GraalVMFeature extends Feature { - - default Set getDynamicProxies() { - return Collections.emptySet(); - } - - default Set getReflectionClasses() { - return Collections.emptySet(); - } - - /** - * This should the root package of the library - all classes within that package (and all sub-packages, including - * implementation classes) will be made available for reflection. - */ - String getRootPackage(); - - @Override - default void beforeAnalysis(final BeforeAnalysisAccess access) { - Feature.super.beforeAnalysis(access); - - // register the reflection classes and dynamic proxies - final Set reflectionClasses = getReflectionClasses(); - final Set dynamicProxies = getDynamicProxies(); - - // Before we do that, we validate each of the classes specified can be found on the classpath. - // If we can't find **all** of them, we don't proceed and we log an error to the console. - final Set missingClasses = new TreeSet<>(String::compareTo); - reflectionClasses.forEach(cls -> { - if (!findClass(access, cls.getName()).isPresent()) { - missingClasses.add(cls.getName()); - } - }); - - dynamicProxies.forEach(interfaces -> { - Arrays.stream(interfaces).forEach(cls -> { - if (!findClass(access, cls).isPresent()) { - missingClasses.add(cls); - } - }); - }); - - if (!missingClasses.isEmpty()) { - System.out.println("AZURE SDK: Not registering Azure GraalVM support for " + getClass() - + " as not all specified classes were found on classpath. Missing classes are:"); - missingClasses.forEach(cls -> System.out.println(" - " + cls)); - } else { - System.out.println("AZURE SDK: Registering Azure GraalVM support for " + getClass()); - reflectionClasses.forEach(reflectiveClass -> registerClass(access, reflectiveClass)); - dynamicProxies.forEach(interfaces -> GraalVMFeatureUtils.addProxyClass(access, interfaces)); - - // we also register all other classes as discovered in the exported packages set - getClassesForPackage(access, getRootPackage(), true).sorted() - .map(ClassReflectionAttributes::createWithAllDeclared) // create ReflectiveClass instances for all, with full API access enabled - .filter(reflectiveClass -> !reflectionClasses.contains(reflectiveClass)) // don't overwrite custom rules - .forEach(reflectiveClass -> registerClass(access, reflectiveClass)); - } - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeatureUtils.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeatureUtils.java deleted file mode 100644 index 86cb88686f2c6..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/GraalVMFeatureUtils.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.support.implementation; - -import com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry; -import org.graalvm.nativeimage.ImageSingletons; -import org.graalvm.nativeimage.hosted.Feature; -import org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess; -import org.graalvm.nativeimage.hosted.RuntimeReflection; - -import java.io.IOException; -import java.net.JarURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.stream.Stream; - -/** - * Utility class to configure GraalVM features. - */ -public final class GraalVMFeatureUtils { - - /** - * Registers the given interfaces for dynamic proxy generation. - * - * @param access The {@link BeforeAnalysisAccess} instance - * @param interfaces the list of interfaces that the generated proxy can implement - */ - public static void addProxyClass(final Feature.FeatureAccess access, final String... interfaces) { - final List> classList = new ArrayList<>(); - for (final String anInterface : interfaces) { - final Class clazz = access.findClassByName(anInterface); - if (clazz != null) { - classList.add(clazz); - } - } - if (classList.size() == interfaces.length) { - ImageSingletons.lookup(DynamicProxyRegistry.class) - .addProxyClass(classList.toArray(new Class[interfaces.length])); - } - } - - @SafeVarargs - @SuppressWarnings("varargs") - public static Set setOf(final T... s) { - final Set set = new LinkedHashSet<>(s.length); - set.addAll(Arrays.asList(s)); - return set; - } - - @SafeVarargs - @SuppressWarnings("varargs") - public static Set setsOf(final T[]... s) { - final Set set = new LinkedHashSet<>(s.length); - Collections.addAll(set, s); - return set; - } - - public static Optional> findClass(final Feature.FeatureAccess access, final String className) { - return Optional.ofNullable(access.findClassByName(className)); - } - - public static String[] interfaces(String... strings) { - return strings; - } - - public static void registerClass(final Feature.FeatureAccess access, - final ClassReflectionAttributes reflectiveClass) { - GraalVMFeatureUtils.findClass(access, reflectiveClass.getName()).ifPresent(cls -> { - RuntimeReflection.register(cls); - - // fields - if (reflectiveClass.includeDeclaredFields()) { - RuntimeReflection.register(cls.getDeclaredFields()); - } - if (reflectiveClass.includePublicFields()) { - RuntimeReflection.register(cls.getFields()); - } - - // constructors - if (reflectiveClass.includeDeclaredConstructors()) { - RuntimeReflection.register(cls.getDeclaredConstructors()); - } - if (reflectiveClass.includePublicConstructors()) { - RuntimeReflection.register(cls.getConstructors()); - } - - // methods - if (reflectiveClass.includeDeclaredMethods()) { - RuntimeReflection.register(cls.getDeclaredMethods()); - } - if (reflectiveClass.includePublicMethods()) { - RuntimeReflection.register(cls.getMethods()); - } - - // classes - if (reflectiveClass.includeDeclaredClasses()) { - RuntimeReflection.register(cls.getDeclaredClasses()); - } - if (reflectiveClass.includePublicClasses()) { - RuntimeReflection.register(cls.getClasses()); - } - }); - } - - public static Stream getClassesForPackage(final Feature.FeatureAccess access, final String packageName, - final boolean recursive) { - final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - final String packagePath = packageName.replace('.', '/'); - - try { - final Enumeration resources = classLoader.getResources(packagePath); - while (resources.hasMoreElements()) { - final URL url = resources.nextElement(); - final URLConnection connection = url.openConnection(); - if (connection instanceof JarURLConnection) { - return findClassesInJar(access, ((JarURLConnection) connection).getJarFile(), packageName, - recursive); - } - } - } catch (IOException e) { - throw new RuntimeException("Could not enable reflective access to classes from package " + packageName, e); - } - - return Stream.empty(); - } - - private static Stream findClassesInJar(final Feature.FeatureAccess access, final JarFile jarFile, - final String packageName, final boolean recursive) { - final List classNames = new ArrayList<>(); - final Enumeration entries = jarFile.entries(); - - // This enumerates all files in a single jar, so we need to be sure the entry is specifically in the - // specified package, and not a sub-package - final int packageDepth = countInString(packageName, '.'); - while (entries.hasMoreElements()) { - final String entryName = entries.nextElement().getName(); - - // we compare the package depth of the given entry with the package depth of the package we are looking for. - // At this point the entry is using forward slashes for packages, so we adjust accordingly here, and we - // subtract one to account for the slash before the class name - if (!recursive && countInString(entryName, '/') - 1 != packageDepth) { - continue; - } - - if (entryName.endsWith(".class")) { - String fqcn = entryName.replace('/', '.').replace(".class", ""); - - if (fqcn.startsWith(packageName)) { - classNames.add(fqcn); - } - } - } - - return classNames.stream(); - } - - private static int countInString(String haystack, char needle) { - int count = 0; - for (int i = 0; i < haystack.length(); i++) { - if (haystack.charAt(i) == needle) { - count++; - } - } - return count; - } - - private GraalVMFeatureUtils() { - // private ctor - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AppConfigFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AppConfigFeature.java deleted file mode 100644 index 5bd9c3efe909f..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AppConfigFeature.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class AppConfigFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.data.appconfiguration"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.data.appconfiguration.implementation.ConfigurationService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AzureCoreFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AzureCoreFeature.java deleted file mode 100644 index 3deebdc1ab649..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/AzureCoreFeature.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.ClassReflectionAttributes; -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.ClassReflectionAttributes.createWithAllDeclared; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setOf; - -@AutomaticFeature -public class AzureCoreFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.core"; - } - - @Override - public Set getReflectionClasses() { - return setOf(createWithAllDeclared("com.azure.core.util.DateTimeRfc1123"), - createWithAllDeclared("com.azure.core.http.rest.StreamResponse")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/CosmosFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/CosmosFeature.java deleted file mode 100644 index ac5b974069548..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/CosmosFeature.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -@AutomaticFeature -public class CosmosFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.cosmos"; - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/EventHubsFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/EventHubsFeature.java deleted file mode 100644 index 9fc0038a3e45c..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/EventHubsFeature.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -@AutomaticFeature -public class EventHubsFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.messaging.eventhubs"; - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/FormRecognizerFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/FormRecognizerFeature.java deleted file mode 100644 index 0641d6efb5797..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/FormRecognizerFeature.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class FormRecognizerFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.ai.formrecognizer"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces( - "com.azure.ai.formrecognizer.documentanalysis.implementation.FormRecognizerClientImpl$FormRecognizerClientService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/IdentityFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/IdentityFeature.java deleted file mode 100644 index d37af4f8d2cf6..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/IdentityFeature.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.ClassReflectionAttributes; -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.ClassReflectionAttributes.createWithAllDeclared; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setOf; - -@AutomaticFeature -public class IdentityFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.identity"; - } - - @Override - public Set getReflectionClasses() { - return setOf(createWithAllDeclared("com.microsoft.aad.msal4j.AadInstanceDiscoveryResponse"), - createWithAllDeclared("com.microsoft.aad.msal4j.InstanceDiscoveryMetadataEntry"), - - // this is due to Msal4j library dependency - createWithAllDeclared("java.util.HashSet")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultCertificatesFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultCertificatesFeature.java deleted file mode 100644 index 3031994f2294b..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultCertificatesFeature.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class KeyvaultCertificatesFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.security.keyvault.certificates"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.security.keyvault.certificates.implementation.CertificateService"), - interfaces("com.microsoft.aad.msal4jextensions.persistence.mac.ISecurityLibrary")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultKeysFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultKeysFeature.java deleted file mode 100644 index 2310a6c0b99d8..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultKeysFeature.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class KeyvaultKeysFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.security.keyvault.keys"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.security.keyvault.keys.implementation.KeyService"), - interfaces("com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultSecretsFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultSecretsFeature.java deleted file mode 100644 index 7f5494a3dc662..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/KeyvaultSecretsFeature.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class KeyvaultSecretsFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.security.keyvault.secrets"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.security.keyvault.secrets.implementation.SecretService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageBlobFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageBlobFeature.java deleted file mode 100644 index 6923923c1e73a..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageBlobFeature.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class StorageBlobFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.storage.blob"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.storage.blob.implementation.AppendBlobsImpl$AppendBlobsService"), - interfaces("com.azure.storage.blob.implementation.BlobsImpl$BlobsService"), - interfaces("com.azure.storage.blob.implementation.BlockBlobsImpl$BlockBlobsService"), - interfaces("com.azure.storage.blob.implementation.ContainersImpl$ContainersService"), - interfaces("com.azure.storage.blob.implementation.PageBlobsImpl$PageBlobsService"), - interfaces("com.azure.storage.blob.implementation.ServicesImpl$ServicesService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageFileShareFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageFileShareFeature.java deleted file mode 100644 index 6468ce213c7e8..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageFileShareFeature.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class StorageFileShareFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.storage.file.share"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.storage.file.share.implementation.DirectoriesImpl$DirectoriesService"), - interfaces("com.azure.storage.file.share.implementation.FilesImpl$FilesService"), - interfaces("com.azure.storage.file.share.implementation.ServicesImpl$ServicesService"), - interfaces("com.azure.storage.file.share.implementation.SharesImpl$SharesService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageQueueFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageQueueFeature.java deleted file mode 100644 index b048934b4e471..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/StorageQueueFeature.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class StorageQueueFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.storage.queue"; - } - - @Override - public Set getDynamicProxies() { - return setsOf(interfaces("com.azure.storage.queue.implementation.MessageIdsImpl$MessageIdsService"), - interfaces("com.azure.storage.queue.implementation.MessagesImpl$MessagesService"), - interfaces("com.azure.storage.queue.implementation.QueuesImpl$QueuesService"), - interfaces("com.azure.storage.queue.implementation.ServicesImpl$ServicesService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/TextAnalyticsFeature.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/TextAnalyticsFeature.java deleted file mode 100644 index f15d95f296dda..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/TextAnalyticsFeature.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.aot.graalvm.support.implementation.features; - -import com.azure.aot.graalvm.support.implementation.GraalVMFeature; -import com.oracle.svm.core.annotate.AutomaticFeature; - -import java.util.Set; - -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.interfaces; -import static com.azure.aot.graalvm.support.implementation.GraalVMFeatureUtils.setsOf; - -@AutomaticFeature -public class TextAnalyticsFeature implements GraalVMFeature { - - @Override - public String getRootPackage() { - return "com.azure.ai.textanalytics"; - } - - @Override - public Set getDynamicProxies() { - return setsOf( - interfaces("com.azure.ai.textanalytics.implementation.TextAnalyticsClientImpl$TextAnalyticsClientService")); - } -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/package-info.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/package-info.java deleted file mode 100644 index f60df0af0a64e..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/features/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * GraalVM features for client libraries. - */ -package com.azure.aot.graalvm.support.implementation.features; diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/package-info.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/package-info.java deleted file mode 100644 index dcae84695e860..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/com/azure/aot/graalvm/support/implementation/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * GraalVM configuration classes. - */ -package com.azure.aot.graalvm.support.implementation; diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/java/module-info.java b/sdk/aot/azure-aot-graalvm-support/src/main/java/module-info.java deleted file mode 100644 index dcbb865e5eb31..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/java/module-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.aot.graalvm.support { - requires transitive org.graalvm.sdk; - requires transitive svm; -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core-amqp/reflect-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core-amqp/reflect-config.json deleted file mode 100644 index ac7e4afa14f70..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core-amqp/reflect-config.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "name":"com.azure.core.amqp.models.CbsAuthorizationType", - "methods":[{"name":"","parameterTypes":[] }] - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties deleted file mode 100644 index db4ec164a145a..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties +++ /dev/null @@ -1,14 +0,0 @@ -Args=\ - --initialize-at-build-time=org.apache.log4j.Logger,\ - org.slf4j.LoggerFactory,\ - org.slf4j.impl.StaticLoggerBinder,\ - com.azure.core.implementation.logging.DefaultLogger,\ - com.azure.core.test.TestBase,\ - com.azure.core.util.Configuration,\ - com.azure.core.implementation.util.EnvironmentConfiguration,\ - com.azure.core.implementation.util.EnvironmentConfiguration$EnvironmentVariablesConfigurationSource,\ - com.azure.core.util.CoreUtils,\ - com.azure.core.util.NoopConfiguration,\ - com.azure.core.util.logging.LoggingEventBuilder,\ - com.fasterxml.jackson.core.io.JsonStringEncoder,\ - com.fasterxml.jackson.core.io.CharTypes diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json deleted file mode 100644 index ee26e4e8541b9..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/reflect-config.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "name":"com.azure.core.util.logging.ClientLogger", - "allDeclaredFields":true, - "queryAllDeclaredMethods":true, - "queryAllDeclaredConstructors":true - }, - { - "name":"com.azure.core.util.CoreUtils" - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/resource-config.json deleted file mode 100644 index a131ef5695124..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-core/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "META-INF/services/com.azure.core.http.HttpClientProvider" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-cosmos/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-cosmos/resource-config.json deleted file mode 100644 index 6011c1d557ffe..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-cosmos/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "\\Qazure-cosmos.properties\\E" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json deleted file mode 100644 index eaa0f86d3bd37..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/reflect-config.json +++ /dev/null @@ -1,70 +0,0 @@ -[ - { - "name": "com.azure.data.appconfiguration.models.SettingFields", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.ConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.implementation.ConfigurationSettingPage", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.FeatureFlagConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.SecretReferenceConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.SettingFields", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.azure.data.appconfiguration.ConfigurationClientBuilderTest", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.azure.data.appconfiguration.models.ConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.implementation.ConfigurationSettingPage", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.FeatureFlagConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.azure.data.appconfiguration.models.SecretReferenceConfigurationSetting", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/resource-config.json deleted file mode 100644 index 991a61e736888..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-data-appconfiguration/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "azure-data-appconfiguration.properties" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-messaging-eventhubs/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-messaging-eventhubs/resource-config.json deleted file mode 100644 index cf430e9e8f896..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-messaging-eventhubs/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "\\Qazure-messaging-eventhubs.properties\\E" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-certificates/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-certificates/resource-config.json deleted file mode 100644 index 007b03e7bfc54..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-certificates/resource-config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "\\Qazure-key-vault-certificates.properties\\E" - }, - { - "pattern": "\\Qcom/sun/jna/darwin/libjnidispatch.jnilib\\E" - }, - { - "pattern": "\\QkvErrorStrings.properties\\E" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-keys/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-keys/resource-config.json deleted file mode 100644 index 0e369c7032955..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-security-keyvault-keys/resource-config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "azure-key-vault-keys.properties" - }, - { - "pattern": "kvErrorStrings.properties" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/resource-config.json deleted file mode 100644 index 8a791a164f4aa..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/azure-storage-blob/resource-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "\\Qazure-storage-blob.properties\\E" - } - ] - }, - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/native-image.properties b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/native-image.properties deleted file mode 100644 index a86e89f337521..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.azure/native-image.properties +++ /dev/null @@ -1,4 +0,0 @@ -Args=\ - --allow-incomplete-classpath \ - --report-unsupported-elements-at-runtime \ - -H:+AddAllCharsets diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.microsoft.azure/msal4j-persistence-extension/reflect-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.microsoft.azure/msal4j-persistence-extension/reflect-config.json deleted file mode 100644 index 8641f3429e057..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/com.microsoft.azure/msal4j-persistence-extension/reflect-config.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "name": "com.microsoft.aad.msal4j.IdToken", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.microsoft.aad.msal4j.ClientInfo", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.microsoft.aad.msal4j.DeviceCode", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - }, - { - "name": "com.microsoft.aad.msal4j.ErrorResponse", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allDeclaredFields": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/jni-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/jni-config.json deleted file mode 100644 index a1dc6d0867407..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/jni-config.json +++ /dev/null @@ -1,955 +0,0 @@ -[ - { - "name": "com.sun.jna.Callback" - }, - { - "name": "com.sun.jna.CallbackReference", - "methods": [ - { - "name": "getCallback", - "parameterTypes": [ - "java.lang.Class", - "com.sun.jna.Pointer", - "boolean" - ] - }, - { - "name": "getFunctionPointer", - "parameterTypes": [ - "com.sun.jna.Callback", - "boolean" - ] - }, - { - "name": "getNativeString", - "parameterTypes": [ - "java.lang.Object", - "boolean" - ] - }, - { - "name": "initializeThread", - "parameterTypes": [ - "com.sun.jna.Callback", - "com.sun.jna.CallbackReference$AttachOptions" - ] - } - ] - }, - { - "name": "com.sun.jna.CallbackReference$AttachOptions" - }, - { - "name": "com.sun.jna.FromNativeConverter", - "methods": [ - { - "name": "nativeType", - "parameterTypes": [] - } - ] - }, - { - "name": "com.sun.jna.IntegerType", - "fields": [ - { - "name": "value" - } - ] - }, - { - "name": "com.sun.jna.JNIEnv" - }, - { - "name": "com.sun.jna.Library" - }, - { - "name": "com.sun.jna.Native", - "methods": [ - { - "name": "dispose", - "parameterTypes": [] - }, - { - "name": "fromNative", - "parameterTypes": [ - "com.sun.jna.FromNativeConverter", - "java.lang.Object", - "java.lang.reflect.Method" - ] - }, - { - "name": "fromNative", - "parameterTypes": [ - "java.lang.Class", - "java.lang.Object" - ] - }, - { - "name": "fromNative", - "parameterTypes": [ - "java.lang.reflect.Method", - "java.lang.Object" - ] - }, - { - "name": "nativeType", - "parameterTypes": [ - "java.lang.Class" - ] - }, - { - "name": "toNative", - "parameterTypes": [ - "com.sun.jna.ToNativeConverter", - "java.lang.Object" - ] - } - ] - }, - { - "name": "com.sun.jna.Native$ffi_callback", - "methods": [ - { - "name": "invoke", - "parameterTypes": [ - "long", - "long", - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.NativeMapped", - "methods": [ - { - "name": "toNative", - "parameterTypes": [] - } - ] - }, - { - "name": "com.sun.jna.Pointer", - "fields": [ - { - "name": "peer" - } - ], - "methods": [ - { - "name": "", - "parameterTypes": [ - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.PointerType", - "fields": [ - { - "name": "pointer" - } - ] - }, - { - "name": "com.sun.jna.Structure", - "fields": [ - { - "name": "memory" - }, - { - "name": "typeInfo" - } - ], - "methods": [ - { - "name": "autoRead", - "parameterTypes": [] - }, - { - "name": "autoWrite", - "parameterTypes": [] - }, - { - "name": "getTypeInfo", - "parameterTypes": [] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.Structure$ByValue" - }, - { - "name": "com.sun.jna.Structure$FFIType$FFITypes", - "fields": [ - { - "name": "ffi_type_double" - }, - { - "name": "ffi_type_float" - }, - { - "name": "ffi_type_longdouble" - }, - { - "name": "ffi_type_pointer" - }, - { - "name": "ffi_type_sint16" - }, - { - "name": "ffi_type_sint32" - }, - { - "name": "ffi_type_sint64" - }, - { - "name": "ffi_type_sint8" - }, - { - "name": "ffi_type_uint16" - }, - { - "name": "ffi_type_uint32" - }, - { - "name": "ffi_type_uint64" - }, - { - "name": "ffi_type_uint8" - }, - { - "name": "ffi_type_void" - } - ] - }, - { - "name": "com.sun.jna.WString", - "methods": [ - { - "name": "", - "parameterTypes": [ - "java.lang.String" - ] - } - ] - }, - { - "name": "com.sun.jna.Native", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.lang.Class", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.lang.reflect.Method", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.lang.String", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.Buffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.ByteBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.CharBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.ShortBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.IntBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.LongBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.FloatBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.nio.DoubleBuffer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.lang.Void", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Boolean", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Byte", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Character", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Short", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Integer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Long", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Float", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "java.lang.Double", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - }, - { - "name": "TYPE" - } - ] - }, - { - "name": "com.sun.jna.Pointer", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "peer", - "allowWrite": true - } - ] - }, - { - "name": "com.sun.jna.Structure$ByValue", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.WString", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.NativeMapped", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.IntegerType", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.PointerType", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.JNIEnv", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Native$ffi_callback", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.FromNativeConverter", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Structure", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "memory", - "allowWrite": true - }, - { - "name": "typeInfo", - "allowWrite": true - } - ], - "methods": [ - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "com.sun.jna.Pointer" - ] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "long" - ] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class" - ] - }, - { - "name": "getTypeInfo", - "parameterTypes": [ - "java.lang.Object" - ] - } - ] - }, - { - "name": "com.sun.jna.Callback", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.CallbackReference$AttachOptions", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.CallbackReference", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.IntegerType", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "value", - "allowWrite": true - } - ] - }, - { - "name": "com.sun.jna.PointerType", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "pointer", - "allowWrite": true - } - ] - }, - { - "name": "com.sun.jna.Structure$FFIType", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Structure$FFIType$FFITypes", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "ffi_type_void", - "allowWrite": true - }, - { - "name": "ffi_type_float", - "allowWrite": true - }, - { - "name": "ffi_type_double", - "allowWrite": true - }, - { - "name": "ffi_type_longdouble", - "allowWrite": true - }, - { - "name": "ffi_type_uint8", - "allowWrite": true - }, - { - "name": "ffi_type_sint8", - "allowWrite": true - }, - { - "name": "ffi_type_uint16", - "allowWrite": true - }, - { - "name": "ffi_type_sint16", - "allowWrite": true - }, - { - "name": "ffi_type_uint32", - "allowWrite": true - }, - { - "name": "ffi_type_sint32", - "allowWrite": true - }, - { - "name": "ffi_type_uint64", - "allowWrite": true - }, - { - "name": "ffi_type_sint64", - "allowWrite": true - }, - { - "name": "ffi_type_pointer", - "allowWrite": true - } - ] - }, - { - "name": "com.sun.jna.NativeLong", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.ptr.PointerByReference", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "byte[][]" - }, - { - "name": "com.sun.jna.Callback" - }, - { - "name": "com.sun.jna.CallbackReference", - "methods": [ - { - "name": "getCallback", - "parameterTypes": [ - "java.lang.Class", - "com.sun.jna.Pointer", - "boolean" - ] - }, - { - "name": "getFunctionPointer", - "parameterTypes": [ - "com.sun.jna.Callback", - "boolean" - ] - }, - { - "name": "getNativeString", - "parameterTypes": [ - "java.lang.Object", - "boolean" - ] - }, - { - "name": "initializeThread", - "parameterTypes": [ - "com.sun.jna.Callback", - "com.sun.jna.CallbackReference$AttachOptions" - ] - } - ] - }, - { - "name": "com.sun.jna.CallbackReference$AttachOptions" - }, - { - "name": "com.sun.jna.FromNativeConverter", - "methods": [ - { - "name": "nativeType", - "parameterTypes": [] - } - ] - }, - { - "name": "com.sun.jna.IntegerType", - "fields": [ - { - "name": "value" - } - ] - }, - { - "name": "com.sun.jna.JNIEnv" - }, - { - "name": "com.sun.jna.Native", - "methods": [ - { - "name": "dispose", - "parameterTypes": [] - }, - { - "name": "fromNative", - "parameterTypes": [ - "com.sun.jna.FromNativeConverter", - "java.lang.Object", - "java.lang.reflect.Method" - ] - }, - { - "name": "fromNative", - "parameterTypes": [ - "java.lang.Class", - "java.lang.Object" - ] - }, - { - "name": "fromNative", - "parameterTypes": [ - "java.lang.reflect.Method", - "java.lang.Object" - ] - }, - { - "name": "nativeType", - "parameterTypes": [ - "java.lang.Class" - ] - }, - { - "name": "toNative", - "parameterTypes": [ - "com.sun.jna.ToNativeConverter", - "java.lang.Object" - ] - } - ] - }, - { - "name": "com.sun.jna.Native$ffi_callback", - "methods": [ - { - "name": "invoke", - "parameterTypes": [ - "long", - "long", - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.NativeMapped", - "methods": [ - { - "name": "toNative", - "parameterTypes": [] - } - ] - }, - { - "name": "com.sun.jna.Pointer", - "fields": [ - { - "name": "peer" - } - ], - "methods": [ - { - "name": "", - "parameterTypes": [ - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.PointerType", - "fields": [ - { - "name": "pointer" - } - ] - }, - { - "name": "com.sun.jna.Structure", - "fields": [ - { - "name": "memory" - }, - { - "name": "typeInfo" - } - ], - "methods": [ - { - "name": "autoRead", - "parameterTypes": [] - }, - { - "name": "autoWrite", - "parameterTypes": [] - }, - { - "name": "getTypeInfo", - "parameterTypes": [] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "long" - ] - } - ] - }, - { - "name": "com.sun.jna.Structure$ByValue" - }, - { - "name": "com.sun.jna.Structure$FFIType$FFITypes", - "fields": [ - { - "name": "ffi_type_double" - }, - { - "name": "ffi_type_float" - }, - { - "name": "ffi_type_longdouble" - }, - { - "name": "ffi_type_pointer" - }, - { - "name": "ffi_type_sint16" - }, - { - "name": "ffi_type_sint32" - }, - { - "name": "ffi_type_sint64" - }, - { - "name": "ffi_type_sint8" - }, - { - "name": "ffi_type_uint16" - }, - { - "name": "ffi_type_uint32" - }, - { - "name": "ffi_type_uint64" - }, - { - "name": "ffi_type_uint8" - }, - { - "name": "ffi_type_void" - } - ] - }, - { - "name": "com.sun.jna.WString", - "methods": [ - { - "name": "", - "parameterTypes": [ - "java.lang.String" - ] - } - ] - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/proxy-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/proxy-config.json deleted file mode 100644 index 169c0d33834e6..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/proxy-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - [ - "com.sun.jna.Library" - ], - [ - "com.sun.jna.Callback" - ] -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/reflect-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/reflect-config.json deleted file mode 100644 index c5abef19aaa01..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/reflect-config.json +++ /dev/null @@ -1,89 +0,0 @@ -[ - { - "name": "com.sun.jna.CallbackReference", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Klass", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Native", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.Structure", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "fields": [ - { - "name": "memory", - "allowWrite": true - }, - { - "name": "typeInfo" - } - ], - "methods": [ - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "com.sun.jna.Pointer" - ] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class", - "long" - ] - }, - { - "name": "newInstance", - "parameterTypes": [ - "java.lang.Class" - ] - } - ] - }, - { - "name": "com.sun.jna.NativeLong", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.ptr.PointerByReference", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "com.sun.jna.ptr.IntByReference", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - }, - { - "name": "java.util.Base64$Decoder", - "allDeclaredConstructors": true, - "allPublicConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true - } -] diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/resource-config.json b/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/resource-config.json deleted file mode 100644 index 7b8f03c5fcff9..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/META-INF/native-image/net.java.dev.jna/jna/resource-config.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "resources": [ - { - "pattern": "\\QMETA-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory\\E" - }, - { - "pattern": "\\QMETA-INF/services/jdk.vm.ci.services.JVMCIServiceLocator\\E" - }, - { - "pattern": "\\Qcom/sun/jna/linux-x86-64/libjnidispatch.so\\E" - } - ], - "bundles": [] -} diff --git a/sdk/aot/azure-aot-graalvm-support/src/main/resources/azure-aot-graalvm-support.properties b/sdk/aot/azure-aot-graalvm-support/src/main/resources/azure-aot-graalvm-support.properties deleted file mode 100644 index ca812989b4f27..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/main/resources/azure-aot-graalvm-support.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/sdk/aot/azure-aot-graalvm-support/src/samples/README.md b/sdk/aot/azure-aot-graalvm-support/src/samples/README.md deleted file mode 100644 index e0351d2174c1f..0000000000000 --- a/sdk/aot/azure-aot-graalvm-support/src/samples/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Azure GraalVM Support client library for Java - -## Getting started -Getting started explained in detail [here][SDK_README_GETTING_STARTED]. - -## Key concepts -Key concepts are explained in detail [here][SDK_README_KEY_CONCEPTS]. - -## Examples -The following sections provide several code snippets covering some of the most common scenarios, including: - -## Troubleshooting -Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. - -## Next steps -See [Next steps][SDK_README_NEXT_STEPS]. - -## Contributing -This project welcomes contributions and suggestions. Find [more contributing][SDK_README_CONTRIBUTING] details here. - - -[SDK_README_CONTRIBUTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support/README.md#contributing -[SDK_README_GETTING_STARTED]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support/README.md#getting-started -[SDK_README_TROUBLESHOOTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support/README.md#troubleshooting -[SDK_README_KEY_CONCEPTS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support/README.md#key-concepts -[SDK_README_NEXT_STEPS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support/README.md#next-steps - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support%2FREADME.png) diff --git a/sdk/aot/ci.yml b/sdk/aot/ci.yml deleted file mode 100644 index 727a0bbf5fec7..0000000000000 --- a/sdk/aot/ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/aot/ - exclude: - - sdk/aot/pom.xml - - sdk/aot/azure-aot-graalvm-support/pom.xml - - sdk/aot/azure-aot-graalvm-support-netty/pom.xml - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/aot/ - exclude: - - sdk/aot/pom.xml - - sdk/aot/azure-aot-graalvm-support/pom.xml - - sdk/aot/azure-aot-graalvm-support-netty/pom.xml - -parameters: -- name: release_azureaotgraalvmsupport - displayName: 'azure-aot-graalvm-support' - type: boolean - default: true -- name: release_azureaotgraalvmsupportnetty - displayName: 'azure-aot-graalvm-support-netty' - type: boolean - default: true - -extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: aot - Artifacts: - - name: azure-aot-graalvm-support - groupId: com.azure - safeName: azureaotgraalvmsupport - releaseInBatch: ${{ parameters.release_azureaotgraalvmsupport }} - skipPublishDocMs: true - - name: azure-aot-graalvm-support-netty - groupId: com.azure - safeName: azureaotgraalvmsupportnetty - releaseInBatch: ${{ parameters.release_azureaotgraalvmsupportnetty }} - skipPublishDocMs: true - AdditionalModules: - - name: azure-aot-graalvm-perf - groupId: com.azure - - name: azure-aot-graalvm-samples - groupId: com.azure diff --git a/sdk/aot/pom.xml b/sdk/aot/pom.xml deleted file mode 100644 index 0d7a4830691cb..0000000000000 --- a/sdk/aot/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - 4.0.0 - com.azure - azure-aot-service - pom - 1.0.0 - - azure-aot-graalvm-support - azure-aot-graalvm-support-netty - azure-aot-graalvm-samples - azure-aot-graalvm-perf - - diff --git a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml index 8e077404ba966..b112bd4551614 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml @@ -46,60 +46,4 @@ 1.15.7 - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - ${perf.test.mainClass} - ${perf.test.imageName} - - - - build-native - - build - - package - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - ${perf.test.mainClass} - - - - - - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - - com.azure - azure-identity - 1.15.0 - - - - diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index e0652ac7f3f70..795a8f8bd12d2 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -43,7 +43,6 @@ --add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED --add-opens com.azure.data.appconfiguration/com.azure.data.appconfiguration=ALL-UNNAMED - false --initialize-at-build-time=com.azure.data.appconfiguration.TestHelper checkstyle-suppressions.xml diff --git a/sdk/appconfiguration/ci.yml b/sdk/appconfiguration/ci.yml index 2c9ef2968060a..2b21dac401030 100644 --- a/sdk/appconfiguration/ci.yml +++ b/sdk/appconfiguration/ci.yml @@ -63,5 +63,3 @@ extends: AdditionalModules: - name: perf-test-core groupId: com.azure - - name: azure-aot-graalvm-perf - groupId: com.azure diff --git a/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml index 8165b21b81445..23ac4ecbd1712 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml @@ -44,70 +44,4 @@ 1.15.7 - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - ${perf.test.mainClass} - ${perf.test.imageName} - - - - build-native - - build - - package - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - ${perf.test.mainClass} - - - - - - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - - com.azure - azure-identity - 1.15.0 - - - - diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index da8b71f4b11eb..a13a66a1bbc2c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -40,7 +40,6 @@ --add-opens com.azure.ai.formrecognizer/com.azure.ai.formrecognizer.documentanalysis=ALL-UNNAMED --add-opens com.azure.ai.formrecognizer/com.azure.ai.formrecognizer.documentanalysis.administration=ALL-UNNAMED - false checkstyle-suppressions.xml false diff --git a/sdk/formrecognizer/ci.yml b/sdk/formrecognizer/ci.yml index bd13b4ae62387..18325733508de 100644 --- a/sdk/formrecognizer/ci.yml +++ b/sdk/formrecognizer/ci.yml @@ -49,5 +49,3 @@ extends: # both of these are required by the above perf library - name: perf-test-core groupId: com.azure - - name: azure-aot-graalvm-perf - groupId: com.azure diff --git a/sdk/keyvault/azure-security-keyvault-perf/pom.xml b/sdk/keyvault/azure-security-keyvault-perf/pom.xml index 312c757b2af6e..3ec8a8dab14ed 100644 --- a/sdk/keyvault/azure-security-keyvault-perf/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-perf/pom.xml @@ -65,70 +65,4 @@ 1.15.7 - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - ${perf.test.mainClass} - ${perf.test.imageName} - - - - build-native - - build - - package - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - ${perf.test.mainClass} - - - - - - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - - com.azure - azure-identity - 1.15.0 - - - - diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index 152f021d5d78e..18b2ee5f83663 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -109,5 +109,3 @@ extends: # required by the above perf library - name: perf-test-core groupId: com.azure - - name: azure-aot-graalvm-perf - groupId: com.azure diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index d6207e092e7ca..b3b59fcea40b6 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -57,7 +57,6 @@ --add-reads com.azure.storage.blob=com.azure.core.http.jdk.httpclient --add-reads com.azure.storage.blob=com.azure.core.http.vertx - false concurrent checkstyle-suppressions.xml diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index 294155b317337..aa9c0bd60e002 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -79,70 +79,4 @@ 4.9.1 - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - com.azure.storage.App - azure-storage-blob-perf - - - - build-native - - build - - package - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - com.azure.storage.App - - - - - - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - - com.azure - azure-identity - 1.15.0 - - - - diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 59885d09159c7..c786407844638 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -164,8 +164,6 @@ extends: # required by the above perf library - name: perf-test-core groupId: com.azure - - name: azure-aot-graalvm-perf - groupId: com.azure MatrixConfigs: - Name: Storage_ci Path: sdk/storage/platform-matrix-ci.json diff --git a/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml b/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml index ca10c3952b423..17f78e0631657 100644 --- a/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml @@ -46,70 +46,4 @@ 1.15.7 - - - - native - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.19 - - ${perf.test.mainClass} - ${perf.test.imageName} - - - - build-native - - build - - package - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - - java - - - - - ${perf.test.mainClass} - - - - - - - com.azure - azure-aot-graalvm-support - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-support-netty - 1.0.0-beta.3 - - - com.azure - azure-aot-graalvm-perf - 1.0.0-beta.1 - - - com.azure - azure-identity - 1.15.0 - - - - diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index 4ed2fddb37051..03734b3e39234 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -39,7 +39,6 @@ --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED --add-opens com.azure.ai.textanalytics/com.azure.ai.textanalytics=ALL-UNNAMED - false checkstyle-suppressions.xml false diff --git a/sdk/textanalytics/ci.yml b/sdk/textanalytics/ci.yml index 2e5d399256b5b..8bf6d3ed65851 100644 --- a/sdk/textanalytics/ci.yml +++ b/sdk/textanalytics/ci.yml @@ -48,5 +48,3 @@ extends: # required by the above perf library - name: perf-test-core groupId: com.azure - - name: azure-aot-graalvm-perf - groupId: com.azure