com.google.api.client.googleapis.batch.json
Class JsonBatchCallback<T>
java.lang.Object
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)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonBatchCallback
public JsonBatchCallback()
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 contentresponseHeaders
- 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 contentresponseHeaders
- Headers of the batch response
- Throws:
IOException
Copyright © 2010-2012 Google. All Rights Reserved.