You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/03/14 21:17:05 UTC

[httpcomponents-client] 02/03: Better javadocs for simple message classes

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit e0c19c0b539b332ee3fe73e871463c6e19f9e16f
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Mar 14 20:37:08 2021 +0100

    Better javadocs for simple message classes
---
 .../apache/hc/client5/http/async/methods/SimpleHttpRequest.java   | 7 +++++++
 .../apache/hc/client5/http/async/methods/SimpleHttpResponse.java  | 7 +++++++
 .../hc/client5/http/async/methods/SimpleRequestProducer.java      | 8 ++++++++
 .../hc/client5/http/async/methods/SimpleResponseConsumer.java     | 8 ++++++++
 4 files changed, 30 insertions(+)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpRequest.java b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpRequest.java
index 7ce1cc6..61d3a9f 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpRequest.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpRequest.java
@@ -40,10 +40,17 @@ import org.apache.hc.core5.util.Args;
 
 /**
  * HTTP request that can enclose a body represented as a simple text string or an array of bytes.
+ * <p>
+ * IMPORTANT: {@link SimpleHttpRequest}s are intended for simple scenarios where entities inclosed
+ * in requests are known to be small. It is generally recommended to use
+ * {@link org.apache.hc.core5.http.nio.support.AsyncRequestBuilder} and streaming
+ * {@link org.apache.hc.core5.http.nio.AsyncEntityProducer}s.
  *
  * @since 5.0
  *
  * @see SimpleBody
+ * @see org.apache.hc.core5.http.nio.support.AsyncRequestBuilder
+ * @see org.apache.hc.core5.http.nio.AsyncEntityProducer
  */
 public final class SimpleHttpRequest extends ConfigurableHttpRequest {
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpResponse.java b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpResponse.java
index bad41df..78416a9 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpResponse.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleHttpResponse.java
@@ -37,10 +37,17 @@ import org.apache.hc.core5.util.Args;
 
 /**
  * HTTP response that can enclose a body represented as a simple text string or an array of bytes.
+ * <p>
+ * IMPORTANT: {@link SimpleHttpResponse}s are intended for simple scenarios where entities inclosed
+ * in responses are known to be small. It is generally recommended to use streaming
+ * {@link org.apache.hc.core5.http.nio.AsyncResponseConsumer}s, for instance, such as based on
+ * {@link AbstractCharResponseConsumer} or {@link AbstractBinResponseConsumer}.
  *
  * @since 5.0
  *
  * @see SimpleBody
+ * @see AbstractCharResponseConsumer
+ * @see AbstractBinResponseConsumer
  */
 public final class SimpleHttpResponse extends BasicHttpResponse {
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleRequestProducer.java b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleRequestProducer.java
index d6e78a5..b084e8b 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleRequestProducer.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleRequestProducer.java
@@ -35,10 +35,18 @@ import org.apache.hc.core5.util.Args;
 /**
  * HTTP request producer that generates message data stream events based
  * on content of a {@link SimpleHttpRequest} instance.
+ * <p>
+ * IMPORTANT: {@link SimpleHttpRequest}s are intended for simple scenarios where entities inclosed
+ * in requests are known to be small. It is generally recommended to use
+ * {@link org.apache.hc.core5.http.nio.support.AsyncRequestBuilder} and streaming
+ * {@link org.apache.hc.core5.http.nio.AsyncEntityProducer}s.
  *
  * @since 5.0
  *
  * @see SimpleBody
+ * @see SimpleHttpRequest
+ * @see org.apache.hc.core5.http.nio.support.AsyncRequestBuilder
+ * @see org.apache.hc.core5.http.nio.AsyncEntityProducer
  */
 public final class SimpleRequestProducer extends BasicRequestProducer {
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleResponseConsumer.java b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleResponseConsumer.java
index 75b73fb..7f9dda6 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleResponseConsumer.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleResponseConsumer.java
@@ -38,10 +38,18 @@ import org.apache.hc.core5.http.protocol.HttpContext;
 /**
  * HTTP response consumer that generates a {@link SimpleHttpResponse} instance based on events
  * of an incoming data stream.
+ * <p>
+ * IMPORTANT: {@link SimpleHttpResponse}s are intended for simple scenarios where entities inclosed
+ * in responses are known to be small. It is generally recommended to use streaming
+ * {@link org.apache.hc.core5.http.nio.AsyncResponseConsumer}s, for instance, such as based on
+ * {@link AbstractCharResponseConsumer} or {@link AbstractBinResponseConsumer}.
  *
  * @since 5.0
  *
  * @see SimpleBody
+ * @see SimpleHttpResponse
+ * @see AbstractCharResponseConsumer
+ * @see AbstractBinResponseConsumer
  */
 public final class SimpleResponseConsumer extends AbstractAsyncResponseConsumer<SimpleHttpResponse, byte[]> {