Class ApiUtils

java.lang.Object
org.opengrok.indexer.web.ApiUtils

public class ApiUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull jakarta.ws.rs.core.Response
    waitForAsyncApi(@NotNull jakarta.ws.rs.core.Response response)
    Busy waits for API call to complete by repeatedly querying the status API endpoint passed in the Location header in the response parameter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • waitForAsyncApi

      @NotNull public static @NotNull jakarta.ws.rs.core.Response waitForAsyncApi(@NotNull @NotNull jakarta.ws.rs.core.Response response) throws InterruptedException, IllegalArgumentException
      Busy waits for API call to complete by repeatedly querying the status API endpoint passed in the Location header in the response parameter. The overall time is governed by the RuntimeEnvironment.getApiTimeout(), however each individual status check uses RuntimeEnvironment.getConnectTimeout() so in the worst case the total time can be getApiTimeout() * getConnectTimeout().
      Parameters:
      response - response returned from the server upon asynchronous API request
      Returns:
      response from the status API call
      Throws:
      InterruptedException - on sleep interruption
      IllegalArgumentException - on invalid request (no Location header)