R
- Type of the underlying resource running the operation.public class Tasks<R>
extends java.lang.Object
Constructor and Description |
---|
Tasks(RestClient client,
java.util.List<TaskResourceRep> tasks,
java.lang.Class<? extends R> resourceClass) |
Modifier and Type | Method and Description |
---|---|
Task<R> |
firstTask()
Retrieves the first task in the list.
|
java.util.List<R> |
get()
Waits for tasks to complete (go into a pending or error state).
|
java.util.List<R> |
get(long timeoutMillis)
Waits for tasks to complete (go into a pending or error state).
|
java.util.List<Task<R>> |
getTasks()
Retrieves all tasks associated with the operation.
|
Task<R> |
latestFinishedTask()
Retrieves the latest task in the list that has finished processing.
|
Tasks<R> |
waitFor()
Waits for tasks to complete (go into a pending or error state).
|
Tasks<R> |
waitFor(long timeoutMillis)
Waits for tasks to complete (go into a pending or error state).
|
public Tasks(RestClient client, java.util.List<TaskResourceRep> tasks, java.lang.Class<? extends R> resourceClass)
public java.util.List<Task<R>> getTasks()
public Task<R> firstTask()
public Task<R> latestFinishedTask()
public Tasks<R> waitFor() throws ViPRException
ViPRException
- Thrown if any task is in an error state.public Tasks<R> waitFor(long timeoutMillis) throws ViPRException
timeoutMillis
- Timeout after a number of millisecondsTimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if any task is in an error state.public java.util.List<R> get()
TimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if any task is in an error state.public java.util.List<R> get(long timeoutMillis)
timeoutMillis
- Timeout after a number of millisecondsTimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if any task is in an error state.