Interface BatchCallback<T,E> (2.1.0)

public interface BatchCallback<T,E>

Callback for an individual batch response.

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());
       }
     });
 

Type Parameters

NameDescription
T
E

Methods

onFailure(E e, HttpHeaders responseHeaders)

public abstract void onFailure(E e, HttpHeaders responseHeaders)

Called if the individual batch response is unsuccessful.

Parameters
NameDescription
eE

instance of data class representing the error response content

responseHeaderscom.google.api.client.http.HttpHeaders

Headers of the batch response

Exceptions
TypeDescription
IOException

onSuccess(T t, HttpHeaders responseHeaders)

public abstract void onSuccess(T t, HttpHeaders responseHeaders)

Called if the individual batch response is successful.

Parameters
NameDescription
tT

instance of the parsed data model class

responseHeaderscom.google.api.client.http.HttpHeaders

Headers of the batch response

Exceptions
TypeDescription
IOException