Class ApolloParseInterceptor

  • All Implemented Interfaces:
    ApolloInterceptor

    public final class ApolloParseInterceptor
    extends java.lang.Object
    implements ApolloInterceptor
    ApolloParseInterceptor is a concrete ApolloInterceptor responsible for inflating the http responses into models. To get the http responses, it hands over the control to the next interceptor in the chain and proceeds to then parse the returned response.
    • Constructor Detail

      • ApolloParseInterceptor

        public ApolloParseInterceptor​(com.apollographql.apollo.api.cache.http.HttpCache httpCache,
                                      com.apollographql.apollo.cache.normalized.internal.ResponseNormalizer<java.util.Map<java.lang.String,​java.lang.Object>> normalizer,
                                      com.apollographql.apollo.api.internal.ResponseFieldMapper responseFieldMapper,
                                      com.apollographql.apollo.api.ScalarTypeAdapters scalarTypeAdapters,
                                      com.apollographql.apollo.api.internal.ApolloLogger logger)
    • Method Detail

      • interceptAsync

        public void interceptAsync​(@NotNull
                                   ApolloInterceptor.InterceptorRequest request,
                                   @NotNull
                                   ApolloInterceptorChain chain,
                                   @NotNull
                                   java.util.concurrent.Executor dispatcher,
                                   @NotNull
                                   ApolloInterceptor.CallBack callBack)
        Description copied from interface: ApolloInterceptor
        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.
        Specified by:
        interceptAsync in interface ApolloInterceptor
        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

        public void dispose()
        Description copied from interface: ApolloInterceptor
        Disposes of the resources which are no longer required.

        A use case for this method call would be when an ApolloCall needs to be cancelled and resources need to be disposed of.

        Specified by:
        dispose in interface ApolloInterceptor