Skip to content

Commit

Permalink
2024-09-29 11:11:21
Browse files Browse the repository at this point in the history
  • Loading branch information
yingzhuo committed Sep 29, 2024
1 parent 9e8184d commit 4f843e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.ReactorNettyClientRequestFactory;
import org.springframework.http.client.ReactorClientHttpRequestFactory;
import org.springframework.lang.Nullable;
import reactor.netty.http.client.HttpClient;
import spring.turbo.module.webcli.x509.TrustAllX509TrustManager;
Expand All @@ -25,7 +25,6 @@
* @since 3.3.0
* @deprecated 请使用 <a href="https://github.com/Hakky54/sslcontext-kickstart">sslcontext-kickstart</a>
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.3.2", forRemoval = true)
public class NettyClientRequestFactoryBean implements FactoryBean<ClientHttpRequestFactory>, InitializingBean {

Expand All @@ -35,7 +34,7 @@ public class NettyClientRequestFactoryBean implements FactoryBean<ClientHttpRequ
private @Nullable Duration connectTimeout = null;
private @Nullable Duration exchangeTimeout = null;
private @Nullable Duration readTimeout = null;
private ReactorNettyClientRequestFactory factory = null;
private ReactorClientHttpRequestFactory factory = null;

/**
* 默认构造方法
Expand Down Expand Up @@ -79,7 +78,7 @@ public void afterPropertiesSet() {
)
);

this.factory = new ReactorNettyClientRequestFactory(httpClient);
this.factory = new ReactorClientHttpRequestFactory(httpClient);
Optional.ofNullable(connectTimeout).ifPresent(timeout -> this.factory.setConnectTimeout(timeout));
Optional.ofNullable(readTimeout).ifPresent(timeout -> this.factory.setReadTimeout(timeout));
Optional.ofNullable(exchangeTimeout).ifPresent(timeout -> this.factory.setExchangeTimeout(timeout));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package spring.turbo.module.webcli.cli;

import org.springframework.core.io.Resource;
import org.springframework.http.client.ReactorNettyClientRequestFactory;
import org.springframework.http.client.ReactorClientHttpRequestFactory;
import spring.turbo.util.CastUtils;
import spring.turbo.util.crypto.keystore.KeyStoreFormat;

import javax.annotation.Nullable;
import java.time.Duration;

/**
* {@link ReactorNettyClientRequestFactory} 生成工具
* {@link ReactorClientHttpRequestFactory} 生成工具
*
* @author 应卓
* @since 3.3.0
Expand All @@ -26,23 +26,23 @@ private NettyClientRequestFactoryFactories() {
}

/**
* 创建 {@link ReactorNettyClientRequestFactory} 对象
* 创建 {@link ReactorClientHttpRequestFactory} 对象
*
* @return {@link ReactorNettyClientRequestFactory} 对象
* @return {@link ReactorClientHttpRequestFactory} 对象
*/
public static ReactorNettyClientRequestFactory create() {
public static ReactorClientHttpRequestFactory create() {
return create(null, null, null, null, null, null);
}

/**
* 创建 {@link ReactorNettyClientRequestFactory} 对象
* 创建 {@link ReactorClientHttpRequestFactory} 对象
*
* @param clientSideCertificate SSL客户端证书
* @param clientSideCertificateFormat SSL客户端证书类型
* @param clientSideCertificatePassword SSL客户端证书密码
* @return {@link ReactorNettyClientRequestFactory} 对象
* @return {@link ReactorClientHttpRequestFactory} 对象
*/
public static ReactorNettyClientRequestFactory create(
public static ReactorClientHttpRequestFactory create(
@Nullable Resource clientSideCertificate,
@Nullable KeyStoreFormat clientSideCertificateFormat,
@Nullable String clientSideCertificatePassword) {
Expand All @@ -58,14 +58,14 @@ public static ReactorNettyClientRequestFactory create(
}

/**
* 创建 {@link ReactorNettyClientRequestFactory} 对象
* 创建 {@link ReactorClientHttpRequestFactory} 对象
*
* @param connectTimeout 连接超时时间
* @param exchangeTimeout 请求超时时间
* @param readTimout 读取应答超时时间
* @return {@link ReactorNettyClientRequestFactory} 对象
* @return {@link ReactorClientHttpRequestFactory} 对象
*/
public static ReactorNettyClientRequestFactory create(
public static ReactorClientHttpRequestFactory create(
@Nullable Duration connectTimeout,
@Nullable Duration exchangeTimeout,
@Nullable Duration readTimout
Expand All @@ -76,17 +76,17 @@ public static ReactorNettyClientRequestFactory create(
}

/**
* 创建 {@link ReactorNettyClientRequestFactory} 对象
* 创建 {@link ReactorClientHttpRequestFactory} 对象
*
* @param clientSideCertificate SSL客户端证书
* @param clientSideCertificateFormat SSL客户端证书类型
* @param clientSideCertificatePassword SSL客户端证书密码
* @param connectTimeout 连接超时时间
* @param exchangeTimeout 请求超时时间
* @param readTimout 读取应答超时时间
* @return {@link ReactorNettyClientRequestFactory} 对象
* @return {@link ReactorClientHttpRequestFactory} 对象
*/
public static ReactorNettyClientRequestFactory create(
public static ReactorClientHttpRequestFactory create(
@Nullable Resource clientSideCertificate,
@Nullable KeyStoreFormat clientSideCertificateFormat,
@Nullable String clientSideCertificatePassword,
Expand Down

0 comments on commit 4f843e3

Please sign in to comment.