public static interface HttpLifecycleObserver.HttpExchangeObserver
An exchange is represented by a request and a response.
Both can be observed independently and may publish their events concurrently because connections are full-duplex.
The terminal event for the exchange is signaled only when nested observers signal
terminal events. Cancellation is the best effort, more events may be signaled after cancel.
| Modifier and Type | Method and Description |
|---|---|
default void |
onConnectionSelected(ConnectionInfo info)
Callback when a connection is selected for this exchange execution.
|
default void |
onExchangeFinally()
Callback when the exchange completes.
|
default HttpLifecycleObserver.HttpRequestObserver |
onRequest(HttpRequestMetaData requestMetaData)
Callback when a request starts.
|
default HttpLifecycleObserver.HttpResponseObserver |
onResponse(HttpResponseMetaData responseMetaData)
Callback when a response meta-data was observed.
|
default void |
onResponseCancel()
Callback if the response meta-data was cancelled.
|
default void |
onResponseError(Throwable cause)
Callback if the response meta-data was not received due to an error.
|
default void onConnectionSelected(ConnectionInfo info)
This callback may be invoked for every retry attempt.
info - ConnectionInfo of the selected connectiondefault HttpLifecycleObserver.HttpRequestObserver onRequest(HttpRequestMetaData requestMetaData)
requestMetaData - The corresponding HttpRequestMetaDataHttpLifecycleObserver.HttpRequestObserver that provides visibility into request eventsdefault HttpLifecycleObserver.HttpResponseObserver onResponse(HttpResponseMetaData responseMetaData)
responseMetaData - the corresponding HttpResponseMetaDataHttpLifecycleObserver.HttpResponseObserver that provides visibility into response eventsdefault void onResponseError(Throwable cause)
cause - the cause of a response meta-data failuredefault void onResponseCancel()
Cancellation is the best effort, more events may be signaled after cancel.
default void onExchangeFinally()
This is the final callback that is invoked after HttpLifecycleObserver.HttpRequestObserver terminate and either
HttpLifecycleObserver.HttpResponseObserver terminate or onResponseError(Throwable)/onResponseCancel()
method is invoked.