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());
}
});
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.
Name | Description |
e | GoogleJsonError Google JSON error response content |
responseHeaders | com.google.api.client.http.HttpHeaders Headers of the batch response |
Type | Description |
IOException |
onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)
public final void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders)
Name | Description |
e | GoogleJsonErrorContainer |
responseHeaders | com.google.api.client.http.HttpHeaders |
Type | Description |
IOException |