Class JsonBatchCallback<T> (2.5.0)

public abstract class JsonBatchCallback<T> 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, HttpHeaders responseHeaders) {
         log("Success");
         printVolumes(volumes.getItems());
       }

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

Inheritance

java.lang.Object > JsonBatchCallback<T>

Implements

com.google.api.client.googleapis.batch.BatchCallback<T,com.google.api.client.googleapis.json.GoogleJsonErrorContainer>

Type Parameter

Name Description
T

Constructors

JsonBatchCallback()

public JsonBatchCallback()

Methods

onFailure(GoogleJsonError e, HttpHeaders responseHeaders)

public abstract void onFailure(GoogleJsonError e, HttpHeaders responseHeaders)

Called if the individual batch response is unsuccessful.

Parameters
Name Description
e GoogleJsonError

Google JSON error response content

responseHeaders com.google.api.client.http.HttpHeaders

Headers of the batch response

Exceptions
Type Description
IOException

onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)

public final void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)
Parameters
Name Description
e GoogleJsonErrorContainer
responseHeaders com.google.api.client.http.HttpHeaders
Exceptions
Type Description
IOException