-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move HttpClient SPI Implementation to Public API (#18580)
* Move HttpClient Service Provider Interface Implementations to Public API * Clean up linting * Update documentation, fix styling
- Loading branch information
1 parent
3bc2464
commit 5c12e44
Showing
18 changed files
with
55 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...dk-httpclient/src/main/java/com/azure/core/http/jdk/httpclient/JdkHttpClientProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.core.http.jdk.httpclient; | ||
|
||
import com.azure.core.http.HttpClient; | ||
import com.azure.core.http.HttpClientProvider; | ||
|
||
/** | ||
* An {@link HttpClientProvider} that provides an implementation of HttpClient based on native JDK HttpClient. | ||
* <p> | ||
* NOTE: This implementation is only available in Java 11+ as that is when {@link java.net.http.HttpClient} was | ||
* introduced. | ||
*/ | ||
public final class JdkHttpClientProvider implements HttpClientProvider { | ||
|
||
@Override | ||
public HttpClient createInstance() { | ||
return new JdkAsyncHttpClientBuilder().build(); | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
...rc/main/java/com/azure/core/http/jdk/httpclient/implementation/JdkHttpClientProvider.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
sdk/core/azure-core-http-jdk-httpclient/src/main/java/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dk-httpclient/src/main/resources/META-INF/services/com.azure.core.http.HttpClientProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.azure.core.http.jdk.httpclient.implementation.JdkHttpClientProvider | ||
com.azure.core.http.jdk.httpclient.JdkHttpClientProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...tion/RestProxyWithJdkHttpClientTests.java → ...ient/RestProxyWithJdkHttpClientTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
...mentation/ReactorNettyClientProvider.java → ...ttp/netty/ReactorNettyClientProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...re-http-netty/src/main/resources/META-INF/services/com.azure.core.http.HttpClientProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.azure.core.http.netty.implementation.ReactorNettyClientProvider | ||
com.azure.core.http.netty.ReactorNettyClientProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ion/RestProxyWithHttpProxyNettyTests.java → ...tty/RestProxyWithHttpProxyNettyTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...plementation/RestProxyWithNettyTests.java → ...e/http/netty/RestProxyWithNettyTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
.../implementation/OkHttpClientProvider.java → ...ore/http/okhttp/OkHttpClientProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
sdk/core/azure-core-http-okhttp/src/main/java/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
import com.azure.core.http.okhttp.OkHttpClientProvider; | ||
|
||
module com.azure.core.http.okhttp { | ||
requires transitive com.azure.core; | ||
|
||
requires okhttp3; | ||
requires okio; | ||
|
||
exports com.azure.core.http.okhttp; | ||
exports com.azure.core.http.okhttp.implementation; // FIXME this should not be a long-term solution | ||
|
||
provides com.azure.core.http.HttpClientProvider | ||
with com.azure.core.http.okhttp.implementation.OkHttpClientProvider; | ||
with OkHttpClientProvider; | ||
|
||
uses com.azure.core.http.HttpClientProvider; | ||
} |
2 changes: 1 addition & 1 deletion
2
...e-http-okhttp/src/main/resources/META-INF/services/com.azure.core.http.HttpClientProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.azure.core.http.okhttp.implementation.OkHttpClientProvider | ||
com.azure.core.http.okhttp.OkHttpClientProvider |
3 changes: 1 addition & 2 deletions
3
...on/RestProxyWithHttpProxyOkHttpTests.java → ...tp/RestProxyWithHttpProxyOkHttpTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...lementation/RestProxyWithOkHttpTests.java → ...http/okhttp/RestProxyWithOkHttpTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters