Package com.gooddata.sdk.service
Class PollResult<T>
- java.lang.Object
-
- com.gooddata.sdk.service.PollResult<T>
-
- All Implemented Interfaces:
FutureResult<T>
public final class PollResult<T> extends java.lang.Object implements FutureResult<T>
Represents the result retrieved by polling on the REST API.
-
-
Constructor Summary
Constructors Constructor Description PollResult(AbstractService service, PollHandler<?,T> handler)Creates a new instance of the result to be eventually retrieved by polling on the REST API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Wait for the result to be available and return it's valueTget(long timeout, java.util.concurrent.TimeUnit unit)Wait for the result to be available up to given time and return it's valuejava.lang.StringgetPollingUri()Get URI used for pollingbooleanisDone()Checks if the result is available
-
-
-
Constructor Detail
-
PollResult
public PollResult(AbstractService service, PollHandler<?,T> handler)
Creates a new instance of the result to be eventually retrieved by polling on the REST API.For internal use by services employing polling.
- Parameters:
service- this servicehandler- poll handler
-
-
Method Detail
-
isDone
public boolean isDone()
Description copied from interface:FutureResultChecks if the result is available- Specified by:
isDonein interfaceFutureResult<T>- Returns:
- true if so
-
get
public T get()
Description copied from interface:FutureResultWait for the result to be available and return it's value- Specified by:
getin interfaceFutureResult<T>- Returns:
- result value
-
get
public T get(long timeout, java.util.concurrent.TimeUnit unit)
Description copied from interface:FutureResultWait for the result to be available up to given time and return it's value- Specified by:
getin interfaceFutureResult<T>- Parameters:
timeout- timeout valueunit- timeout unit- Returns:
- result value
-
getPollingUri
public java.lang.String getPollingUri()
Get URI used for polling- Specified by:
getPollingUriin interfaceFutureResult<T>- Returns:
- URI string
-
-