Class AbstractCharResponseConsumer<T>
java.lang.Object
org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
org.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<T>
- Type Parameters:
T
- response message representation.
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer
,org.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
,org.apache.hc.core5.http.nio.ResourceHolder
public abstract class AbstractCharResponseConsumer<T>
extends org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
implements org.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
Abstract response consumer that processes response body data as a character stream.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Charset
private org.apache.hc.core5.concurrent.FutureCallback
<T> Fields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
DEF_BUF_SIZE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCharResponseConsumer
(int bufSize, org.apache.hc.core5.http.config.CharCodingConfig charCodingConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
Triggered to generate object that represents a result of response message processing.protected final void
final void
consumeResponse
(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> resultCallback) void
void
informationResponse
(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) protected abstract void
start
(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.ContentType contentType) Triggered to signal the beginning of data processing.Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
capacityIncrement, 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
-
Field Details
-
resultCallback
-
defaultCharset
-
-
Constructor Details
-
AbstractCharResponseConsumer
public AbstractCharResponseConsumer() -
AbstractCharResponseConsumer
protected AbstractCharResponseConsumer(int bufSize, org.apache.hc.core5.http.config.CharCodingConfig charCodingConfig)
-
-
Method Details
-
start
protected abstract void start(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.ContentType contentType) throws org.apache.hc.core5.http.HttpException, IOException Triggered to signal the beginning of data processing.- Parameters:
response
- the response message headcontentType
- the content type of the response body, ornull
if the response does not enclose a response entity.- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
buildResult
Triggered to generate object that represents a result of response message processing.- Returns:
- the result of response processing.
- Throws:
IOException
-
informationResponse
public void informationResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
informationResponse
in interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
consumeResponse
public final void consumeResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> resultCallback) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
consumeResponse
in interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
completed
- Specified by:
completed
in classorg.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
- Throws:
IOException
-
failed
- Specified by:
failed
in interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
-