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

public abstract Class AbstractCharResponseConsumer<T>

extends AbstractCharDataConsumer
implements AsyncResponseConsumer<T>
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.AsyncResponseConsumer, org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.ResourceHolder
Type Parameters
<T>
response message representation.
Imports
java.io.IOException, .UnsupportedEncodingException, java.nio.charset.Charset, .StandardCharsets, .UnsupportedCharsetException, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.http.ContentType, .EntityDetails, .HttpException, .HttpResponse, org.apache.hc.core5.http.config.CharCodingConfig, org.apache.hc.core5.http.nio.AsyncResponseConsumer, org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer, org.apache.hc.core5.http.protocol.HttpContext

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

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
protected abstract T

Returns:

the result of response processing.
buildResult
()

Triggered to generate object that represents a result of response message processing.

protected final void
completed()

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.completed.

Triggered to signal completion of data processing.
public final void
consumeResponse(final HttpResponse
the response message head.
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
,
final FutureCallback<T>
the result callback called when response processing has been completed successfully or unsuccessfully.
resultCallback
)

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.consumeResponse.

Triggered to signal receipt of a response message head.
public void
failed(final Exception
the cause of the failure.
cause
)

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

Triggered to signal a failure in data processing.
public void
informationResponse(final HttpResponse
the intermediate (1xx) HTTP response.
response
,
final HttpContext
the actual execution context.
context
)

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Triggered to signal receipt of an intermediate (1xx) HTTP response.
protected abstract void
start(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:
capacityIncrementconsumedatasetCharsetstreamEndupdateCapacity

Field Detail

defaultCharsetback to summary
private final Charset defaultCharset
resultCallbackback to summary
private volatile FutureCallback<T> resultCallback

Constructor Detail

AbstractCharResponseConsumerback to summary
public AbstractCharResponseConsumer()
AbstractCharResponseConsumerback to summary
protected AbstractCharResponseConsumer(final int bufSize, final CharCodingConfig charCodingConfig)

Method Detail

buildResultback to summary
protected abstract T buildResult() throws IOException

Triggered to generate object that represents a result of response message processing.

Returns:T

the result of response processing.

completedback to summary
protected final void completed() throws IOException

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.completed.

Doc from org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.completed.

Triggered to signal completion of data processing.

Annotations
@Override
consumeResponseback to summary
public final void consumeResponse(final HttpResponse response, final EntityDetails entityDetails, final HttpContext context, final FutureCallback<T> resultCallback) throws HttpException, IOException

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.consumeResponse.

Doc from org.apache.hc.core5.http.nio.AsyncResponseConsumer.consumeResponse.

Triggered to signal receipt of a response message head.

Parameters
response:HttpResponse

the response message head.

entityDetails:EntityDetails

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

context:HttpContext

the actual execution context.

resultCallback:FutureCallback<T>

the result callback called when response processing has been completed successfully or unsuccessfully.

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

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

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

Triggered to signal a failure in data processing.

Parameters
cause:Exception

the cause of the failure.

Annotations
@Override
informationResponseback to summary
public void informationResponse(final HttpResponse response, final HttpContext context) throws HttpException, IOException

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Doc from org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Triggered to signal receipt of an intermediate (1xx) HTTP response.

Parameters
response:HttpResponse

the intermediate (1xx) HTTP response.

context:HttpContext

the actual execution context.

Annotations
@Override
startback to summary
protected abstract void start(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.