com.vmware.vcloud.sdk.admin.extensions
Class BlockingTask

java.lang.Object
  extended by com.vmware.vcloud.sdk.VcloudResource<T>
      extended by com.vmware.vcloud.sdk.VcloudEntity<com.vmware.vcloud.api.rest.schema.extension.BlockingTaskType>
          extended by com.vmware.vcloud.sdk.admin.extensions.BlockingTask

public class BlockingTask
extends VcloudEntity<com.vmware.vcloud.api.rest.schema.extension.BlockingTaskType>

Helper class to access the AMQP Notification delivered by vCloud Director using vCloud API, for the blocking tasks. Client can optionally interact with vCD to resume/abort/fail corresponding operations

Since:
API 1.5, SDK 1.5
Author:
Ecosystem Engineering

Method Summary
 void abortOperation(String abortMessage)
          This operation aborts blocking task.
static void abortOperation(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef, String abortMessage)
          This operation aborts blocking task.
 void failOperation(String failMessage)
          This operation fails blocking task.
static void failOperation(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef, String failMessage)
          This operation fails blocking task.
static BlockingTask getBlockingTaskById(VcloudClient client, String vCloudId)
          Returns blocking task using the vCloud ID obtained from a blocking Notification.
static BlockingTask getBlockingTaskByReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType reference)
          Returns blocking task using the entity ReferenceType
 XMLGregorianCalendar getCreatedDate()
          Returns the blocking task created date.
