Top Fields Constructors Methods
org.eclipse.jetty.reactive.client.internal

public Class ResponseEventPublisher

extends AbstractEventPublisher<ReactiveResponse.Event>
implements Listener
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.client.Response.Listener, org.eclipse.jetty.client.Response.CompleteListener, org.eclipse.jetty.client.Response.ResponseListener, java.util.EventListener, org.eclipse.jetty.client.Response.FailureListener, org.eclipse.jetty.client.Response.SuccessListener, org.eclipse.jetty.client.Response.ContentListener, org.eclipse.jetty.client.Response.AsyncContentListener, org.eclipse.jetty.client.Response.ContentSourceListener, org.eclipse.jetty.client.Response.HeadersListener, org.eclipse.jetty.client.Response.HeaderListener, org.eclipse.jetty.client.Response.BeginListener
Imports
java.nio.ByteBuffer, org.eclipse.jetty.client.Response, .Result, org.eclipse.jetty.http.HttpField, org.eclipse.jetty.io.Content, org.eclipse.jetty.reactive.client.ReactiveRequest, .ReactiveResponse

Field Summary

Modifier and TypeField and Description
private final ReactiveRequest

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
onBegin(Response
the response containing the response line data
response
)

Overrides default org.eclipse.jetty.client.Response.Listener.onBegin.

Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.
public void
onComplete(Result
the result of the request / response exchange
result
)

Overrides default org.eclipse.jetty.client.Response.Listener.onComplete.

Callback method invoked when the request and the response have been processed, either successfully or not.
public void
onContent(Response
the response containing the response line data and the headers
response
,
ByteBuffer
the content bytes received
content
)

Overrides default org.eclipse.jetty.client.Response.Listener.onContent.

Callback method invoked when the response content has been received, parsed and there is demand.
public void
public void
onContentSource(Response
the response containing the response line data and the headers
response
,
Content.Source
the Content.Source that must be driven to read the data
source
)

Overrides default org.eclipse.jetty.client.Response.AsyncContentListener.onContentSource.

Callback method invoked when all the response headers have been received and parsed.
public void
onFailure(Response
the response containing data up to the point the failure happened
response
,
Throwable
the failure happened
failure
)

Overrides default org.eclipse.jetty.client.Response.Listener.onFailure.

Callback method invoked when the response has failed in the process of being received
public boolean
onHeader(Response
the response containing the response line data and the headers so far
response
,
HttpField
the header received
field
)

Overrides default org.eclipse.jetty.client.Response.Listener.onHeader.

Callback method invoked when a response header has been received and parsed, returning whether the header should be processed or not.
public void
onHeaders(Response
the response containing the response line data and the headers
response
)

Overrides default org.eclipse.jetty.client.Response.Listener.onHeaders.

Callback method invoked when all the response headers have been received and parsed.
public void
onSuccess(Response
the response containing the response line data and the headers
response
)

Overrides default org.eclipse.jetty.client.Response.Listener.onSuccess.

Callback method invoked when the whole response has been successfully received.
Inherited from org.eclipse.jetty.reactive.client.internal.AbstractEventPublisher:
emitfailonRequestsucceed

Field Detail

requestback to summary
private final ReactiveRequest request

Constructor Detail

ResponseEventPublisherback to summary
public ResponseEventPublisher(ReactiveRequest request)

Method Detail

onBeginback to summary
public void onBegin(Response response)

Overrides default org.eclipse.jetty.client.Response.Listener.onBegin.

Doc from org.eclipse.jetty.client.Response.BeginListener.onBegin.

Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.

This method is the best approximation to detect when the first bytes of the response arrived to the client.

Parameters
response:Response

the response containing the response line data

Annotations
@Override
onCompleteback to summary
public void onComplete(Result result)

Overrides default org.eclipse.jetty.client.Response.Listener.onComplete.

Doc from org.eclipse.jetty.client.Response.CompleteListener.onComplete.

Callback method invoked when the request and the response have been processed, either successfully or not.

The result parameter contains the request, the response, and eventual failures.

Requests may complete after response, for example in case of big uploads that are discarded or read asynchronously by the server. This method is always invoked after SuccessListener#onSuccess(Response) or FailureListener#onFailure(Response, Throwable), and only when request indicates that it is completed.

Parameters
result:Result

the result of the request / response exchange

Annotations
@Override
onContentback to summary
public void onContent(Response response, ByteBuffer content)

Overrides default org.eclipse.jetty.client.Response.Listener.onContent.

Doc from org.eclipse.jetty.client.Response.ContentListener.onContent.

Callback method invoked when the response content has been received, parsed and there is demand. This method may be invoked multiple times, and the content buffer must be consumed (or copied) before returning from this method.

Parameters
response:Response

the response containing the response line data and the headers

content:ByteBuffer

the content bytes received

Annotations
@Override
onContentback to summary
public void onContent(Response response, Content.Chunk chunk, Runnable demander)

Overrides default org.eclipse.jetty.client.Response.ContentListener.onContent.

Annotations
@Override
onContentSourceback to summary
public void onContentSource(Response response, Content.Source source)

Overrides default org.eclipse.jetty.client.Response.AsyncContentListener.onContentSource.

Doc from org.eclipse.jetty.client.Response.ContentSourceListener.onContentSource.

Callback method invoked when all the response headers have been received and parsed. It is responsible for driving the contentSource instance with a read/demand loop. Note that this is not invoked for interim statuses.

Parameters
response:Response

the response containing the response line data and the headers

source:Content.Source

the Content.Source that must be driven to read the data

Annotations
@Override
onFailureback to summary
public void onFailure(Response response, Throwable failure)

Overrides default org.eclipse.jetty.client.Response.Listener.onFailure.

Doc from org.eclipse.jetty.client.Response.FailureListener.onFailure.

Callback method invoked when the response has failed in the process of being received

Parameters
response:Response

the response containing data up to the point the failure happened

failure:Throwable

the failure happened

Annotations
@Override
onHeaderback to summary
public boolean onHeader(Response response, HttpField field)

Overrides default org.eclipse.jetty.client.Response.Listener.onHeader.

Doc from org.eclipse.jetty.client.Response.HeaderListener.onHeader.

Callback method invoked when a response header has been received and parsed, returning whether the header should be processed or not.

Parameters
response:Response

the response containing the response line data and the headers so far

field:HttpField

the header received

Returns:boolean

true to process the header, false to skip processing of the header

Annotations
@Override
onHeadersback to summary
public void onHeaders(Response response)

Overrides default org.eclipse.jetty.client.Response.Listener.onHeaders.

Doc from org.eclipse.jetty.client.Response.HeadersListener.onHeaders.

Callback method invoked when all the response headers have been received and parsed.

Parameters
response:Response

the response containing the response line data and the headers

Annotations
@Override
onSuccessback to summary
public void onSuccess(Response response)

Overrides default org.eclipse.jetty.client.Response.Listener.onSuccess.

Doc from org.eclipse.jetty.client.Response.SuccessListener.onSuccess.

Callback method invoked when the whole response has been successfully received.

Parameters
response:Response

the response containing the response line data and the headers

Annotations
@Override