RequestFinishedInfo

public abstract class RequestFinishedInfo extends Object

Information about a finished request. Passed to RequestFinishedInfo.Listener.

To associate the data with the original request, use UrlRequest.Builder.addRequestAnnotation(Object) to add a unique identifier when creating the request, and call getAnnotations() when the RequestFinishedInfo is received to retrieve the identifier.

Nested Class Summary

class RequestFinishedInfo.Listener Listens for finished requests for the purpose of collecting metrics. 

Constant Summary

int CANCELED Reason value indicating that the request was canceled.
int FAILED Reason value indicating that the request failed or returned an error.
int SUCCEEDED Reason value indicating that the request succeeded.

Public Constructor Summary

Public Method Summary

abstract Collection<Object>
getAnnotations()
Returns the objects that the caller has supplied when initiating the request, using UrlRequest.Builder.addRequestAnnotation(Object).
abstract CronetException
abstract int
getFinishedReason()
Returns the reason why the request finished.
abstract UrlResponseInfo
getResponseInfo()
Returns a UrlResponseInfo for the request, if its response had started.
abstract String
getUrl()
Returns the request's original URL.

Inherited Method Summary

Constants

public static final int CANCELED

Reason value indicating that the request was canceled. Returned from getFinishedReason().

Constant Value: 2

public static final int FAILED

Reason value indicating that the request failed or returned an error. Returned from getFinishedReason().

Constant Value: 1

public static final int SUCCEEDED

Reason value indicating that the request succeeded. Returned from getFinishedReason().

Constant Value: 0

Public Constructors

public RequestFinishedInfo ()

Public Methods

public abstract Collection<Object> getAnnotations ()

Returns the objects that the caller has supplied when initiating the request, using UrlRequest.Builder.addRequestAnnotation(Object). Annotations can be used to associate a RequestFinishedInfo with the original request or type of request.

Returns
  • annotations supplied when creating the request

public abstract CronetException getException ()

Returns

public abstract int getFinishedReason ()

Returns the reason why the request finished.

Returns

public abstract UrlResponseInfo getResponseInfo ()

Returns a UrlResponseInfo for the request, if its response had started.

Returns

public abstract String getUrl ()

Returns the request's original URL.

Returns
  • the request's original URL