Class JsonBatchCallback<T> (2.1.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

NameDescription
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
NameDescription
eGoogleJsonError

Google JSON error response content

responseHeaderscom.google.api.client.http.HttpHeaders

Headers of the batch response

Exceptions
TypeDescription
IOException

onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)

public final void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)
Parameters
NameDescription
eGoogleJsonErrorContainer
responseHeaderscom.google.api.client.http.HttpHeaders
Exceptions
TypeDescription
IOException