T - Type of the data model classE - Type of the error data model classpublic interface BatchCallback<T,E>
Sample use:
batch.queue(volumesList.buildHttpRequest(), Volumes.class, GoogleJsonErrorContainer.class,
new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
public void onSuccess(Volumes volumes, GoogleHeaders responseHeaders) {
log("Success");
printVolumes(volumes.getItems());
}
public void onFailure(GoogleJsonErrorContainer e, GoogleHeaders responseHeaders) {
log(e.getError().getMessage());
}
});
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(E e,
GoogleHeaders responseHeaders)
Called if the individual batch response is unsuccessful.
|
void |
onSuccess(T t,
GoogleHeaders responseHeaders)
Called if the individual batch response is successful.
|
void onSuccess(T t, GoogleHeaders responseHeaders) throws IOException
Upgrade warning: this method now throws an IOException. In prior version 1.11 it did
not throw an exception.
t - instance of the parsed data model classresponseHeaders - Headers of the batch responseIOExceptionvoid onFailure(E e, GoogleHeaders responseHeaders) throws IOException
e - instance of data class representing the error response contentresponseHeaders - Headers of the batch responseIOExceptionCopyright © 2010-2012 Google. All Rights Reserved.