Package ai.preferred.venom.fetcher
Class AsyncResponseConsumer
- java.lang.Object
-
- org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
-
- ai.preferred.venom.fetcher.AsyncResponseConsumer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.http.concurrent.Cancellable,org.apache.http.nio.protocol.HttpAsyncResponseConsumer<Response>
public class AsyncResponseConsumer extends org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
On top of the abstract class, this class handles the parsing of a response from the web service.- Author:
- Ween Jiann Lee
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BaseResponsebuildResult(org.apache.http.protocol.HttpContext context)protected org.apache.http.entity.ContentTypegetContentType(org.apache.http.HttpEntity entity)protected voidonContentReceived(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl)protected voidonEntityEnclosed(org.apache.http.HttpEntity entity, org.apache.http.entity.ContentType contentType)protected voidonResponseReceived(org.apache.http.HttpResponse httpResponse)protected voidreleaseResources()
-
-
-
Method Detail
-
getContentType
protected final org.apache.http.entity.ContentType getContentType(org.apache.http.HttpEntity entity)
- Overrides:
getContentTypein classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
-
onResponseReceived
protected final void onResponseReceived(org.apache.http.HttpResponse httpResponse)
- Specified by:
onResponseReceivedin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
-
onContentReceived
protected final void onContentReceived(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl) throws java.io.IOException- Specified by:
onContentReceivedin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>- Throws:
java.io.IOException
-
onEntityEnclosed
protected final void onEntityEnclosed(org.apache.http.HttpEntity entity, org.apache.http.entity.ContentType contentType) throws java.io.IOException- Specified by:
onEntityEnclosedin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>- Throws:
java.io.IOException
-
buildResult
protected final BaseResponse buildResult(org.apache.http.protocol.HttpContext context) throws java.lang.Exception
- Specified by:
buildResultin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>- Throws:
java.lang.Exception
-
releaseResources
protected final void releaseResources()
- Specified by:
releaseResourcesin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
-
-