Class JettyAsyncResponseListener
- java.lang.Object
-
- org.eclipse.jetty.client.api.Response.Listener.Adapter
-
- io.fabric8.kubernetes.client.jetty.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>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancel()voidconsume()CompletableFuture<Void>done()CompletableFuture<io.fabric8.kubernetes.client.http.HttpResponse<io.fabric8.kubernetes.client.http.AsyncBody>>listen(org.eclipse.jetty.client.api.Request request)voidonBeforeContent(org.eclipse.jetty.client.api.Response response, LongConsumer demand)voidonComplete(org.eclipse.jetty.client.api.Result result)protected abstract voidonContent(ByteBuffer content)Implement to consume the content of the chunked response.voidonContent(org.eclipse.jetty.client.api.Response response, ByteBuffer content, org.eclipse.jetty.util.Callback callback)voidonHeaders(org.eclipse.jetty.client.api.Response response)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
consume
public void consume()
- Specified by:
consumein interfaceio.fabric8.kubernetes.client.http.AsyncBody
-
done
public CompletableFuture<Void> done()
- Specified by:
donein interfaceio.fabric8.kubernetes.client.http.AsyncBody
-
cancel
public void cancel()
- Specified by:
cancelin interfaceio.fabric8.kubernetes.client.http.AsyncBody
-
onHeaders
public void onHeaders(org.eclipse.jetty.client.api.Response response)
- Specified by:
onHeadersin interfaceorg.eclipse.jetty.client.api.Response.HeadersListener- Specified by:
onHeadersin interfaceorg.eclipse.jetty.client.api.Response.Listener
-
onComplete
public void onComplete(org.eclipse.jetty.client.api.Result result)
- Specified by:
onCompletein interfaceorg.eclipse.jetty.client.api.Response.CompleteListener- Specified by:
onCompletein interfaceorg.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:
onBeforeContentin interfaceorg.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:
onContentin interfaceorg.eclipse.jetty.client.api.Response.AsyncContentListener- Specified by:
onContentin interfaceorg.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.
-
-