Package org.eclipse.jetty.client.api
Interface Response.DemandedContentListener
- All Superinterfaces:
EventListener
,Response.ResponseListener
- All Known Subinterfaces:
Response.AsyncContentListener
,Response.ContentListener
,Response.Listener
- All Known Implementing Classes:
AsyncMiddleManServlet.ProxyResponseListener
,BufferingResponseListener
,ContinueProtocolHandler.ContinueListener
,FutureResponseListener
,InputStreamResponseListener
,ProxyServlet.ProxyResponseListener
,RedirectProtocolHandler
,Response.Listener.Adapter
- Enclosing interface:
- Response
Asynchronous listener for the response content events.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onBeforeContent
(Response response, LongConsumer demand) Callback method invoked before response content events.void
onContent
(Response response, LongConsumer demand, ByteBuffer content, Callback callback) Callback method invoked when the response content has been received.
-
Method Details
-
onBeforeContent
Callback method invoked before response content events. Thedemand
object should be used to demand content, otherwise the demand remains at zero (no demand) andonContent(Response, LongConsumer, ByteBuffer, Callback)
will not be invoked even if content has been received and parsed.- Parameters:
response
- the response containing the response line data and the headersdemand
- the object that allows to demand content buffers
-
onContent
Callback method invoked when the response content has been received. Thecallback
object should be succeeded to signal that thecontent
buffer has been consumed. Thedemand
object should be used to demand more content, similarly toFlow.Subscription.request(long)
.- Parameters:
response
- the response containing the response line data and the headersdemand
- the object that allows to demand content bufferscontent
- the content bytes receivedcallback
- the callback to call when the content is consumed
-