com.facebook
Class RequestAsyncTask

java.lang.Object
  extended by android.os.AsyncTask<Void,Void,List<Response>>
      extended by com.facebook.RequestAsyncTask

public class RequestAsyncTask
extends AsyncTask<Void,Void,List<Response>>

Defines an AsyncTask suitable for executing a Request in the background. May be subclassed by applications having unique threading model needs.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.os.AsyncTask
AsyncTask.Status
 
Field Summary
 
Fields inherited from class android.os.AsyncTask
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
 
Constructor Summary
RequestAsyncTask(Collection<Request> requests)
          Constructor.
RequestAsyncTask(HttpURLConnection connection, Collection<Request> requests)
          Constructor that allows specification of an HTTP connection to use for executing the requests.
RequestAsyncTask(HttpURLConnection connection, Request... requests)
          Constructor that allows specification of an HTTP connection to use for executing the requests.
RequestAsyncTask(HttpURLConnection connection, RequestBatch requests)
          Constructor that allows specification of an HTTP connection to use for executing the requests.
RequestAsyncTask(Request... requests)
          Constructor.
RequestAsyncTask(RequestBatch requests)
          Constructor.
 
Method Summary
protected  List<Response> doInBackground(Void... params)
           
protected  Exception getException()
           
protected  RequestBatch getRequests()
           
protected  void onPostExecute(List<Response> result)
           
protected  void onPreExecute()
           
 String toString()
           
 
Methods inherited from class android.os.AsyncTask
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onProgressUpdate, publishProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestAsyncTask

public RequestAsyncTask(Request... requests)
Constructor. Serialization of the requests will be done in the background, so any serialization- related errors will be returned via the Response.getException() method.

Parameters:
requests - the requests to execute

RequestAsyncTask

public RequestAsyncTask(Collection<Request> requests)
Constructor. Serialization of the requests will be done in the background, so any serialization- related errors will be returned via the Response.getException() method.

Parameters:
requests - the requests to execute

RequestAsyncTask

public RequestAsyncTask(RequestBatch requests)
Constructor. Serialization of the requests will be done in the background, so any serialization- related errors will be returned via the Response.getException() method.

Parameters:
requests - the requests to execute

RequestAsyncTask

public RequestAsyncTask(HttpURLConnection connection,
                        Request... requests)
Constructor that allows specification of an HTTP connection to use for executing the requests. No validation is done that the contents of the connection actually reflect the serialized requests, so it is the caller's responsibility to ensure that it will correctly generate the desired responses.

Parameters:
connection - the HTTP connection to use to execute the requests
requests - the requests to execute

RequestAsyncTask

public RequestAsyncTask(HttpURLConnection connection,
                        Collection<Request> requests)
Constructor that allows specification of an HTTP connection to use for executing the requests. No validation is done that the contents of the connection actually reflect the serialized requests, so it is the caller's responsibility to ensure that it will correctly generate the desired responses.

Parameters:
connection - the HTTP connection to use to execute the requests
requests - the requests to execute

RequestAsyncTask

public RequestAsyncTask(HttpURLConnection connection,
                        RequestBatch requests)
Constructor that allows specification of an HTTP connection to use for executing the requests. No validation is done that the contents of the connection actually reflect the serialized requests, so it is the caller's responsibility to ensure that it will correctly generate the desired responses.

Parameters:
connection - the HTTP connection to use to execute the requests
requests - the requests to execute
Method Detail

getException

protected final Exception getException()

getRequests

protected final RequestBatch getRequests()

toString

public String toString()
Overrides:
toString in class Object

onPreExecute

protected void onPreExecute()
Overrides:
onPreExecute in class AsyncTask<Void,Void,List<Response>>

onPostExecute

protected void onPostExecute(List<Response> result)
Overrides:
onPostExecute in class AsyncTask<Void,Void,List<Response>>

doInBackground

protected List<Response> doInBackground(Void... params)
Specified by:
doInBackground in class AsyncTask<Void,Void,List<Response>>