Package org.opengrok.indexer.web
Class ApiUtils
java.lang.Object
org.opengrok.indexer.web.ApiUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic @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 theLocation
header in the response parameter.
-
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 theLocation
header in the response parameter. The overall time is governed by theRuntimeEnvironment.getApiTimeout()
, however each individual status check usesRuntimeEnvironment.getConnectTimeout()
so in the worst case the total time can begetApiTimeout() * getConnectTimeout()
.- Parameters:
response
- response returned from the server upon asynchronous API request- Returns:
- response from the status API call
- Throws:
InterruptedException
- on sleep interruptionIllegalArgumentException
- on invalid request (noLocation
header)
-