com.google.api.client.googleapis.batch.json
Class JsonBatchCallback<T>

java.lang.Object
  extended by com.google.api.client.googleapis.batch.json.JsonBatchCallback<T>
Type Parameters:
T - Type of the data model class
All Implemented Interfaces:
BatchCallback<T,GoogleJsonErrorContainer>

public abstract class JsonBatchCallback<T>
extends Object
implements BatchCallback<T,GoogleJsonErrorContainer>

Callback for an individual batch JSON response.

Sample use:

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

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

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

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

Constructor Summary
JsonBatchCallback()
           
 
Method Summary
 void onFailure(GoogleJsonErrorContainer e, GoogleHeaders responseHeaders)
          Called if the individual batch response is unsuccessful.
abstract  void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders)
          Called if the individual batch response is unsuccessful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.api.client.googleapis.batch.BatchCallback
onSuccess
 

Constructor Detail

JsonBatchCallback

public JsonBatchCallback()
Method Detail

onFailure

public final void onFailure(GoogleJsonErrorContainer e,
                            GoogleHeaders responseHeaders)
                     throws IOException
Description copied from interface: BatchCallback
Called if the individual batch response is unsuccessful.

Specified by:
onFailure in interface BatchCallback<T,GoogleJsonErrorContainer>
Parameters:
e - instance of data class representing the error response content
responseHeaders - Headers of the batch response
Throws:
IOException

onFailure

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

Parameters:
e - Google JSON error response content
responseHeaders - Headers of the batch response
Throws:
IOException


Copyright © 2010-2012 Google. All Rights Reserved.