R
- Type of the underlying resource running the operation.public class Task<R>
extends java.lang.Object
Constructor and Description |
---|
Task(RestClient client,
TaskResourceRep task,
java.lang.Class<? extends R> resourceClass) |
Modifier and Type | Method and Description |
---|---|
R |
get()
Waits for a task to complete (go into a pending or error state).
|
R |
get(long timeoutMillis)
Waits for a task to complete (go into a pending or error state).
|
java.util.List<NamedRelatedResourceRep> |
getAssociatedResources()
Delegates to the underlying task.
|
java.lang.String |
getDescription()
Delegates to the underlying task.
|
java.util.Calendar |
getEndTime()
Delegates to the underlying task.
|
java.lang.String |
getMessage()
Delegates to the underlying task.
|
java.lang.String |
getOpId()
Delegates to the underlying task.
|
NamedRelatedResourceRep |
getResource()
Delegates to the underlying task.
|
java.net.URI |
getResourceId() |
java.util.Calendar |
getStartTime()
Delegates to the underlying task.
|
TaskResourceRep |
getTaskResource()
Gets the underlying task resource.
|
boolean |
isComplete() |
boolean |
isError() |
Task<R> |
refresh()
Queries the task and updates information on this task.
|
Task<R> |
waitFor()
Waits for a task to complete (go into a pending or error state).
|
Task<R> |
waitFor(long timeoutMillis)
Waits for a task to complete (go into a pending or error state).
|
public Task(RestClient client, TaskResourceRep task, java.lang.Class<? extends R> resourceClass)
public TaskResourceRep getTaskResource()
public java.net.URI getResourceId()
public boolean isComplete()
public boolean isError()
public NamedRelatedResourceRep getResource()
public java.util.List<NamedRelatedResourceRep> getAssociatedResources()
public java.lang.String getDescription()
public java.util.Calendar getEndTime()
public java.lang.String getMessage()
public java.lang.String getOpId()
public java.util.Calendar getStartTime()
public Task<R> refresh()
public Task<R> waitFor() throws ViPRException
ViPRException
- Thrown if the task is in an error state.public Task<R> waitFor(long timeoutMillis) throws ViPRException
timeoutMillis
- Timeout after a number of millisecondsTimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if the task is in an error state.public R get()
TimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if the task is in an error state.public R get(long timeoutMillis)
timeoutMillis
- Timeout after a number of millisecondsTimeoutException
- Thrown if a timeout occurs.ViPRException
- Thrown if the task is in an error state.