public interface

CronetRequestCompletionListener

org.chromium.net.apihelpers.CronetRequestCompletionListener<T>

Class Overview

A completion listener for accepting the results of a Cronet request asynchronously.

To attach to a Cronet request use InMemoryTransformCronetCallback and call addCompletionListener(CronetRequestCompletionListener).

Summary

Public Methods
abstract void onCanceled(UrlResponseInfo info)
Invoked if request was canceled via UrlRequest#cancel.
abstract void onFailed(UrlResponseInfo info, CronetException exception)
Invoked if request failed for any reason after starting the request.
abstract void onSucceeded(UrlResponseInfo info, T body)
Invoked when request is completed successfully.

Public Methods

public abstract void onCanceled (UrlResponseInfo info)

Invoked if request was canceled via UrlRequest#cancel. Once invoked, no other methods will be invoked on this object.

Parameters
info UrlResponseInfo: Response information. May be null if no response was received.

public abstract void onFailed (UrlResponseInfo info, CronetException exception)

Invoked if request failed for any reason after starting the request. Once invoked, no other methods will be invoked on this object. exception provides information about the failure.

Parameters
info UrlResponseInfo: Response information. May be null if no response was received.
exception CronetException: detailed information about the error that occurred.

public abstract void onSucceeded (UrlResponseInfo info, T body)

Invoked when request is completed successfully. Once invoked, no other methods will be invoked on this object.

Parameters
info UrlResponseInfo: Response information.
body T: The response body transformed to the desired type.