Class JettyAsyncResponseListener

  • All Implemented Interfaces:
    io.fabric8.kubernetes.client.http.AsyncBody, EventListener, org.eclipse.jetty.client.api.Response.AsyncContentListener, org.eclipse.jetty.client.api.Response.BeginListener, org.eclipse.jetty.client.api.Response.CompleteListener, org.eclipse.jetty.client.api.Response.ContentListener, org.eclipse.jetty.client.api.Response.DemandedContentListener, org.eclipse.jetty.client.api.Response.FailureListener, org.eclipse.jetty.client.api.Response.HeaderListener, org.eclipse.jetty.client.api.Response.HeadersListener, org.eclipse.jetty.client.api.Response.Listener, org.eclipse.jetty.client.api.Response.ResponseListener, org.eclipse.jetty.client.api.Response.SuccessListener

    public abstract class JettyAsyncResponseListener
    extends org.eclipse.jetty.client.api.Response.Listener.Adapter
    implements io.fabric8.kubernetes.client.http.AsyncBody
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.fabric8.kubernetes.client.http.AsyncBody

        io.fabric8.kubernetes.client.http.AsyncBody.Consumer<T extends Object>
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Response.Listener

        org.eclipse.jetty.client.api.Response.Listener.Adapter
    • Method Detail

      • consume

        public void consume()
        Specified by:
        consume in interface io.fabric8.kubernetes.client.http.AsyncBody
      • done

        public CompletableFuture<Void> done()
        Specified by:
        done in interface io.fabric8.kubernetes.client.http.AsyncBody
      • cancel

        public void cancel()
        Specified by:
        cancel in interface io.fabric8.kubernetes.client.http.AsyncBody
      • onHeaders

        public void onHeaders​(org.eclipse.jetty.client.api.Response response)
        Specified by:
        onHeaders in interface org.eclipse.jetty.client.api.Response.HeadersListener
        Specified by:
        onHeaders in interface org.eclipse.jetty.client.api.Response.Listener
      • onComplete

        public void onComplete​(org.eclipse.jetty.client.api.Result result)
        Specified by:
        onComplete in interface org.eclipse.jetty.client.api.Response.CompleteListener
        Specified by:
        onComplete in interface org.eclipse.jetty.client.api.Response.Listener
      • listen

        public CompletableFuture<io.fabric8.kubernetes.client.http.HttpResponse<io.fabric8.kubernetes.client.http.AsyncBody>> listen​(org.eclipse.jetty.client.api.Request request)
      • onBeforeContent

        public void onBeforeContent​(org.eclipse.jetty.client.api.Response response,
                                    LongConsumer demand)
        Specified by:
        onBeforeContent in interface org.eclipse.jetty.client.api.Response.DemandedContentListener
      • onContent

        public void onContent​(org.eclipse.jetty.client.api.Response response,
                              ByteBuffer content,
                              org.eclipse.jetty.util.Callback callback)
        Specified by:
        onContent in interface org.eclipse.jetty.client.api.Response.AsyncContentListener
        Specified by:
        onContent in interface org.eclipse.jetty.client.api.Response.ContentListener
      • onContent

        protected abstract void onContent​(ByteBuffer content)
                                   throws Exception
        Implement to consume the content of the chunked response.

        Each chunk will be passed in order to this function (onContent{callback.succeeded})

        Parameters:
        content - the ByteBuffer containing a chunk of the response.
        Throws:
        Exception - in case the downstream consumer throws an exception.