Package com.gooddata.sdk.service
Class AbstractPollHandlerBase<P,R>
java.lang.Object
com.gooddata.sdk.service.AbstractPollHandlerBase<P,R>
- Type Parameters:
P- polling typeR- result type
- All Implemented Interfaces:
PollHandler<P,R>
- Direct Known Subclasses:
AbstractPollHandler
For internal use by services employing polling.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPollHandlerBase(Class<P> pollClass, Class<R> resultClass) -
Method Summary
Modifier and TypeMethodDescriptionGet class of the polling object.final RReturn result after polling.Get class of result after polling.final 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.protected voidonFinish()Method called after polling is successfully finished (default no-op)protected PollHandler<P,R> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.gooddata.sdk.service.PollHandler
getPolling, getPollingUri, handlePollException, handlePollResult
-
Field Details
-
pollClass
-
resultClass
-
-
Constructor Details
-
AbstractPollHandlerBase
-
-
Method Details
-
getResultClass
Description copied from interface:PollHandlerGet class of result after polling.- Specified by:
getResultClassin interfacePollHandler<P,R> - Returns:
- result class
-
getPollClass
Description copied from interface:PollHandlerGet class of the polling object.- Specified by:
getPollClassin interfacePollHandler<P,R> - Returns:
- polling class
-
setResult
-
isDone
public final boolean isDone()Description copied from interface:PollHandlerReturns true when the polling is done, false otherwise.- Specified by:
isDonein interfacePollHandler<P,R> - Returns:
- true when the polling is done, false otherwise
-
getResult
Description copied from interface:PollHandlerReturn result after polling.- Specified by:
getResultin interfacePollHandler<P,R> - Returns:
- result after polling
-
isFinished
public boolean isFinished(org.springframework.http.client.ClientHttpResponse response) throws IOException Description copied from interface:PollHandlerCheck single polling response if whole polling process should finish.- Specified by:
isFinishedin interfacePollHandler<P,R> - 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
-
onFinish
protected void onFinish()Method called after polling is successfully finished (default no-op)
-