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, HttpHeaders responseHeaders) {
log("Success");
printVolumes(volumes.getItems());
}
public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
log(e.getError().getMessage());
}
});
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(E e,
com.google.api.client.http.HttpHeaders responseHeaders)
Called if the individual batch response is unsuccessful.
|
void |
onSuccess(T t,
com.google.api.client.http.HttpHeaders responseHeaders)
Called if the individual batch response is successful.
|
void onSuccess(T t, com.google.api.client.http.HttpHeaders responseHeaders) throws IOException
Upgrade warning: this method now throws an IOException. In prior version 1.11 it did
not throw an exception.
Upgrade warning: in prior version 1.12 the response headers were of type
GoogleHeaders, but as of version 1.13 that type is deprecated, so we now use type
HttpHeaders.
t - instance of the parsed data model classresponseHeaders - Headers of the batch responseIOExceptionvoid onFailure(E e, com.google.api.client.http.HttpHeaders responseHeaders) throws IOException
Upgrade warning: in prior version 1.12 the response headers were of type
GoogleHeaders, but as of version 1.13 that type is deprecated, so we now use type
HttpHeaders.
e - instance of data class representing the error response contentresponseHeaders - Headers of the batch responseIOExceptionCopyright © 2010-2013 Google. All Rights Reserved.