Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.xensource.xenapi
Class Task

    java.lang.Object
      com.xensource.xenapi.XenAPIObject
          com.xensource.xenapi.Task

    public class Task

extends XenAPIObject

A long-running asynchronous task

Nested Class Summary
`static class` | `Task.Record` Represents all the fields in a Task

Field Summary
`protected String` | `ref` The XenAPI reference (OpaqueRef) to this object.

Method Summary
`void` | `addToOtherConfig(Connection c, String key, String value)` Add the given key-value pair to the other_config field of the given task.
`void` | `cancel(Connection c)` Request that a task be cancelled.
`Task` | `cancelAsync(Connection c)` Request that a task be cancelled.
`static Task` | `create(Connection c, String label, String description)` Create a new task object which must be manually destroyed.
`void` | `destroy(Connection c)` Destroy the task object
`boolean` | `equals(Object obj)` If obj is a Task, compares XenAPI references for equality.
`static Set<Task>` | `getAll(Connection c)` Return a list of all the tasks known to the system.
`Set<Types.TaskAllowedOperations>` | `getAllowedOperations(Connection c)` Get the allowed_operations field of the given task.
`static Map<Task,Task.Record>` | `getAllRecords(Connection c)` Return a map of task references to task records for all tasks known to the system.
`static Set<Task>` | `getByNameLabel(Connection c, String label)` Get all the task instances with the given label.
`static Task` | `getByUuid(Connection c, String uuid)` Get a reference to the task instance with the specified UUID.
`Date` | `getCreated(Connection c)` Get the created field of the given task.
`Map<String,Types.TaskAllowedOperations>` | `getCurrentOperations(Connection c)` Get the current_operations field of the given task.
`Set<String>` | `getErrorInfo(Connection c)` Get the error_info field of the given task.
`Date` | `getFinished(Connection c)` Get the finished field of the given task.
`String` | `getNameDescription(Connection c)` Get the name/description field of the given task.
`String` | `getNameLabel(Connection c)` Get the name/label field of the given task.
`Map<String,String>` | `getOtherConfig(Connection c)` Get the other_config field of the given task.
`Double` | `getProgress(Connection c)` Get the progress field of the given task.
`Task.Record` | `getRecord(Connection c)` Get a record containing the current state of the given task.
`Host` | `getResidentOn(Connection c)` Get the resident_on field of the given task.
`String` | `getResult(Connection c)` Get the result field of the given task.
`Types.TaskStatusType` | `getStatus(Connection c)` Get the status field of the given task.
`Task` | `getSubtaskOf(Connection c)` Get the subtask_of field of the given task.
`Set<Task>` | `getSubtasks(Connection c)` Get the subtasks field of the given task.
`String` | `getType(Connection c)` Get the type field of the given task.
`String` | `getUuid(Connection c)` Get the uuid field of the given task.
`int` | `hashCode()`
`void` | `removeFromOtherConfig(Connection c, String key)` Remove the given key and its corresponding value from the other_config field of the given task.
`void` | `setOtherConfig(Connection c, Map<String,String> otherConfig)` Set the other_config field of the given task.
`String` | `toWireString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ref

    protected final String ref

  The XenAPI reference (OpaqueRef) to this object.

Method Detail

### toWireString

    public String toWireString()

  Specified by:
    `toWireString` in class `XenAPIObject`
  Returns:
    The XenAPI reference (OpaqueRef) to this object.

### equals

    public boolean equals(Object obj)

  If obj is a Task, compares XenAPI references for equality.

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### getRecord

    public Task.Record getRecord(Connection c)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Get a record containing the current state of the given task.

  Returns:
    all fields from the object
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getByUuid

    public static Task getByUuid(Connection c,
                                 String uuid)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Get a reference to the task instance with the specified UUID.

  Parameters:
    `uuid` - UUID of object to return
  Returns:
    reference to the object
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getByNameLabel

    public static Set<Task> getByNameLabel(Connection c,
                                           String label)
                                    throws Types.BadServerResponse,
                                           Types.XenAPIException,
                                           org.apache.xmlrpc.XmlRpcException

  Get all the task instances with the given label.

  Parameters:
    `label` - label of object to return
  Returns:
    references to objects with matching names
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getUuid

    public String getUuid(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException

  Get the uuid field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getNameLabel

    public String getNameLabel(Connection c)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException

  Get the name/label field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getNameDescription

    public String getNameDescription(Connection c)
                              throws Types.BadServerResponse,
                                     Types.XenAPIException,
                                     org.apache.xmlrpc.XmlRpcException

  Get the name/description field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAllowedOperations

    public Set<Types.TaskAllowedOperations> getAllowedOperations(Connection c)
                                                          throws Types.BadServerResponse,
                                                                 Types.XenAPIException,
                                                                 org.apache.xmlrpc.XmlRpcException

  Get the allowed_operations field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getCurrentOperations

    public Map<String,Types.TaskAllowedOperations> getCurrentOperations(Connection c)
                                                                 throws Types.BadServerResponse,
                                                                        Types.XenAPIException,
                                                                        org.apache.xmlrpc.XmlRpcException

  Get the current_operations field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getCreated

    public Date getCreated(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException

  Get the created field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getFinished

    public Date getFinished(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException

  Get the finished field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getStatus

    public Types.TaskStatusType getStatus(Connection c)
                                   throws Types.BadServerResponse,
                                          Types.XenAPIException,
                                          org.apache.xmlrpc.XmlRpcException

  Get the status field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getResidentOn

    public Host getResidentOn(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Get the resident_on field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getProgress

    public Double getProgress(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Get the progress field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getType

    public String getType(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException

  Get the type field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getResult

    public String getResult(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException

  Get the result field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getErrorInfo

    public Set<String> getErrorInfo(Connection c)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException

  Get the error_info field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getOtherConfig

    public Map<String,String> getOtherConfig(Connection c)
                                      throws Types.BadServerResponse,
                                             Types.XenAPIException,
                                             org.apache.xmlrpc.XmlRpcException

  Get the other_config field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getSubtaskOf

    public Task getSubtaskOf(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException

  Get the subtask_of field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getSubtasks

    public Set<Task> getSubtasks(Connection c)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Get the subtasks field of the given task.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### setOtherConfig

    public void setOtherConfig(Connection c,
                               Map<String,String> otherConfig)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException

  Set the other_config field of the given task.

  Parameters:
    `otherConfig` - New value to set
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### addToOtherConfig

    public void addToOtherConfig(Connection c,
                                 String key,
                                 String value)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Add the given key-value pair to the other_config field of the given task.

  Parameters:
    `key` - Key to add
    `value` - Value to add
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### removeFromOtherConfig

    public void removeFromOtherConfig(Connection c,
                                      String key)
                               throws Types.BadServerResponse,
                                      Types.XenAPIException,
                                      org.apache.xmlrpc.XmlRpcException

  Remove the given key and its corresponding value from the other_config field of the given task. If the key is not in that Map, then do nothing.

  Parameters:
    `key` - Key to remove
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### create

    public static Task create(Connection c,
                              String label,
                              String description)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Create a new task object which must be manually destroyed.

  Parameters:
    `label` - short label for the new task
    `description` - longer description for the new task
  Returns:
    The reference of the created task object
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### destroy

    public void destroy(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException

  Destroy the task object

  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### cancelAsync

    public Task cancelAsync(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException,
                            Types.OperationNotAllowed

  Request that a task be cancelled. Note that a task may fail to be cancelled and may complete or fail normally and note that, even when a task does cancel, it might take an arbitrary amount of time.

  Returns:
    Task
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`
    `Types.OperationNotAllowed`

### cancel

    public void cancel(Connection c)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException,
                       Types.OperationNotAllowed

  Request that a task be cancelled. Note that a task may fail to be cancelled and may complete or fail normally and note that, even when a task does cancel, it might take an arbitrary amount of time.

  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`
    `Types.OperationNotAllowed`

### getAll

    public static Set<Task> getAll(Connection c)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException

  Return a list of all the tasks known to the system.

  Returns:
    references to all objects
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAllRecords

    public static Map<Task,Task.Record> getAllRecords(Connection c)
                                               throws Types.BadServerResponse,
                                                      Types.XenAPIException,
                                                      org.apache.xmlrpc.XmlRpcException

  Return a map of task references to task records for all tasks known to the system.

  Returns:
    records of all objects
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD