com.google.api.client.googleapis.batch
Interface BatchCallback<T,E>

Type Parameters:
T - Type of the data model class
E - Type of the error data model class
All Known Implementing Classes:
JsonBatchCallback

public interface BatchCallback<T,E>

Callback for an individual batch response.

Sample use:

   batch.queue(volumesList.buildHttpRequest(), Volumes.class, GoogleJsonErrorContainer.class,
       new BatchCallback<Volumes, GoogleJsonErrorContainer>() {

     public void onSuccess(Volumes volumes, GoogleHeaders responseHeaders) {
       log("Success");
       printVolumes(volumes.getItems());
     }

     public void onFailure(GoogleJsonErrorContainer e, GoogleHeaders responseHeaders) {
       log(e.getError().getMessage());
     }
   });
 

Since:
1.9
Author:
[email protected] (Ravi Mistry)

Method Summary
 void onFailure(E e, GoogleHeaders responseHeaders)
          Called if the individual batch response is unsuccessful.
 void onSuccess(T t, GoogleHeaders responseHeaders)
          Called if the individual batch response is successful.
 

Method Detail

onSuccess

void onSuccess(T t,
               GoogleHeaders responseHeaders)
Called if the individual batch response is successful.

Parameters:
t - instance of the parsed data model class
responseHeaders - Headers of the batch response

onFailure

void onFailure(E e,
               GoogleHeaders responseHeaders)
               throws IOException
Called if the individual batch response is unsuccessful.

Parameters:
e - instance of data class representing the error response content
responseHeaders - Headers of the batch response
Throws:
IOException


Copyright © 2010-2012 Google. All Rights Reserved.