org.apache.hc.client5.http.async.methods

## Class AbstractCharPushConsumer

- java.lang.Object
- - org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
  - - org.apache.hc.client5.http.async.methods.AbstractCharPushConsumer

- All Implemented Interfaces:
    AsyncDataConsumer, AsyncPushConsumer, ResourceHolder

      public abstract class AbstractCharPushConsumer
      extends AbstractCharDataConsumer
      implements AsyncPushConsumer

  Abstract push response consumer that processes response body data as a character stream.
  Since:
    5.0

- - ### Field Summary

    - ### Fields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer

      `DEF_BUF_SIZE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `AbstractCharPushConsumer()`
    `protected` | `AbstractCharPushConsumer(int bufSize, CharCodingConfig charCodingConfig)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `consumePromise(HttpRequest promise, HttpResponse response, EntityDetails entityDetails, HttpContext context)`
    `void` | `failed(Exception cause)`
    `protected abstract void` | `start(HttpRequest promise, HttpResponse response, ContentType contentType)` Triggered to signal the beginning of data processing.

    - ### Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer

      `capacityIncrement, completed, consume, data, setCharset, streamEnd, updateCapacity`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer

      `consume, streamEnd, updateCapacity`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.ResourceHolder

      `releaseResources`

- - ### Constructor Detail

    - #### AbstractCharPushConsumer

          public AbstractCharPushConsumer()

    - #### AbstractCharPushConsumer

          protected AbstractCharPushConsumer(int bufSize,
                                             CharCodingConfig charCodingConfig)

  - ### Method Detail

    - #### start

          protected abstract void start(HttpRequest promise,
                                        HttpResponse response,
                                        ContentType contentType)
                                 throws HttpException,
                                        IOException

      Triggered to signal the beginning of data processing.
      Parameters:
        `response` - the response message head
        `contentType` - the content type of the response body, or `null` if the response does not enclose a response entity.
      Throws:
        `HttpException`
        `IOException`

    - #### consumePromise

          public final void consumePromise(HttpRequest promise,
                                           HttpResponse response,
                                           EntityDetails entityDetails,
                                           HttpContext context)
                                    throws HttpException,
                                           IOException

      Specified by:
        `consumePromise` in interface `AsyncPushConsumer`
      Throws:
        `HttpException`
        `IOException`

    - #### failed

          public void failed(Exception cause)

      Specified by:
        `failed` in interface `AsyncPushConsumer`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.