Interface NextPolicyCallback

    • Method Detail

      • onSuccess

        PolicyCompleter.CompletionState onSuccess​(HttpResponse response,
                                                  PolicyCompleter completer)
        The method that receives and intercept the HttpResponse from the next policy.
        Parameters:
        response - The response produced by the next policy.
        completer - Once the onSuccess method completes the received response interception, it must use the completer to notify the completion.
        Returns:
        The completion state. The implementation of onSuccess must return the completion state object returned from the methods in completer.
      • onError

        PolicyCompleter.CompletionState onError​(java.lang.Throwable error,
                                                PolicyCompleter completer)
        The method that receives and intercept the error from the next policy.
        Parameters:
        error - The error produced by the next policy.
        completer - Once the onError method completes the received error interception, it must use the completer to notify the completion.
        Returns:
        The completion state. The implementation of onSuccess must return the completion state object returned from the methods in completer.