|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vmware.vcloud.sdk.VcloudResource<T>
com.vmware.vcloud.sdk.VcloudEntity<com.vmware.vcloud.api.rest.schema.TaskType>
com.vmware.vcloud.sdk.Task
public class Task
Helper class to access the Task Resource in vCloud API.
TaskType| Constructor Summary | |
|---|---|
Task(VcloudClient client,
com.vmware.vcloud.api.rest.schema.TaskType taskResource_v1_5)
Constructor to create the Task. |
|
| Method Summary | |
|---|---|
void |
cancelTask()
Canceling a task. |
static void |
cancelTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
Canceling a task. |
com.vmware.vcloud.api.rest.schema.ReferenceType |
getBlockingTaskReference()
Returns the blocking task reference. |
com.vmware.vcloud.api.rest.schema.ReferenceType |
getOrgReference()
Returns the Organization reference on which the task was started |
static com.vmware.vcloud.api.rest.schema.ReferenceType |
getOrgReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
Returns the Organization reference on which the task was started |
Integer |
getProgress()
Returns the progress of the task. |
static Integer |
getProgress(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
Returns the progress of the task. |
static Task |
getTaskById(VcloudClient client,
String vCloudId)
Get Task helper using the vCloud ID |
static Task |
getTaskByReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef)
Returns Task helper for the given Task Ref. |
com.vmware.vcloud.api.rest.schema.ReferenceType |
getUserReference()
Returns the user reference (who initiates the task) |
static com.vmware.vcloud.api.rest.schema.ReferenceType |
getUserReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
Returns the user reference who initiated the task |
Boolean |
isBlockingTask()
Returns true if the task is a blocking task request. |
Task |
updateTask(com.vmware.vcloud.api.rest.schema.TaskType taskType)
Updating the Custom Task. |
void |
waitForTask(long timeout)
Waits for the current task to be completed. |
void |
waitForTask(long timeout,
long period)
Waits for the current task to be completed. |
static void |
waitForTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef,
long timeout)
Waits for the current task to be completed. |
static void |
waitForTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef,
long timeout,
long period)
Waits for the current task to be completed. |
| Methods inherited from class com.vmware.vcloud.sdk.VcloudEntity |
|---|
getMetadata, getReference, getTasks |
| Methods inherited from class com.vmware.vcloud.sdk.VcloudResource |
|---|
getResource |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Task(VcloudClient client,
com.vmware.vcloud.api.rest.schema.TaskType taskResource_v1_5)
client - The VcloudClient used to communicate with the vCloud| Method Detail |
|---|
public Boolean isBlockingTask()
BlockingTask
Boolean
public com.vmware.vcloud.api.rest.schema.ReferenceType getBlockingTaskReference()
throws VCloudException
BlockingTask can be used to resume, abort or
fail the blocking task.
ReferenceType
VCloudException
public static Task getTaskByReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef)
throws VCloudException
client - vCloud API client VcloudClienttaskRef - Task Ref ReferenceType
Task
VCloudExceptionpublic com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference()
ReferenceType
public static com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
throws VCloudException
client - VcloudClienttaskReference - task reference
ReferenceType
VCloudExceptionpublic com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference()
ReferenceType
public static com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
throws VCloudException
client - VcloudClienttaskReference - task reference
ReferenceType
VCloudExceptionpublic Integer getProgress()
Integer
public static Integer getProgress(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
throws VCloudException
client - VcloudClienttaskReference - task reference
Integer
VCloudException
public void cancelTask()
throws VCloudException
VCloudException
public static void cancelTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskReference)
throws VCloudException
client - VcloudClienttaskReference - task reference
VCloudException
public void waitForTask(long timeout)
throws VCloudException,
TimeoutException
VCloudException if the task status is aborted, cancelled and
errored.
timeout - timeout in milliseconds until which this method checks/polls for the task status.
If the timeout is set to <=0, timeout is infinite.
VCloudException
TimeoutException
public static void waitForTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef,
long timeout)
throws VCloudException,
TimeoutException
VCloudException if the task status is aborted, cancelled and
errored.
client - VcloudClienttaskRef - ReferenceTypetimeout - timeout in milliseconds until which this method checks/polls for the task status.
If the timeout is set to <=0, timeout is infinite.
VCloudException
TimeoutException
public void waitForTask(long timeout,
long period)
throws VCloudException,
TimeoutException
VCloudException if the task status is aborted, cancelled and
errored.
timeout - timeout in milliseconds until which this method checks/polls for the task status.
If the timeout is set to <=0, timeout is infinite.period - Subsequent wait for task checks take place at approximately regular intervals
separated by the specified period. This reduces the number of API calls for
checking the task status.
VCloudException
TimeoutException
public static void waitForTask(VcloudClient client,
com.vmware.vcloud.api.rest.schema.ReferenceType taskRef,
long timeout,
long period)
throws VCloudException,
TimeoutException
VCloudException if the task status is aborted, cancelled and
errored.
client - VcloudClienttaskRef - ReferenceTypetimeout - timeout in milliseconds until which this method checks/polls for the task status.
If the timeout is set to <=0, timeout is infinite.period - Subsequent wait for task checks take place at approximately regular intervals
separated by the specified period. This reduces the number of API calls for
checking the task status.
VCloudException
TimeoutException
public static Task getTaskById(VcloudClient client,
String vCloudId)
throws VCloudException
client - VcloudClientvCloudId - format - The vCloud ID is of the form: "urn:vcloud:type:uuid". For example:
"urn:vcloud:media:d9d976ba-e0ec-4682-a67d-380af49b54e1". String
AdminVdc
VCloudException
public Task updateTask(com.vmware.vcloud.api.rest.schema.TaskType taskType)
throws VCloudException
taskType - TaskType
Task
VCloudException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||