Interface ApolloInterceptor
-
- All Known Implementing Classes:
ApolloAutoPersistedOperationInterceptor,ApolloCacheInterceptor,ApolloParseInterceptor
public interface ApolloInterceptorApolloInterceptor is responsible for observing and modifying the requests going out and the corresponding responses coming back in. Typical responsibilities include adding or removing headers from the request or response objects, transforming the returned responses from one type to another, etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceApolloInterceptor.CallBackHandles the responses returned byApolloInterceptorstatic classApolloInterceptor.FetchSourceTypeFetch source typestatic classApolloInterceptor.InterceptorRequestRequest to be proceed withApolloInterceptorstatic classApolloInterceptor.InterceptorResponseInterceptorResponse class represents the response returned by theApolloInterceptor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Disposes of the resources which are no longer required.voidinterceptAsync(ApolloInterceptor.InterceptorRequest request, ApolloInterceptorChain chain, java.util.concurrent.Executor dispatcher, ApolloInterceptor.CallBack callBack)Intercepts the outgoing request and performs non blocking operations on the request or the response returned by the next set of interceptors in the chain.
-
-
-
Method Detail
-
interceptAsync
void interceptAsync(@NotNull ApolloInterceptor.InterceptorRequest request, @NotNull ApolloInterceptorChain chain, @NotNull java.util.concurrent.Executor dispatcher, @NotNull ApolloInterceptor.CallBack callBack)Intercepts the outgoing request and performs non blocking operations on the request or the response returned by the next set of interceptors in the chain.- Parameters:
request- outgoing request object.chain- the ApolloInterceptorChain object containing the next set of interceptors.dispatcher- the Executor which dispatches the non blocking operations on the request/response.callBack- the Callback which will handle the interceptor's response or failure exception.
-
dispose
void dispose()
Disposes of the resources which are no longer required.A use case for this method call would be when an
ApolloCallneeds to be cancelled and resources need to be disposed of.
-
-