public abstract static class ApolloCall.Callback<T>
extends java.lang.Object
Constructor and Description |
---|
Callback() |
Modifier and Type | Method and Description |
---|---|
void |
onCanceledError(ApolloCanceledException e)
Gets called when
ApolloCall has been canceled. |
abstract void |
onFailure(ApolloException e)
Gets called when an unexpected exception occurs while creating the request or processing the response.
|
void |
onHttpError(ApolloHttpException e)
Gets called when an http request error takes place.
|
void |
onNetworkError(ApolloNetworkException e)
Gets called when an http request error takes place due to network failures, timeouts etc.
|
void |
onParseError(ApolloParseException e)
Gets called when the network request succeeds but there was an error parsing the response.
|
abstract void |
onResponse(com.apollographql.apollo.api.Response<T> response)
Gets called when GraphQL response is received and parsed successfully.
|
void |
onStatusEvent(ApolloCall.StatusEvent event)
Gets called whenever any action happen to this
ApolloCall . |
public abstract void onResponse(@NotNull com.apollographql.apollo.api.Response<T> response)
ResponseFetcher
used with the call, this may be called multiple times. #onCompleted()
will be called after the final call to onResponse.response
- the GraphQL responsepublic abstract void onFailure(@NotNull ApolloException e)
onResponse(Response)
or #onCompleted()
will be called again.public void onStatusEvent(@NotNull ApolloCall.StatusEvent event)
ApolloCall
.event
- status that corresponds to a ApolloCall
actionpublic void onHttpError(@NotNull ApolloHttpException e)
Gets called when an http request error takes place. This is the case when the returned http status code doesn't lie in the range 200 (inclusive) and 300 (exclusive).
NOTE: by overriding this callback you must callResponse.close()
on ApolloHttpException.rawResponse
to close the network connection.public void onNetworkError(@NotNull ApolloNetworkException e)
public void onParseError(@NotNull ApolloParseException e)
public void onCanceledError(@NotNull ApolloCanceledException e)
ApolloCall
has been canceled.