public abstract class

RequestFinishedInfo

extends Object
java.lang.Object
   ↳ org.chromium.net.RequestFinishedInfo

Class Overview

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

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

Summary

Nested Classes
class RequestFinishedInfo.Listener Listens for finished requests for the purpose of collecting metrics. 
Constants
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 Constructors
RequestFinishedInfo()
Public Methods
abstract Collection<Object> getAnnotations()
Returns the objects that the caller has supplied when initiating the request, using addRequestAnnotation(Object).
abstract CronetException getException()
If the request failed, returns the same CronetException provided to onFailed(UrlRequest, UrlResponseInfo, 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.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int CANCELED

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

Constant Value: 2 (0x00000002)

public static final int FAILED

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

Constant Value: 1 (0x00000001)

public static final int SUCCEEDED

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

Constant Value: 0 (0x00000000)

Public Constructors

public RequestFinishedInfo ()

Public Methods

public abstract Collection<Object> getAnnotations ()

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

Returns
Collection<Object> annotations supplied when creating the request

public abstract CronetException getException ()

If the request failed, returns the same CronetException provided to onFailed(UrlRequest, UrlResponseInfo, CronetException).

Returns
CronetException the request's CronetException, if the request failed

public abstract int getFinishedReason ()

Returns the reason why the request finished.

Returns
int one of SUCCEEDED, FAILED, or CANCELED

public abstract UrlResponseInfo getResponseInfo ()

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

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

public abstract String getUrl ()

Returns the request's original URL.

Returns
String the request's original URL