T
- response message representation.public abstract class AbstractBinResponseConsumer<T> extends AbstractBinDataConsumer implements AsyncResponseConsumer<T>
Constructor and Description |
---|
AbstractBinResponseConsumer() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
buildResult()
Triggered to generate object that represents a result of response message processing.
|
protected void |
completed()
Triggered to signal completion of data processing.
|
void |
consumeResponse(HttpResponse response,
EntityDetails entityDetails,
HttpContext context,
FutureCallback<T> resultCallback)
Triggered to signal receipt of a response message head.
|
void |
failed(Exception cause)
Triggered to signal a failure in data processing.
|
void |
informationResponse(HttpResponse response,
HttpContext context)
Triggered to signal receipt of an intermediate (1xx) HTTP response.
|
protected abstract void |
start(HttpResponse response,
ContentType contentType)
Triggered to signal the beginning of response processing.
|
capacityIncrement, consume, data, streamEnd, updateCapacity
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
consume, streamEnd, updateCapacity
releaseResources
protected abstract T buildResult()
protected final void completed()
AbstractBinDataConsumer
completed
in class AbstractBinDataConsumer
public final void consumeResponse(HttpResponse response, EntityDetails entityDetails, HttpContext context, FutureCallback<T> resultCallback) throws HttpException, IOException
AsyncResponseConsumer
consumeResponse
in interface AsyncResponseConsumer<T>
response
- the response message head.entityDetails
- the response entity details or null
if the response
does not enclose an entity.context
- the actual execution context.resultCallback
- the result callback called when response processing
has been completed successfully or unsuccessfully.HttpException
IOException
public void failed(Exception cause)
AsyncResponseConsumer
failed
in interface AsyncResponseConsumer<T>
cause
- the cause of the failure.public void informationResponse(HttpResponse response, HttpContext context) throws HttpException, IOException
AsyncResponseConsumer
informationResponse
in interface AsyncResponseConsumer<T>
response
- the intermediate (1xx) HTTP response.context
- the actual execution context.HttpException
IOException
protected abstract void start(HttpResponse response, ContentType contentType) throws HttpException, IOException
response
- the response message headcontentType
- the content type of the response body,
or null
if the response does not enclose a response entity.HttpException
IOException