Interface RedirectStrategy

All Known Implementing Classes:
DefaultRedirectStrategy

public interface RedirectStrategy
The interface for determining the redirect strategy used in RedirectPolicy.
  • Method Details

    • getMaxAttempts

      int getMaxAttempts()
      Max number of redirect attempts to be made.
      Returns:
      The max number of redirect attempts.
    • shouldAttemptRedirect

      boolean shouldAttemptRedirect(HttpPipelineCallContext context, HttpResponse httpResponse, int tryCount, Set<String> attemptedRedirectUrls)
      Determines if the url should be redirected between each try.
      Parameters:
      context - the HTTP pipeline context.
      httpResponse - the HttpRequest containing the redirect url present in the response headers
      tryCount - redirect attempts so far
      attemptedRedirectUrls - attempted redirect locations used so far.
      Returns:
      true if the request should be redirected, false otherwise
    • createRedirectRequest

      HttpRequest createRedirectRequest(HttpResponse httpResponse)
      Creates an request for the redirect attempt.
      Parameters:
      httpResponse - the HttpResponse containing the redirect url present in the response headers
      Returns:
      the modified HttpRequest to redirect the incoming request.