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:
FutureResult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Class<P>getPollClass()Get class of the polling object.default java.net.URIgetPolling()Get URI used for polling.java.lang.StringgetPollingUri()Get URI used for polling.RgetResult()Return result after polling.java.lang.Class<R>getResultClass()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 Detail
-
getPollingUri
java.lang.String getPollingUri()
Get URI used for polling.- Returns:
- URI string
-
getPolling
default java.net.URI getPolling()
Get URI used for polling.- Returns:
- URI string
-
getResultClass
java.lang.Class<R> getResultClass()
Get class of result after polling.- Returns:
- result class
-
getPollClass
java.lang.Class<P> 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
boolean isFinished(org.springframework.http.client.ClientHttpResponse response) throws java.io.IOExceptionCheck single polling response if whole polling process should finish.- Parameters:
response- client side HTTP response- Returns:
- true if polling should finish, false otherwise
- Throws:
java.io.IOException- when there's a problem extracting data from response
-
handlePollResult
void handlePollResult(P pollResult)
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
-
-