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
public abstract class AbstractPollHandlerBase<P,R> extends java.lang.Object implements PollHandler<P,R>
For internal use by services employing polling.- See Also:
FutureResult
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<P>pollClassprotected java.lang.Class<R>resultClass
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPollHandlerBase(java.lang.Class<P> pollClass, java.lang.Class<R> resultClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<P>getPollClass()Get class of the polling object.RgetResult()Return result after polling.java.lang.Class<R>getResultClass()Get class of result after polling.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>setResult(R result)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gooddata.sdk.service.PollHandler
getPolling, getPollingUri, handlePollException, handlePollResult
-
-
-
-
Method Detail
-
getResultClass
public final java.lang.Class<R> getResultClass()
Description copied from interface:PollHandlerGet class of result after polling.- Specified by:
getResultClassin interfacePollHandler<P,R>- Returns:
- result class
-
getPollClass
public final java.lang.Class<P> getPollClass()
Description copied from interface:PollHandlerGet class of the polling object.- Specified by:
getPollClassin interfacePollHandler<P,R>- Returns:
- polling class
-
setResult
protected PollHandler<P,R> setResult(R result)
-
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
public final R 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 java.io.IOExceptionDescription 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:
java.io.IOException- when there's a problem extracting data from response
-
onFinish
protected void onFinish()
Method called after polling is successfully finished (default no-op)
-
-