|
|
@ -26,7 +26,6 @@ import org.springframework.http.client.ClientHttpRequestFactory;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param connectTimeout the connect timeout
|
|
|
|
* @param connectTimeout the connect timeout
|
|
|
|
* @param readTimeout the read timeout
|
|
|
|
* @param readTimeout the read timeout
|
|
|
|
* @param bufferRequestBody if request body buffering is used
|
|
|
|
|
|
|
|
* @param sslBundle the SSL bundle providing SSL configuration
|
|
|
|
* @param sslBundle the SSL bundle providing SSL configuration
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Phillip Webb
|
|
|
@ -34,8 +33,7 @@ import org.springframework.http.client.ClientHttpRequestFactory;
|
|
|
|
* @since 3.0.0
|
|
|
|
* @since 3.0.0
|
|
|
|
* @see ClientHttpRequestFactories
|
|
|
|
* @see ClientHttpRequestFactories
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration readTimeout, Boolean bufferRequestBody,
|
|
|
|
public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration readTimeout, SslBundle sslBundle) {
|
|
|
|
SslBundle sslBundle) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Use defaults for the {@link ClientHttpRequestFactory} which can differ depending on
|
|
|
|
* Use defaults for the {@link ClientHttpRequestFactory} which can differ depending on
|
|
|
@ -48,15 +46,29 @@ public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration
|
|
|
|
* Create a new {@link ClientHttpRequestFactorySettings} instance.
|
|
|
|
* Create a new {@link ClientHttpRequestFactorySettings} instance.
|
|
|
|
* @param connectTimeout the connection timeout
|
|
|
|
* @param connectTimeout the connection timeout
|
|
|
|
* @param readTimeout the read timeout
|
|
|
|
* @param readTimeout the read timeout
|
|
|
|
* @param bufferRequestBody the bugger request body
|
|
|
|
* @param bufferRequestBody if request body buffering is used
|
|
|
|
* @param sslBundle the ssl bundle
|
|
|
|
* @deprecated since 3.2.0 for removal in 3.4.0 as support for buffering has been
|
|
|
|
* @since 3.1.0
|
|
|
|
* removed in Spring Framework 6.1
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public ClientHttpRequestFactorySettings {
|
|
|
|
@Deprecated(since = "3.2.0", forRemoval = true)
|
|
|
|
|
|
|
|
public ClientHttpRequestFactorySettings(Duration connectTimeout, Duration readTimeout, Boolean bufferRequestBody) {
|
|
|
|
|
|
|
|
this(connectTimeout, readTimeout, (SslBundle) null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ClientHttpRequestFactorySettings(Duration connectTimeout, Duration readTimeout, Boolean bufferRequestBody) {
|
|
|
|
/**
|
|
|
|
this(connectTimeout, readTimeout, bufferRequestBody, null);
|
|
|
|
* Create a new {@link ClientHttpRequestFactorySettings} instance.
|
|
|
|
|
|
|
|
* @param connectTimeout the connection timeout
|
|
|
|
|
|
|
|
* @param readTimeout the read timeout
|
|
|
|
|
|
|
|
* @param bufferRequestBody if request body buffering is used
|
|
|
|
|
|
|
|
* @param sslBundle the ssl bundle
|
|
|
|
|
|
|
|
* @since 3.1.0
|
|
|
|
|
|
|
|
* @deprecated since 3.2.0 for removal in 3.4.0 as support for buffering has been
|
|
|
|
|
|
|
|
* removed in Spring Framework 6.1
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Deprecated(since = "3.2.0", forRemoval = true)
|
|
|
|
|
|
|
|
public ClientHttpRequestFactorySettings(Duration connectTimeout, Duration readTimeout, Boolean bufferRequestBody,
|
|
|
|
|
|
|
|
SslBundle sslBundle) {
|
|
|
|
|
|
|
|
this(connectTimeout, readTimeout, sslBundle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -66,8 +78,7 @@ public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration
|
|
|
|
* @return a new {@link ClientHttpRequestFactorySettings} instance
|
|
|
|
* @return a new {@link ClientHttpRequestFactorySettings} instance
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public ClientHttpRequestFactorySettings withConnectTimeout(Duration connectTimeout) {
|
|
|
|
public ClientHttpRequestFactorySettings withConnectTimeout(Duration connectTimeout) {
|
|
|
|
return new ClientHttpRequestFactorySettings(connectTimeout, this.readTimeout, this.bufferRequestBody,
|
|
|
|
return new ClientHttpRequestFactorySettings(connectTimeout, this.readTimeout, this.sslBundle);
|
|
|
|
this.sslBundle);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -78,19 +89,19 @@ public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
public ClientHttpRequestFactorySettings withReadTimeout(Duration readTimeout) {
|
|
|
|
public ClientHttpRequestFactorySettings withReadTimeout(Duration readTimeout) {
|
|
|
|
return new ClientHttpRequestFactorySettings(this.connectTimeout, readTimeout, this.bufferRequestBody,
|
|
|
|
return new ClientHttpRequestFactorySettings(this.connectTimeout, readTimeout, this.sslBundle);
|
|
|
|
this.sslBundle);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return a new {@link ClientHttpRequestFactorySettings} instance with an updated
|
|
|
|
* Has no effect as support for buffering has been removed in Spring Framework 6.1.
|
|
|
|
* buffer request body setting.
|
|
|
|
|
|
|
|
* @param bufferRequestBody the new buffer request body setting
|
|
|
|
* @param bufferRequestBody the new buffer request body setting
|
|
|
|
* @return a new {@link ClientHttpRequestFactorySettings} instance
|
|
|
|
* @return a new {@link ClientHttpRequestFactorySettings} instance
|
|
|
|
|
|
|
|
* @deprecated since 3.2.0 for removal in 3.4.0 as support for buffering has been
|
|
|
|
|
|
|
|
* removed in Spring Framework 6.1
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Deprecated(since = "3.2.0", forRemoval = true)
|
|
|
|
public ClientHttpRequestFactorySettings withBufferRequestBody(Boolean bufferRequestBody) {
|
|
|
|
public ClientHttpRequestFactorySettings withBufferRequestBody(Boolean bufferRequestBody) {
|
|
|
|
return new ClientHttpRequestFactorySettings(this.connectTimeout, this.readTimeout, bufferRequestBody,
|
|
|
|
return this;
|
|
|
|
this.sslBundle);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -101,8 +112,18 @@ public record ClientHttpRequestFactorySettings(Duration connectTimeout, Duration
|
|
|
|
* @since 3.1.0
|
|
|
|
* @since 3.1.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public ClientHttpRequestFactorySettings withSslBundle(SslBundle sslBundle) {
|
|
|
|
public ClientHttpRequestFactorySettings withSslBundle(SslBundle sslBundle) {
|
|
|
|
return new ClientHttpRequestFactorySettings(this.connectTimeout, this.readTimeout, this.bufferRequestBody,
|
|
|
|
return new ClientHttpRequestFactorySettings(this.connectTimeout, this.readTimeout, sslBundle);
|
|
|
|
sslBundle);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Returns whether request body buffering is used.
|
|
|
|
|
|
|
|
* @return whether request body buffering is used
|
|
|
|
|
|
|
|
* @deprecated since 3.2.0 for removal in 3.4.0 as support for buffering has been
|
|
|
|
|
|
|
|
* removed in Spring Framework 6.1
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Deprecated(since = "3.2.0", forRemoval = true)
|
|
|
|
|
|
|
|
public Boolean bufferRequestBody() {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|