Top Description Fields Constructors Methods
org.apache.hc.client5.http.async.methods

public abstract Class AbstractCharPushConsumer

extends AbstractCharDataConsumer
implements AsyncPushConsumer
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.AsyncPushConsumer, org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.ResourceHolder
Imports
java.io.IOException, .UnsupportedEncodingException, java.nio.charset.Charset, .StandardCharsets, .UnsupportedCharsetException, org.apache.hc.core5.http.ContentType, .EntityDetails, .HttpException, .HttpRequest, .HttpResponse, org.apache.hc.core5.http.config.CharCodingConfig, org.apache.hc.core5.http.nio.AsyncPushConsumer, org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer, org.apache.hc.core5.http.protocol.HttpContext

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

Field Summary

Modifier and TypeField and Description
private final Charset
Inherited from org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer:
DEF_BUF_SIZE

Constructor Summary

AccessConstructor and Description
public
protected
AbstractCharPushConsumer(final int bufSize, final CharCodingConfig charCodingConfig)

Method Summary

Modifier and TypeMethod and Description
public final void
consumePromise(final HttpRequest
the request message head used as a promise.
promise
,
final HttpResponse
the pushed response message.
response
,
final EntityDetails
the response entity details or null if the response does not enclose an entity.
entityDetails
,
final HttpContext
the actual execution context.
context
)

Implements org.apache.hc.core5.http.nio.AsyncPushConsumer.consumePromise.

Triggered to signal receipt of a request message head used as a promise and the corresponding pushed response.
public void
failed(final Exception
the cause of the failure.
cause
)

Implements org.apache.hc.core5.http.nio.AsyncPushConsumer.failed.

Triggered to signal a failure in data processing.
protected abstract void
start(HttpRequest promise, HttpResponse
the response message head
response
,
ContentType
the content type of the response body, or null if the response does not enclose a response entity.
contentType
)

Triggered to signal the beginning of data processing.

Inherited from org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer:
capacityIncrementcompletedconsumedatasetCharsetstreamEndupdateCapacity

Field Detail

defaultCharsetback to summary
private final Charset defaultCharset

Constructor Detail

AbstractCharPushConsumerback to summary
public AbstractCharPushConsumer()
AbstractCharPushConsumerback to summary
protected AbstractCharPushConsumer(final int bufSize, final CharCodingConfig charCodingConfig)

Method Detail

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

Implements org.apache.hc.core5.http.nio.AsyncPushConsumer.consumePromise.

Doc from org.apache.hc.core5.http.nio.AsyncPushConsumer.consumePromise.

Triggered to signal receipt of a request message head used as a promise and the corresponding pushed response.

Parameters
promise:HttpRequest

the request message head used as a promise.

response:HttpResponse

the pushed response message.

entityDetails:EntityDetails

the response entity details or null if the response does not enclose an entity.

context:HttpContext

the actual execution context.

Annotations
@Override
failedback to summary
public void failed(final Exception cause)

Implements org.apache.hc.core5.http.nio.AsyncPushConsumer.failed.

Doc from org.apache.hc.core5.http.nio.AsyncPushConsumer.failed.

Triggered to signal a failure in data processing.

Parameters
cause:Exception

the cause of the failure.

Annotations
@Override
startback to summary
protected abstract void start(HttpRequest promise, HttpResponse response, ContentType contentType) throws HttpException, IOException

Triggered to signal the beginning of data processing.

Parameters
response:HttpResponse

the response message head

contentType:ContentType

the content type of the response body, or null if the response does not enclose a response entity.