Package com.gooddata.sdk.service
Interface PollHandler<P,R>
- Type Parameters:
P- polling typeR- result type
- All Known Implementing Classes:
AbstractPollHandler,AbstractPollHandlerBase,SimplePollHandler
public interface PollHandler<P,R>
For internal use by services employing polling.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet class of the polling object.default URIGet URI used for polling.Get URI used for polling.Return result after polling.Get class of result after polling.voidhandlePollException(com.gooddata.sdk.common.GoodDataRestException e) Handle exception while polling.voidhandlePollResult(P pollResult) Handle result of single polling request.booleanisDone()Returns true when the polling is done, false otherwise.booleanisFinished(org.springframework.http.client.ClientHttpResponse response) Check single polling response if whole polling process should finish.
-
Method Details
-
getPollingUri
String getPollingUri()Get URI used for polling.- Returns:
- URI string
-
getPolling
Get URI used for polling.- Returns:
- URI string
-
getResultClass
Get class of result after polling.- Returns:
- result class
-
getPollClass
Get class of the polling object.- Returns:
- polling class
-
isDone
boolean isDone()Returns true when the polling is done, false otherwise.- Returns:
- true when the polling is done, false otherwise
-
getResult
R getResult()Return result after polling.- Returns:
- result after polling
-
isFinished
Check single polling response if whole polling process should finish.- Parameters:
response- client side HTTP response- Returns:
- true if polling should finish, false otherwise
- Throws:
IOException- when there's a problem extracting data from response
-
handlePollResult
Handle result of single polling request.- Parameters:
pollResult- result of polling request
-
handlePollException
void handlePollException(com.gooddata.sdk.common.GoodDataRestException e) Handle exception while polling. The implementing class should throw instance ofGoodDataException(or ancestor) with the given argument as cause.- Parameters:
e- the exception
-