static XMLGregorianCalendar getCreatedDate(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the blocking task created date.
 com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference()
          Returns the organization reference.
static com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the organization reference.
 com.vmware.vcloud.api.rest.schema.ReferenceType getOwnerReference()
          Returns the owner reference.
static com.vmware.vcloud.api.rest.schema.ReferenceType getOwnerReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the owner reference.
 String getStatus()
          Returns the blocking task status.
static String getStatus(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the blocking task status.
 com.vmware.vcloud.api.rest.schema.ReferenceType getTaskReference()
          Returns the task reference.
 String getTimeoutAction()
          Returns the blocking task timeout action.
static String getTimeoutAction(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the blocking task timeout action.
 XMLGregorianCalendar getTimeoutDate()
          Returns the blocking task timeout date.
static XMLGregorianCalendar getTimeoutDate(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the blocking task timeout date.
 com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference()
          Returns the user reference.
static com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
          Returns the user reference.
 void resumeOperation(String resumeMessage)
          Resumes blocking task and continues with executing underlying operation.
static void resumeOperation(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef, String resumeMessage)
          Resumes blocking task and continues with executing underlying operation.
 BlockingTask updateProgress(String updateMessage)
          Update the progress of a blocking task operation.
 BlockingTask updateProgress(String updateMessage, long timeout)
          Update the progress of a blocking task operation.
static BlockingTask updateProgress(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef, String updateMessage)
          Update the progress of a blocking task operation.
static BlockingTask updateProgress(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef, String updateMessage, long timeout)
          Update the progress of a blocking task operation.
 
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
 

Method Detail

getTaskReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getTaskReference()
                                                                 throws VCloudException
Returns the task reference.

Returns:
ReferenceType
Throws:
VCloudException

getBlockingTaskByReference

public static BlockingTask getBlockingTaskByReference(VcloudClient client,
                                                      com.vmware.vcloud.api.rest.schema.ReferenceType reference)
                                               throws VCloudException
Returns blocking task using the entity ReferenceType

Parameters:
client - VcloudClient
reference - ReferenceType
Returns:
BlockingTask
Throws:
VCloudException

getBlockingTaskById

public static BlockingTask getBlockingTaskById(VcloudClient client,
                                               String vCloudId)
                                        throws VCloudException
Returns blocking task using the vCloud ID obtained from a blocking Notification.

Parameters:
client - VcloudClient
vCloudId - format - The vCloud ID is of the form: "urn:vcloud:type:uuid". For example: "urn:vcloud:media:d9d976ba-e0ec-4682-a67d-380af49b54e1". String
Returns:
BlockingTask
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

getOrgReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference()
Returns the organization reference.

Returns:
ReferenceType

getUserReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference()
Returns the user reference.

Returns:
ReferenceType

getOwnerReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getOwnerReference()
Returns the owner reference.

Returns:
ReferenceType

getCreatedDate

public XMLGregorianCalendar getCreatedDate()
Returns the blocking task created date.

Returns:
XMLGregorianCalendar

getTimeoutDate

public XMLGregorianCalendar getTimeoutDate()
Returns the blocking task timeout date.

Returns:
XMLGregorianCalendar

getStatus

public String getStatus()
Returns the blocking task status.

Returns:
String

getTimeoutAction

public String getTimeoutAction()
Returns the blocking task timeout action.

Returns:
String

abortOperation

public void abortOperation(String abortMessage)
                    throws VCloudException
This operation aborts blocking task. cancels/stops task execution. Cleans/deletes any newly created objects sets the underlying task status to aborted.

Parameters:
abortMessage - String
Throws:
VCloudException

failOperation

public void failOperation(String failMessage)
                   throws VCloudException
This operation fails blocking task. cancels/stops task execution. sets any newly created objects to error state sets the underlying task status to error

Parameters:
failMessage - String
Throws:
VCloudException

resumeOperation

public void resumeOperation(String resumeMessage)
                     throws VCloudException
Resumes blocking task and continues with executing underlying operation.

Parameters:
resumeMessage - String
Throws:
VCloudException

updateProgress

public BlockingTask updateProgress(String updateMessage,
                                   long timeout)
                            throws VCloudException
Update the progress of a blocking task operation.

Parameters:
updateMessage - String
timeout - timeout value in milliseconds
Returns:
BlockingTask
Throws:
VCloudException

updateProgress

public BlockingTask updateProgress(String updateMessage)
                            throws VCloudException
Update the progress of a blocking task operation.

Parameters:
updateMessage - String
Returns:
BlockingTask
Throws:
VCloudException

getOrgReference

public static com.vmware.vcloud.api.rest.schema.ReferenceType getOrgReference(VcloudClient client,
                                                                              com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                                                                       throws VCloudException
Returns the organization reference.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
ReferenceType
Throws:
VCloudException

getUserReference

public static com.vmware.vcloud.api.rest.schema.ReferenceType getUserReference(VcloudClient client,
                                                                               com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                                                                        throws VCloudException
Returns the user reference.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
ReferenceType
Throws:
VCloudException

getOwnerReference

public static com.vmware.vcloud.api.rest.schema.ReferenceType getOwnerReference(VcloudClient client,
                                                                                com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                                                                         throws VCloudException
Returns the owner reference.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
ReferenceType
Throws:
VCloudException

getCreatedDate

public static XMLGregorianCalendar getCreatedDate(VcloudClient client,
                                                  com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                                           throws VCloudException
Returns the blocking task created date.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
XMLGregorianCalendar
Throws:
VCloudException

getTimeoutDate

public static XMLGregorianCalendar getTimeoutDate(VcloudClient client,
                                                  com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                                           throws VCloudException
Returns the blocking task timeout date.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
XMLGregorianCalendar
Throws:
VCloudException

getStatus

public static String getStatus(VcloudClient client,
                               com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                        throws VCloudException
Returns the blocking task status.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
String
Throws:
VCloudException

getTimeoutAction

public static String getTimeoutAction(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef)
                               throws VCloudException
Returns the blocking task timeout action.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
Returns:
String
Throws:
VCloudException

abortOperation

public static void abortOperation(VcloudClient client,
                                  com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef,
                                  String abortMessage)
                           throws VCloudException
This operation aborts blocking task. cancels/stops task execution. Cleans/deletes any newly created objects sets the underlying task status to aborted.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
abortMessage - String
Throws:
VCloudException

failOperation

public static void failOperation(VcloudClient client,
                                 com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef,
                                 String failMessage)
                          throws VCloudException
This operation fails blocking task. cancels/stops task execution. sets any newly created objects to error state sets the underlying task status to error

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
failMessage - String
Throws:
VCloudException

resumeOperation

public static void resumeOperation(VcloudClient client,
                                   com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef,
                                   String resumeMessage)
                            throws VCloudException
Resumes blocking task and continues with executing underlying operation.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
resumeMessage - String
Throws:
VCloudException

updateProgress

public static BlockingTask updateProgress(VcloudClient client,
                                          com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef,
                                          String updateMessage,
                                          long timeout)
                                   throws VCloudException
Update the progress of a blocking task operation.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
updateMessage - String
timeout - timeout value in milliseconds
Returns:
BlockingTask
Throws:
VCloudException

updateProgress

public static BlockingTask updateProgress(VcloudClient client,
                                          com.vmware.vcloud.api.rest.schema.ReferenceType blockingTaskRef,
                                          String updateMessage)
                                   throws VCloudException
Update the progress of a blocking task operation.

Parameters:
client - VcloudClient
blockingTaskRef - ReferenceType
updateMessage - String
Returns:
BlockingTask
Throws:
VCloudException


Copyright © 2016. All Rights Reserved.