Class AsyncResponseConsumer

  • All Implemented Interfaces:
    Closeable, 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 Detail

      • getContentType

        protected final org.apache.http.entity.ContentType getContentType​(org.apache.http.HttpEntity entity)
        Overrides:
        getContentType in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
      • onResponseReceived

        protected final void onResponseReceived​(org.apache.http.HttpResponse httpResponse)
        Specified by:
        onResponseReceived in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
      • onContentReceived

        protected final void onContentReceived​(org.apache.http.nio.ContentDecoder decoder,
                                               org.apache.http.nio.IOControl ioctrl)
                                        throws IOException
        Specified by:
        onContentReceived in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
        Throws:
        IOException
      • onEntityEnclosed

        protected final void onEntityEnclosed​(org.apache.http.HttpEntity entity,
                                              org.apache.http.entity.ContentType contentType)
                                       throws IOException
        Specified by:
        onEntityEnclosed in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
        Throws:
        IOException
      • buildResult

        protected final BaseResponse buildResult​(org.apache.http.protocol.HttpContext context)
                                          throws Exception
        Specified by:
        buildResult in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>
        Throws:
        Exception
      • releaseResources

        protected final void releaseResources()
        Specified by:
        releaseResources in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<Response>