You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2014/04/08 09:03:42 UTC

[01/19] Revert "Applied Tina's patches for removing the xapi jar"

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 3661e67fd -> ec102ec96


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java b/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java
new file mode 100644
index 0000000..f49019b
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java
@@ -0,0 +1,1158 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * VM Protection Policy
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VMPP extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VMPP(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VMPP, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VMPP)
+        {
+            VMPP other = (VMPP) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VMPP
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "isPolicyEnabled", this.isPolicyEnabled);
+            print.printf("%1$20s: %2$s\n", "backupType", this.backupType);
+            print.printf("%1$20s: %2$s\n", "backupRetentionValue", this.backupRetentionValue);
+            print.printf("%1$20s: %2$s\n", "backupFrequency", this.backupFrequency);
+            print.printf("%1$20s: %2$s\n", "backupSchedule", this.backupSchedule);
+            print.printf("%1$20s: %2$s\n", "isBackupRunning", this.isBackupRunning);
+            print.printf("%1$20s: %2$s\n", "backupLastRunTime", this.backupLastRunTime);
+            print.printf("%1$20s: %2$s\n", "archiveTargetType", this.archiveTargetType);
+            print.printf("%1$20s: %2$s\n", "archiveTargetConfig", this.archiveTargetConfig);
+            print.printf("%1$20s: %2$s\n", "archiveFrequency", this.archiveFrequency);
+            print.printf("%1$20s: %2$s\n", "archiveSchedule", this.archiveSchedule);
+            print.printf("%1$20s: %2$s\n", "isArchiveRunning", this.isArchiveRunning);
+            print.printf("%1$20s: %2$s\n", "archiveLastRunTime", this.archiveLastRunTime);
+            print.printf("%1$20s: %2$s\n", "VMs", this.VMs);
+            print.printf("%1$20s: %2$s\n", "isAlarmEnabled", this.isAlarmEnabled);
+            print.printf("%1$20s: %2$s\n", "alarmConfig", this.alarmConfig);
+            print.printf("%1$20s: %2$s\n", "recentAlerts", this.recentAlerts);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VMPP.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("is_policy_enabled", this.isPolicyEnabled == null ? false : this.isPolicyEnabled);
+            map.put("backup_type", this.backupType == null ? Types.VmppBackupType.UNRECOGNIZED : this.backupType);
+            map.put("backup_retention_value", this.backupRetentionValue == null ? 0 : this.backupRetentionValue);
+            map.put("backup_frequency", this.backupFrequency == null ? Types.VmppBackupFrequency.UNRECOGNIZED : this.backupFrequency);
+            map.put("backup_schedule", this.backupSchedule == null ? new HashMap<String, String>() : this.backupSchedule);
+            map.put("is_backup_running", this.isBackupRunning == null ? false : this.isBackupRunning);
+            map.put("backup_last_run_time", this.backupLastRunTime == null ? new Date(0) : this.backupLastRunTime);
+            map.put("archive_target_type", this.archiveTargetType == null ? Types.VmppArchiveTargetType.UNRECOGNIZED : this.archiveTargetType);
+            map.put("archive_target_config", this.archiveTargetConfig == null ? new HashMap<String, String>() : this.archiveTargetConfig);
+            map.put("archive_frequency", this.archiveFrequency == null ? Types.VmppArchiveFrequency.UNRECOGNIZED : this.archiveFrequency);
+            map.put("archive_schedule", this.archiveSchedule == null ? new HashMap<String, String>() : this.archiveSchedule);
+            map.put("is_archive_running", this.isArchiveRunning == null ? false : this.isArchiveRunning);
+            map.put("archive_last_run_time", this.archiveLastRunTime == null ? new Date(0) : this.archiveLastRunTime);
+            map.put("VMs", this.VMs == null ? new LinkedHashSet<VM>() : this.VMs);
+            map.put("is_alarm_enabled", this.isAlarmEnabled == null ? false : this.isAlarmEnabled);
+            map.put("alarm_config", this.alarmConfig == null ? new HashMap<String, String>() : this.alarmConfig);
+            map.put("recent_alerts", this.recentAlerts == null ? new LinkedHashSet<String>() : this.recentAlerts);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * enable or disable this policy
+         */
+        public Boolean isPolicyEnabled;
+        /**
+         * type of the backup sub-policy
+         */
+        public Types.VmppBackupType backupType;
+        /**
+         * maximum number of backups that should be stored at any time
+         */
+        public Long backupRetentionValue;
+        /**
+         * frequency of the backup schedule
+         */
+        public Types.VmppBackupFrequency backupFrequency;
+        /**
+         * schedule of the backup containing 'hour', 'min', 'days'. Date/time-related information is in XenServer Local Timezone
+         */
+        public Map<String, String> backupSchedule;
+        /**
+         * true if this protection policy's backup is running
+         */
+        public Boolean isBackupRunning;
+        /**
+         * time of the last backup
+         */
+        public Date backupLastRunTime;
+        /**
+         * type of the archive target config
+         */
+        public Types.VmppArchiveTargetType archiveTargetType;
+        /**
+         * configuration for the archive, including its 'location', 'username', 'password'
+         */
+        public Map<String, String> archiveTargetConfig;
+        /**
+         * frequency of the archive schedule
+         */
+        public Types.VmppArchiveFrequency archiveFrequency;
+        /**
+         * schedule of the archive containing 'hour', 'min', 'days'. Date/time-related information is in XenServer Local Timezone
+         */
+        public Map<String, String> archiveSchedule;
+        /**
+         * true if this protection policy's archive is running
+         */
+        public Boolean isArchiveRunning;
+        /**
+         * time of the last archive
+         */
+        public Date archiveLastRunTime;
+        /**
+         * all VMs attached to this protection policy
+         */
+        public Set<VM> VMs;
+        /**
+         * true if alarm is enabled for this policy
+         */
+        public Boolean isAlarmEnabled;
+        /**
+         * configuration for the alarm
+         */
+        public Map<String, String> alarmConfig;
+        /**
+         * recent alerts
+         */
+        public Set<String> recentAlerts;
+    }
+
+    /**
+     * Get a record containing the current state of the given VMPP.
+     *
+     * @return all fields from the object
+     */
+    public VMPP.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMPPRecord(result);
+    }
+
+    /**
+     * Get a reference to the VMPP instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VMPP getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMPP(result);
+    }
+
+    /**
+     * Create a new VMPP instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VMPP.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VMPP.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VMPP instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VMPP create(Connection c, VMPP.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMPP(result);
+    }
+
+    /**
+     * Destroy the specified VMPP instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VMPP.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VMPP instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get all the VMPP instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<VMPP> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMPP(result);
+    }
+
+    /**
+     * Get the uuid field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the is_policy_enabled field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsPolicyEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_is_policy_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the backup_type field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Types.VmppBackupType getBackupType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_backup_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVmppBackupType(result);
+    }
+
+    /**
+     * Get the backup_retention_value field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Long getBackupRetentionValue(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_backup_retention_value";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the backup_frequency field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Types.VmppBackupFrequency getBackupFrequency(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_backup_frequency";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVmppBackupFrequency(result);
+    }
+
+    /**
+     * Get the backup_schedule field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getBackupSchedule(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_backup_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the is_backup_running field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsBackupRunning(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_is_backup_running";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the backup_last_run_time field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Date getBackupLastRunTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_backup_last_run_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the archive_target_type field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Types.VmppArchiveTargetType getArchiveTargetType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_archive_target_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVmppArchiveTargetType(result);
+    }
+
+    /**
+     * Get the archive_target_config field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getArchiveTargetConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_archive_target_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the archive_frequency field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Types.VmppArchiveFrequency getArchiveFrequency(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_archive_frequency";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVmppArchiveFrequency(result);
+    }
+
+    /**
+     * Get the archive_schedule field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getArchiveSchedule(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_archive_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the is_archive_running field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsArchiveRunning(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_is_archive_running";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the archive_last_run_time field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Date getArchiveLastRunTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_archive_last_run_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the VMs field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Set<VM> getVMs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_VMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Get the is_alarm_enabled field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsAlarmEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_is_alarm_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the alarm_config field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getAlarmConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_alarm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the recent_alerts field of the given VMPP.
+     *
+     * @return value of the field
+     */
+    public Set<String> getRecentAlerts(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_recent_alerts";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Set the name/label field of the given VMPP.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given VMPP.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the is_policy_enabled field of the given VMPP.
+     *
+     * @param isPolicyEnabled New value to set
+     */
+    public void setIsPolicyEnabled(Connection c, Boolean isPolicyEnabled) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_is_policy_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(isPolicyEnabled)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the backup_type field of the given VMPP.
+     *
+     * @param backupType New value to set
+     */
+    public void setBackupType(Connection c, Types.VmppBackupType backupType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_backup_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(backupType)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call executes the protection policy immediately
+     *
+     * @return An XMLRPC result
+     */
+    public String protectNow(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.protect_now";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * This call archives the snapshot provided as a parameter
+     *
+     * @param snapshot The snapshot to archive
+     * @return An XMLRPC result
+     */
+    public static String archiveNow(Connection c, VM snapshot) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.archive_now";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(snapshot)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * This call fetches a history of alerts for a given protection policy
+     *
+     * @param hoursFromNow how many hours in the past the oldest record to fetch is
+     * @return A list of alerts encoded in xml
+     */
+    public Set<String> getAlerts(Connection c, Long hoursFromNow) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_alerts";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(hoursFromNow)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setBackupRetentionValue(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_backup_retention_value";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the backup_frequency field
+     *
+     * @param value the backup frequency
+     */
+    public void setBackupFrequency(Connection c, Types.VmppBackupFrequency value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_backup_frequency";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setBackupSchedule(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_backup_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the archive_frequency field
+     *
+     * @param value the archive frequency
+     */
+    public void setArchiveFrequency(Connection c, Types.VmppArchiveFrequency value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_archive_frequency";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setArchiveSchedule(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_archive_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the archive_target_config_type field
+     *
+     * @param value the archive target config type
+     */
+    public void setArchiveTargetType(Connection c, Types.VmppArchiveTargetType value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_archive_target_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setArchiveTargetConfig(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_archive_target_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the is_alarm_enabled field
+     *
+     * @param value true if alarm is enabled for this policy
+     */
+    public void setIsAlarmEnabled(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_is_alarm_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setAlarmConfig(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_alarm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to add
+     * @param value the value to add
+     */
+    public void addToBackupSchedule(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.add_to_backup_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to add
+     * @param value the value to add
+     */
+    public void addToArchiveTargetConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.add_to_archive_target_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to add
+     * @param value the value to add
+     */
+    public void addToArchiveSchedule(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.add_to_archive_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to add
+     * @param value the value to add
+     */
+    public void addToAlarmConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.add_to_alarm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to remove
+     */
+    public void removeFromBackupSchedule(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.remove_from_backup_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to remove
+     */
+    public void removeFromArchiveTargetConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.remove_from_archive_target_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to remove
+     */
+    public void removeFromArchiveSchedule(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.remove_from_archive_schedule";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param key the key to remove
+     */
+    public void removeFromAlarmConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.remove_from_alarm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setBackupLastRunTime(Connection c, Date value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_backup_last_run_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value the value to set
+     */
+    public void setArchiveLastRunTime(Connection c, Date value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.set_archive_last_run_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VMPPs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VMPP> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMPP(result);
+    }
+
+    /**
+     * Return a map of VMPP references to VMPP records for all VMPPs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VMPP, VMPP.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VMPP.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMPPVMPPRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java b/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java
new file mode 100644
index 0000000..4ee7b2f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual TPM device
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VTPM extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VTPM(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VTPM, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VTPM)
+        {
+            VTPM other = (VTPM) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VTPM
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "backend", this.backend);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VTPM.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("backend", this.backend == null ? new VM("OpaqueRef:NULL") : this.backend);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the virtual machine
+         */
+        public VM VM;
+        /**
+         * the domain where the backend is located
+         */
+        public VM backend;
+    }
+
+    /**
+     * Get a record containing the current state of the given VTPM.
+     *
+     * @return all fields from the object
+     */
+    public VTPM.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVTPMRecord(result);
+    }
+
+    /**
+     * Get a reference to the VTPM instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VTPM getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVTPM(result);
+    }
+
+    /**
+     * Create a new VTPM instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VTPM.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VTPM.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VTPM instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VTPM create(Connection c, VTPM.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVTPM(result);
+    }
+
+    /**
+     * Destroy the specified VTPM instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VTPM.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VTPM instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given VTPM.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the VM field of the given VTPM.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the backend field of the given VTPM.
+     *
+     * @return value of the field
+     */
+    public VM getBackend(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VTPM.get_backend";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/XenAPIObject.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/XenAPIObject.java b/deps/XenServerJava/src/com/xensource/xenapi/XenAPIObject.java
new file mode 100755
index 0000000..815a874
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/XenAPIObject.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+public abstract class XenAPIObject
+{
+	public abstract String toWireString();
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/plugins/hypervisors/ovm/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/pom.xml b/plugins/hypervisors/ovm/pom.xml
index 1723296..e03dac6 100644
--- a/plugins/hypervisors/ovm/pom.xml
+++ b/plugins/hypervisors/ovm/pom.xml
@@ -28,8 +28,8 @@
   </parent>
   <dependencies>
     <dependency>
-      <groupId>net.java.dev.vcc.thirdparty</groupId>
-      <artifactId>xen-api</artifactId>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>xapi</artifactId>
       <version>${cs.xapi.version}</version>
     </dependency>    
   </dependencies>  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/plugins/hypervisors/xen/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/pom.xml b/plugins/hypervisors/xen/pom.xml
index b4cb3e0..39c0908 100644
--- a/plugins/hypervisors/xen/pom.xml
+++ b/plugins/hypervisors/xen/pom.xml
@@ -36,8 +36,8 @@
       <scope>compile</scope>
     </dependency>
     <dependency>
-      <groupId>net.java.dev.vcc.thirdparty</groupId>
-      <artifactId>xen-api</artifactId>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>xapi</artifactId>
       <version>${cs.xapi.version}</version>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
index ca04673..6a8d1cd 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
@@ -52,7 +52,6 @@ public class XenServerConnectionPool {
     protected HashMap<String /* poolUuid */, XenServerConnection> _conns = new HashMap<String, XenServerConnection>();
     protected int _retries;
     protected int _interval;
-    protected int _connWait = 5;
     protected static long s_sleepOnError = 10 * 1000; // in ms
     static {
         File file = PropertiesUtil.findConfigFile("environment.properties");
@@ -150,12 +149,12 @@ public class XenServerConnectionPool {
     }
 
     public Connection getConnect(String ip, String username, Queue<String> password) {
-        Connection conn = new Connection(getURL(ip), 10, _connWait);
+        Connection conn = new Connection(getURL(ip), 10);
         try {
             loginWithPassword(conn, username, password, APIVersion.latest().toString());
         }  catch (Types.HostIsSlave e) {
             String maddress = e.masterIPAddress;
-            conn = new Connection(getURL(maddress), 10, _connWait);
+            conn = new Connection(getURL(maddress), 10);
             try {
                 loginWithPassword(conn, username, password, APIVersion.latest().toString());
             }  catch (Exception e1) {
@@ -220,7 +219,7 @@ public class XenServerConnectionPool {
 
             if ( mConn == null ) {
                 try {
-                    Connection conn = new Connection(getURL(ipAddress), 5, _connWait);
+                    Connection conn = new Connection(getURL(ipAddress), 5);
                     Session sess = loginWithPassword(conn, username, password, APIVersion.latest().toString());
                     Host host = sess.getThisHost(conn);
                     Boolean hostenabled = host.getEnabled(conn);
@@ -236,11 +235,11 @@ public class XenServerConnectionPool {
                         s_logger.debug(msg);
                         throw new CloudRuntimeException(msg);
                     }
-                    mConn = new XenServerConnection(getURL(ipAddress), ipAddress, username, password, _retries, _interval, wait, _connWait);
+                    mConn = new XenServerConnection(getURL(ipAddress), ipAddress, username, password, _retries, _interval, wait);
                     loginWithPassword(mConn, username, password, APIVersion.latest().toString());
                 }  catch (Types.HostIsSlave e) {
                     String maddress = e.masterIPAddress;
-                    mConn = new XenServerConnection(getURL(maddress), maddress, username, password, _retries, _interval, wait, _connWait);
+                    mConn = new XenServerConnection(getURL(maddress), maddress, username, password, _retries, _interval, wait);
                     try {
                         Session session = loginWithPassword(mConn, username, password, APIVersion.latest().toString());
                         Host host = session.getThisHost(mConn);
@@ -418,8 +417,8 @@ public class XenServerConnectionPool {
         Queue<String> _password;
         String _poolUuid;
 
-        public XenServerConnection(URL url, String ip, String username, Queue<String> password, int retries, int interval, int wait, int connwait) {
-            super(url, wait, connwait);
+        public XenServerConnection(URL url, String ip, String username, Queue<String> password, int retries, int interval, int wait) {
+            super(url, wait);
             _ip = ip;
             _retries = retries;
             _username = username;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
index 4906c35..dad3d14 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
@@ -174,7 +174,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
                 }
                 String pUuid = poolsr.getUuid(conn);
                 boolean isISCSI = IsISCSI(poolsr.getType(conn));
-                Task task = srcVdi.copyAsync(conn, poolsr, null, null);
+                Task task = srcVdi.copyAsync2(conn, poolsr, null, null);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);
@@ -233,7 +233,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
                 if (prevSnapshotUuid != null) {
                     previousSnapshotVdi = VDI.getByUuid(conn,prevSnapshotUuid);
                 }
-                task = snapshotvdi.copyAsync(conn, ssSR, previousSnapshotVdi, null);
+                task = snapshotvdi.copyAsync2(conn, ssSR, previousSnapshotVdi, null);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);
@@ -344,7 +344,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
 
                     snapshotSr = createFileSr(conn, secondaryStorageMountPath, folder);
 
-                    Task task = snapshotVdi.copyAsync(conn, snapshotSr, null, null);
+                    Task task = snapshotVdi.copyAsync2(conn, snapshotSr, null, null);
                     // poll every 1 seconds ,
                     hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                     hypervisorResource.checkForSuccess(conn, task);
@@ -462,7 +462,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
             tmpltSR = createFileSr(conn, uri.getHost() + ":" + uri.getPath(), installPath);
 
             // copy volume to template SR
-            Task task = vol.copyAsync(conn, tmpltSR, null, null);
+            Task task = vol.copyAsync2(conn, tmpltSR, null, null);
             // poll every 1 seconds ,
             hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
             hypervisorResource.checkForSuccess(conn, task);
@@ -578,7 +578,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
             snapshotChains.add(snapshotVdi);
 
             for(VDI snapChain : snapshotChains) {
-                Task task = snapChain.copyAsync(conn, null, null, destVdi);
+                Task task = snapChain.copyAsync2(conn, null, null, destVdi);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);
@@ -641,7 +641,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
                 // Look up the volume on the source primary storage pool
                 VDI srcVdi = getVDIbyUuid(conn, srcVolume.getPath());
                 // Copy the volume to secondary storage
-                Task task = srcVdi.copyAsync(conn, secondaryStorage, null, null);
+                Task task = srcVdi.copyAsync2(conn, secondaryStorage, null, null);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);
@@ -693,7 +693,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
             try {
                 SR primaryStoragePool = hypervisorResource.getStorageRepository(conn, primaryStore.getUuid());
                 VDI srcVdi = VDI.getByUuid(conn, volumeUuid);
-                Task task = srcVdi.copyAsync(conn, primaryStoragePool, null, null);
+                Task task = srcVdi.copyAsync2(conn, primaryStoragePool, null, null);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);
@@ -777,7 +777,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
             String destVdiUuid = destVdi.getUuid(conn);
 
             for(VDI snapChain : snapshotChains) {
-                Task task = snapChain.copyAsync(conn, null, null, destVdi);
+                Task task = snapChain.copyAsync2(conn, null, null, destVdi);
                 // poll every 1 seconds ,
                 hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
                 hypervisorResource.checkForSuccess(conn, task);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
index c67fb33..f5394ea 100644
--- a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
+++ b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.hypervisor.xenserver;
 
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeoutException;
 
@@ -27,7 +28,6 @@ import org.apache.xmlrpc.XmlRpcException;
 
 import com.xensource.xenapi.Connection;
 import com.xensource.xenapi.Event;
-import com.xensource.xenapi.EventBatch;
 import com.xensource.xenapi.Host;
 import com.xensource.xenapi.Pool;
 import com.xensource.xenapi.Task;
@@ -110,10 +110,10 @@ public class XenServerResourceNewBase extends XenServer620SP1Resource {
         String token = "";
         Double t = new Double(timeout / 1000);
         while (true) {
-            EventBatch map = Event.from(c, classes, token, t);
-            token = map.token;
+            Map<?, ?> map = Event.properFrom(c, classes, token, t);
+            token = (String)map.get("token");
             @SuppressWarnings("unchecked")
-            Set<Event.Record> events = map.events;
+            Set<Event.Record> events = (Set<Event.Record>)map.get("events");
             if (events.size() == 0) {
                 String msg = "Async " + timeout / 1000 + " seconds timeout for task " + task.toString();
                 s_logger.warn(msg);
@@ -171,17 +171,17 @@ public class XenServerResourceNewBase extends XenServer620SP1Resource {
             while (!_stop) {
                 try {
                     Connection conn = getConnection();
-                    EventBatch results;
+                    Map<?, ?> results;
                     try {
-                        results = Event.from(conn, _classes, _token, new Double(30));
+                        results = Event.properFrom(conn, _classes, _token, new Double(30));
                     } catch (Exception e) {
                         s_logger.error("Retrying the waiting on VM events due to: ", e);
                         continue;
                     }
 
-                    _token = results.token;
+                    _token = (String)results.get("token");
                     @SuppressWarnings("unchecked")
-                    Set<Event.Record> events = results.events;
+                    Set<Event.Record> events = (Set<Event.Record>)results.get("events");
                     for (Event.Record event : events) {
                         try {
                             if (!(event.snapshot instanceof VM.Record)) {
@@ -308,14 +308,14 @@ public class XenServerResourceNewBase extends XenServer620SP1Resource {
             if (_isMaster) {
                 // Throw away the initial set of events because they're history
                 Connection conn = getConnection();
-                EventBatch results;
+                Map<?, ?> results;
                 try {
-                    results = Event.from(conn, _classes, _token, new Double(30));
+                    results = Event.properFrom(conn, _classes, _token, new Double(30));
                 } catch (Exception e) {
                     s_logger.error("Retrying the waiting on VM events due to: ", e);
                     throw new CloudRuntimeException("Unable to start a listener thread to listen to VM events", e);
                 }
-                _token = results.token;
+                _token = (String)results.get("token");
                 s_logger.debug("Starting the event listener thread for " + _host.uuid);
                 super.start();
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3fad07a..c608c4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
   <version>4.4.0-SNAPSHOT</version>
   <packaging>pom</packaging>
   <name>Apache CloudStack</name>
-  <description>Apache CloudStack is an IaaS (“Infrastructure as a Service”) cloud orchestration platform.</description>
+  <description>Apache CloudStack is an IaaS (“Infrastracture as a Service”) cloud orchestration platform.</description>
   <url>http://www.cloudstack.org</url>
   <scm>
     <connection>scm:git:https://git-wip-us.apache.org/repos/asf/cloudstack.git</connection>
@@ -60,7 +60,7 @@
     <cs.ehcache.version>2.6.6</cs.ehcache.version>
     <cs.gson.version>1.7.2</cs.gson.version>
     <cs.guava.version>14.0-rc1</cs.guava.version>
-    <cs.xapi.version>6.2.0-3</cs.xapi.version>
+    <cs.xapi.version>6.2.0-1-SNAPSHOT</cs.xapi.version>
     <cs.httpclient.version>3.1</cs.httpclient.version>
     <cs.httpcore.version>4.2.1</cs.httpcore.version>
     <cs.mysql.version>5.1.21</cs.mysql.version>
@@ -174,6 +174,7 @@
     <module>server</module>
     <module>usage</module>
     <module>utils</module>
+    <module>deps/XenServerJava</module>
     <module>engine</module>
     <module>plugins</module>
     <module>framework</module>
@@ -448,11 +449,6 @@
       <artifactId>javax.inject</artifactId>
       <version>1</version>
     </dependency>
-    <dependency>
-        <groupId>net.java.dev.vcc.thirdparty</groupId>
-        <artifactId>xen-api</artifactId>
-        <version>${cs.xapi.version}</version>
-    </dependency>
   </dependencies>
 
   <build>
@@ -544,7 +540,7 @@
             <includeTestSourceDirectory>true</includeTestSourceDirectory>
             <sourceDirectory>${project.basedir}</sourceDirectory>
             <includes>**\/*.java</includes>
-            <excludes>**\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/awsapi\/,**\/apidoc\/</excludes>
+            <excludes>**\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/awsapi\/,**\/XenServerJava\/,**\/apidoc\/</excludes>
           </configuration>
         </plugin>
         <plugin>
@@ -738,6 +734,9 @@
               <exclude>debian/control</exclude>
               <exclude>debian/dirs</exclude>
               <exclude>debian/rules</exclude>
+              <exclude>deps/XenServerJava/src/com/xensource/xenapi/*.java</exclude>
+              <exclude>deps/XenServerJava/BSD</exclude>
+              <exclude>deps/XenServerJava/Makefile</exclude>
               <exclude>dist/console-proxy/js/jquery.js</exclude>
               <exclude>plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.sln</exclude>
               <exclude>plugins/hypervisors/hyperv/DotNet/ServerResource/packages/**</exclude>


[11/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java b/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java
new file mode 100644
index 0000000..99ac7e8
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java
@@ -0,0 +1,693 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Pool-wide patches
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PoolPatch extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PoolPatch(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PoolPatch, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PoolPatch)
+        {
+            PoolPatch other = (PoolPatch) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PoolPatch
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "version", this.version);
+            print.printf("%1$20s: %2$s\n", "size", this.size);
+            print.printf("%1$20s: %2$s\n", "poolApplied", this.poolApplied);
+            print.printf("%1$20s: %2$s\n", "hostPatches", this.hostPatches);
+            print.printf("%1$20s: %2$s\n", "afterApplyGuidance", this.afterApplyGuidance);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a pool_patch.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("version", this.version == null ? "" : this.version);
+            map.put("size", this.size == null ? 0 : this.size);
+            map.put("pool_applied", this.poolApplied == null ? false : this.poolApplied);
+            map.put("host_patches", this.hostPatches == null ? new LinkedHashSet<HostPatch>() : this.hostPatches);
+            map.put("after_apply_guidance", this.afterApplyGuidance == null ? new LinkedHashSet<Types.AfterApplyGuidance>() : this.afterApplyGuidance);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * Patch version number
+         */
+        public String version;
+        /**
+         * Size of the patch
+         */
+        public Long size;
+        /**
+         * This patch should be applied across the entire pool
+         */
+        public Boolean poolApplied;
+        /**
+         * This hosts this patch is applied to.
+         */
+        public Set<HostPatch> hostPatches;
+        /**
+         * What the client should do after this patch has been applied.
+         */
+        public Set<Types.AfterApplyGuidance> afterApplyGuidance;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given pool_patch.
+     *
+     * @return all fields from the object
+     */
+    public PoolPatch.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPoolPatchRecord(result);
+    }
+
+    /**
+     * Get a reference to the pool_patch instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PoolPatch getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPoolPatch(result);
+    }
+
+    /**
+     * Get all the pool_patch instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<PoolPatch> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPoolPatch(result);
+    }
+
+    /**
+     * Get the uuid field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the version field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public String getVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the size field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public Long getSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the pool_applied field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public Boolean getPoolApplied(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_pool_applied";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the host_patches field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public Set<HostPatch> getHostPatches(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_host_patches";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostPatch(result);
+    }
+
+    /**
+     * Get the after_apply_guidance field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public Set<Types.AfterApplyGuidance> getAfterApplyGuidance(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_after_apply_guidance";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfAfterApplyGuidance(result);
+    }
+
+    /**
+     * Get the other_config field of the given pool_patch.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given pool_patch.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given pool_patch.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given pool_patch.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Apply the selected patch to a host and return its output
+     *
+     * @param host The host to apply the patch too
+     * @return Task
+     */
+    public Task applyAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Apply the selected patch to a host and return its output
+     *
+     * @param host The host to apply the patch too
+     * @return the output of the patch application process
+     */
+    public String apply(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output
+     *
+     * @return Task
+     */
+    public Task poolApplyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.pool_apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output
+     *
+     */
+    public void poolApply(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.pool_apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Execute the precheck stage of the selected patch on a host and return its output
+     *
+     * @param host The host to run the prechecks on
+     * @return Task
+     */
+    public Task precheckAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.precheck";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Execute the precheck stage of the selected patch on a host and return its output
+     *
+     * @param host The host to run the prechecks on
+     * @return the output of the patch prechecks
+     */
+    public String precheck(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.precheck";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Removes the patch's files from the server
+     *
+     * @return Task
+     */
+    public Task cleanAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.clean";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes the patch's files from the server
+     *
+     */
+    public void clean(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.clean";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes the patch's files from all hosts in the pool, but does not remove the database entries
+     *
+     * @return Task
+     */
+    public Task poolCleanAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.pool_clean";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes the patch's files from all hosts in the pool, but does not remove the database entries
+     *
+     */
+    public void poolClean(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.pool_clean";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes the patch's files from all hosts in the pool, and removes the database entries.  Only works on unapplied patches.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes the patch's files from all hosts in the pool, and removes the database entries.  Only works on unapplied patches.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes the patch's files from the specified host
+     *
+     * @param host The host on which to clean the patch
+     * @return Task
+     */
+    public Task cleanOnHostAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool_patch.clean_on_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes the patch's files from the specified host
+     *
+     * @param host The host on which to clean the patch
+     */
+    public void cleanOnHost(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.clean_on_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the pool_patchs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PoolPatch> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPoolPatch(result);
+    }
+
+    /**
+     * Return a map of pool_patch references to pool_patch records for all pool_patchs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PoolPatch, PoolPatch.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool_patch.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPoolPatchPoolPatchRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Role.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Role.java b/deps/XenServerJava/src/com/xensource/xenapi/Role.java
new file mode 100644
index 0000000..c9eaeaa
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Role.java
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A set of permissions associated with a subject
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Role extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Role(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Role, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Role)
+        {
+            Role other = (Role) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Role
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "subroles", this.subroles);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a role.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("subroles", this.subroles == null ? new LinkedHashSet<Role>() : this.subroles);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a short user-friendly name for the role
+         */
+        public String nameLabel;
+        /**
+         * what this role is for
+         */
+        public String nameDescription;
+        /**
+         * a list of pointers to other roles or permissions
+         */
+        public Set<Role> subroles;
+    }
+
+    /**
+     * Get a record containing the current state of the given role.
+     *
+     * @return all fields from the object
+     */
+    public Role.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toRoleRecord(result);
+    }
+
+    /**
+     * Get a reference to the role instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Role getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toRole(result);
+    }
+
+    /**
+     * Get all the role instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<Role> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * Get the uuid field of the given role.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given role.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given role.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the subroles field of the given role.
+     *
+     * @return value of the field
+     */
+    public Set<Role> getSubroles(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_subroles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * This call returns a list of permissions given a role
+     *
+     * @return a list of permissions
+     */
+    public Set<Role> getPermissions(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_permissions";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * This call returns a list of permission names given a role
+     *
+     * @return a list of permission names
+     */
+    public Set<String> getPermissionsNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_permissions_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * This call returns a list of roles given a permission
+     *
+     * @return a list of references to roles
+     */
+    public Set<Role> getByPermission(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_by_permission";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * This call returns a list of roles given a permission name
+     *
+     * @param label The short friendly name of the role
+     * @return a list of references to roles
+     */
+    public static Set<Role> getByPermissionNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_by_permission_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * Return a list of all the roles known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Role> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * Return a map of role references to role records for all roles known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Role, Role.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "role.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfRoleRoleRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/SM.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/SM.java b/deps/XenServerJava/src/com/xensource/xenapi/SM.java
new file mode 100644
index 0000000..6950fcd
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/SM.java
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A storage manager plugin
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class SM extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    SM(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a SM, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof SM)
+        {
+            SM other = (SM) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a SM
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "vendor", this.vendor);
+            print.printf("%1$20s: %2$s\n", "copyright", this.copyright);
+            print.printf("%1$20s: %2$s\n", "version", this.version);
+            print.printf("%1$20s: %2$s\n", "requiredApiVersion", this.requiredApiVersion);
+            print.printf("%1$20s: %2$s\n", "configuration", this.configuration);
+            print.printf("%1$20s: %2$s\n", "capabilities", this.capabilities);
+            print.printf("%1$20s: %2$s\n", "features", this.features);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "driverFilename", this.driverFilename);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a SM.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("type", this.type == null ? "" : this.type);
+            map.put("vendor", this.vendor == null ? "" : this.vendor);
+            map.put("copyright", this.copyright == null ? "" : this.copyright);
+            map.put("version", this.version == null ? "" : this.version);
+            map.put("required_api_version", this.requiredApiVersion == null ? "" : this.requiredApiVersion);
+            map.put("configuration", this.configuration == null ? new HashMap<String, String>() : this.configuration);
+            map.put("capabilities", this.capabilities == null ? new LinkedHashSet<String>() : this.capabilities);
+            map.put("features", this.features == null ? new HashMap<String, Long>() : this.features);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("driver_filename", this.driverFilename == null ? "" : this.driverFilename);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * SR.type
+         */
+        public String type;
+        /**
+         * Vendor who created this plugin
+         */
+        public String vendor;
+        /**
+         * Entity which owns the copyright of this plugin
+         */
+        public String copyright;
+        /**
+         * Version of the plugin
+         */
+        public String version;
+        /**
+         * Minimum SM API version required on the server
+         */
+        public String requiredApiVersion;
+        /**
+         * names and descriptions of device config keys
+         */
+        public Map<String, String> configuration;
+        /**
+         * capabilities of the SM plugin
+         */
+        public Set<String> capabilities;
+        /**
+         * capabilities of the SM plugin, with capability version numbers
+         */
+        public Map<String, Long> features;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * filename of the storage driver
+         */
+        public String driverFilename;
+    }
+
+    /**
+     * Get a record containing the current state of the given SM.
+     *
+     * @return all fields from the object
+     */
+    public SM.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSMRecord(result);
+    }
+
+    /**
+     * Get a reference to the SM instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static SM getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSM(result);
+    }
+
+    /**
+     * Get all the SM instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<SM> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSM(result);
+    }
+
+    /**
+     * Get the uuid field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the type field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the vendor field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getVendor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_vendor";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the copyright field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getCopyright(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_copyright";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the version field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the required_api_version field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getRequiredApiVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_required_api_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the configuration field of the given SM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getConfiguration(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the capabilities field of the given SM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public Set<String> getCapabilities(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_capabilities";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the features field of the given SM.
+     *
+     * @return value of the field
+     */
+    public Map<String, Long> getFeatures(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_features";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringLong(result);
+    }
+
+    /**
+     * Get the other_config field of the given SM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the driver_filename field of the given SM.
+     *
+     * @return value of the field
+     */
+    public String getDriverFilename(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_driver_filename";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Set the other_config field of the given SM.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given SM.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given SM.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the SMs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<SM> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSM(result);
+    }
+
+    /**
+     * Return a map of SM references to SM records for all SMs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<SM, SM.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SM.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfSMSMRecord(result);
+    }
+
+}
\ No newline at end of file


[10/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/SR.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/SR.java b/deps/XenServerJava/src/com/xensource/xenapi/SR.java
new file mode 100644
index 0000000..8999158
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/SR.java
@@ -0,0 +1,1449 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A storage repository
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class SR extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    SR(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a SR, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof SR)
+        {
+            SR other = (SR) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a SR
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "VDIs", this.VDIs);
+            print.printf("%1$20s: %2$s\n", "PBDs", this.PBDs);
+            print.printf("%1$20s: %2$s\n", "virtualAllocation", this.virtualAllocation);
+            print.printf("%1$20s: %2$s\n", "physicalUtilisation", this.physicalUtilisation);
+            print.printf("%1$20s: %2$s\n", "physicalSize", this.physicalSize);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "contentType", this.contentType);
+            print.printf("%1$20s: %2$s\n", "shared", this.shared);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "smConfig", this.smConfig);
+            print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+            print.printf("%1$20s: %2$s\n", "localCacheEnabled", this.localCacheEnabled);
+            print.printf("%1$20s: %2$s\n", "introducedBy", this.introducedBy);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a SR.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.StorageOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.StorageOperations>() : this.currentOperations);
+            map.put("VDIs", this.VDIs == null ? new LinkedHashSet<VDI>() : this.VDIs);
+            map.put("PBDs", this.PBDs == null ? new LinkedHashSet<PBD>() : this.PBDs);
+            map.put("virtual_allocation", this.virtualAllocation == null ? 0 : this.virtualAllocation);
+            map.put("physical_utilisation", this.physicalUtilisation == null ? 0 : this.physicalUtilisation);
+            map.put("physical_size", this.physicalSize == null ? 0 : this.physicalSize);
+            map.put("type", this.type == null ? "" : this.type);
+            map.put("content_type", this.contentType == null ? "" : this.contentType);
+            map.put("shared", this.shared == null ? false : this.shared);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("sm_config", this.smConfig == null ? new HashMap<String, String>() : this.smConfig);
+            map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
+            map.put("local_cache_enabled", this.localCacheEnabled == null ? false : this.localCacheEnabled);
+            map.put("introduced_by", this.introducedBy == null ? new DRTask("OpaqueRef:NULL") : this.introducedBy);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.StorageOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.StorageOperations> currentOperations;
+        /**
+         * all virtual disks known to this storage repository
+         */
+        public Set<VDI> VDIs;
+        /**
+         * describes how particular hosts can see this storage repository
+         */
+        public Set<PBD> PBDs;
+        /**
+         * sum of virtual_sizes of all VDIs in this storage repository (in bytes)
+         */
+        public Long virtualAllocation;
+        /**
+         * physical space currently utilised on this storage repository (in bytes). Note that for sparse disk formats, physical_utilisation may be less than virtual_allocation
+         */
+        public Long physicalUtilisation;
+        /**
+         * total physical size of the repository (in bytes)
+         */
+        public Long physicalSize;
+        /**
+         * type of the storage repository
+         */
+        public String type;
+        /**
+         * the type of the SR's content, if required (e.g. ISOs)
+         */
+        public String contentType;
+        /**
+         * true if this SR is (capable of being) shared between multiple hosts
+         */
+        public Boolean shared;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * SM dependent data
+         */
+        public Map<String, String> smConfig;
+        /**
+         * Binary blobs associated with this SR
+         */
+        public Map<String, Blob> blobs;
+        /**
+         * True if this SR is assigned to be the local cache for its host
+         */
+        public Boolean localCacheEnabled;
+        /**
+         * The disaster recovery task which introduced this SR
+         */
+        public DRTask introducedBy;
+    }
+
+    /**
+     * Get a record containing the current state of the given SR.
+     *
+     * @return all fields from the object
+     */
+    public SR.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSRRecord(result);
+    }
+
+    /**
+     * Get a reference to the SR instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static SR getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get all the SR instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<SR> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSR(result);
+    }
+
+    /**
+     * Get the uuid field of the given SR.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given SR.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given SR.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Set<Types.StorageOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfStorageOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.StorageOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringStorageOperations(result);
+    }
+
+    /**
+     * Get the VDIs field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Set<VDI> getVDIs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_VDIs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVDI(result);
+    }
+
+    /**
+     * Get the PBDs field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Set<PBD> getPBDs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_PBDs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPBD(result);
+    }
+
+    /**
+     * Get the virtual_allocation field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Long getVirtualAllocation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_virtual_allocation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the physical_utilisation field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Long getPhysicalUtilisation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_physical_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the physical_size field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Long getPhysicalSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_physical_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the type field of the given SR.
+     *
+     * @return value of the field
+     */
+    public String getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the content_type field of the given SR.
+     *
+     * @return value of the field
+     */
+    public String getContentType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_content_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the shared field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Boolean getShared(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_shared";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the tags field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the sm_config field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getSmConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the blobs field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Map<String, Blob> getBlobs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_blobs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringBlob(result);
+    }
+
+    /**
+     * Get the local_cache_enabled field of the given SR.
+     *
+     * @return value of the field
+     */
+    public Boolean getLocalCacheEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_local_cache_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the introduced_by field of the given SR.
+     *
+     * @return value of the field
+     */
+    public DRTask getIntroducedBy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_introduced_by";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDRTask(result);
+    }
+
+    /**
+     * Set the other_config field of the given SR.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given SR.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given SR.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the tags field of the given SR.
+     *
+     * @param tags New value to set
+     */
+    public void setTags(Connection c, Set<String> tags) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given value to the tags field of the given SR.  If the value is already in that Set, then do nothing.
+     *
+     * @param value New value to add
+     */
+    public void addTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.add_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given value from the tags field of the given SR.  If the value is not in that Set, then do nothing.
+     *
+     * @param value Value to remove
+     */
+    public void removeTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.remove_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the sm_config field of the given SR.
+     *
+     * @param smConfig New value to set
+     */
+    public void setSmConfig(Connection c, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the sm_config field of the given SR.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToSmConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.add_to_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the sm_config field of the given SR.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromSmConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.remove_from_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a new Storage Repository and introduce it into the managed system, creating both SR record and PBD record to attach it to current host (with specified device_config parameters)
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param physicalSize The physical size of the new storage repository
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param shared True if the SR (is capable of) being shared by multiple hosts
+     * @param smConfig Storage backend specific configuration options
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Host host, Map<String, String> deviceConfig, Long physicalSize, String nameLabel, String nameDescription, String type, String contentType, Boolean shared, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrUnknownDriver {
+        String method_call = "Async.SR.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(physicalSize), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(shared), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new Storage Repository and introduce it into the managed system, creating both SR record and PBD record to attach it to current host (with specified device_config parameters)
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param physicalSize The physical size of the new storage repository
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param shared True if the SR (is capable of) being shared by multiple hosts
+     * @param smConfig Storage backend specific configuration options
+     * @return The reference of the newly created Storage Repository.
+     */
+    public static SR create(Connection c, Host host, Map<String, String> deviceConfig, Long physicalSize, String nameLabel, String nameDescription, String type, String contentType, Boolean shared, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrUnknownDriver {
+        String method_call = "SR.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(physicalSize), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(shared), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Introduce a new Storage Repository into the managed system
+     *
+     * @param uuid The uuid assigned to the introduced SR
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param shared True if the SR (is capable of) being shared by multiple hosts
+     * @param smConfig Storage backend specific configuration options
+     * @return Task
+     */
+    public static Task introduceAsync(Connection c, String uuid, String nameLabel, String nameDescription, String type, String contentType, Boolean shared, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(shared), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Introduce a new Storage Repository into the managed system
+     *
+     * @param uuid The uuid assigned to the introduced SR
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param shared True if the SR (is capable of) being shared by multiple hosts
+     * @param smConfig Storage backend specific configuration options
+     * @return The reference of the newly introduced Storage Repository.
+     */
+    public static SR introduce(Connection c, String uuid, String nameLabel, String nameDescription, String type, String contentType, Boolean shared, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(shared), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Create a new Storage Repository on disk. This call is deprecated: use SR.create instead.
+     * @deprecated
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param physicalSize The physical size of the new storage repository
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param smConfig Storage backend specific configuration options
+     * @return Task
+     */
+   @Deprecated public static Task makeAsync(Connection c, Host host, Map<String, String> deviceConfig, Long physicalSize, String nameLabel, String nameDescription, String type, String contentType, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.make";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(physicalSize), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new Storage Repository on disk. This call is deprecated: use SR.create instead.
+     * @deprecated
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param physicalSize The physical size of the new storage repository
+     * @param nameLabel The name of the new storage repository
+     * @param nameDescription The description of the new storage repository
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param contentType The type of the new SRs content, if required (e.g. ISOs)
+     * @param smConfig Storage backend specific configuration options
+     * @return The uuid of the newly created Storage Repository.
+     */
+   @Deprecated public static String make(Connection c, Host host, Map<String, String> deviceConfig, Long physicalSize, String nameLabel, String nameDescription, String type, String contentType, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.make";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(physicalSize), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(contentType), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Destroy specified SR, removing SR-record from database and remove SR from disk. (In order to affect this operation the appropriate device_config is read from the specified SR's PBD on current host)
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrHasPbd {
+        String method_call = "Async.SR.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy specified SR, removing SR-record from database and remove SR from disk. (In order to affect this operation the appropriate device_config is read from the specified SR's PBD on current host)
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrHasPbd {
+        String method_call = "SR.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removing specified SR-record from database, without attempting to remove SR from disk
+     *
+     * @return Task
+     */
+    public Task forgetAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrHasPbd {
+        String method_call = "Async.SR.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removing specified SR-record from database, without attempting to remove SR from disk
+     *
+     */
+    public void forget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrHasPbd {
+        String method_call = "SR.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Refresh the fields on the SR object
+     *
+     * @return Task
+     */
+    public Task updateAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.update";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Refresh the fields on the SR object
+     *
+     */
+    public void update(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.update";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a set of all the SR types supported by the system
+     *
+     * @return the supported SR types
+     */
+    public static Set<String> getSupportedTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_supported_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Refreshes the list of VDIs associated with an SR
+     *
+     * @return Task
+     */
+    public Task scanAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.scan";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Refreshes the list of VDIs associated with an SR
+     *
+     */
+    public void scan(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.scan";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Perform a backend-specific scan, using the given device_config.  If the device_config is complete, then this will return a list of the SRs present of this type on the device, if any.  If the device_config is partial, then a backend-specific scan will be performed, returning results that will guide the user in improving the device_config.
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param smConfig Storage backend specific configuration options
+     * @return Task
+     */
+    public static Task probeAsync(Connection c, Host host, Map<String, String> deviceConfig, String type, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.probe";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Perform a backend-specific scan, using the given device_config.  If the device_config is complete, then this will return a list of the SRs present of this type on the device, if any.  If the device_config is partial, then a backend-specific scan will be performed, returning results that will guide the user in improving the device_config.
+     *
+     * @param host The host to create/make the SR on
+     * @param deviceConfig The device config string that will be passed to backend SR driver
+     * @param type The type of the SR; used to specify the SR backend driver to use
+     * @param smConfig Storage backend specific configuration options
+     * @return An XML fragment containing the scan results.  These are specific to the scan being performed, and the backend.
+     */
+    public static String probe(Connection c, Host host, Map<String, String> deviceConfig, String type, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.probe";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Sets the shared flag on the SR
+     *
+     * @param value True if the SR is shared
+     * @return Task
+     */
+    public Task setSharedAsync(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.set_shared";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Sets the shared flag on the SR
+     *
+     * @param value True if the SR is shared
+     */
+    public void setShared(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_shared";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name label of the SR
+     *
+     * @param value The name label for the SR
+     * @return Task
+     */
+    public Task setNameLabelAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the name label of the SR
+     *
+     * @param value The name label for the SR
+     */
+    public void setNameLabel(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name description of the SR
+     *
+     * @param value The name description for the SR
+     * @return Task
+     */
+    public Task setNameDescriptionAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the name description of the SR
+     *
+     * @param value The name description for the SR
+     */
+    public void setNameDescription(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this SR
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return Task
+     */
+    public Task createNewBlobAsync(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this SR
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return The reference of the blob, needed for populating its data
+     */
+    public Blob createNewBlob(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlob(result);
+    }
+
+    /**
+     * Sets the SR's physical_size field
+     *
+     * @param value The new value of the SR's physical_size
+     */
+    public void setPhysicalSize(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_physical_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the SR's virtual_allocation field
+     *
+     * @param value The new value of the SR's virtual_allocation
+     */
+    public void setVirtualAllocation(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_virtual_allocation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the SR's physical_utilisation field
+     *
+     * @param value The new value of the SR's physical utilisation
+     */
+    public void setPhysicalUtilisation(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.set_physical_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Returns successfully if the given SR can host an HA statefile. Otherwise returns an error to explain why not
+     *
+     * @return Task
+     */
+    public Task assertCanHostHaStatefileAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.assert_can_host_ha_statefile";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Returns successfully if the given SR can host an HA statefile. Otherwise returns an error to explain why not
+     *
+     */
+    public void assertCanHostHaStatefile(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.assert_can_host_ha_statefile";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Returns successfully if the given SR supports database replication. Otherwise returns an error to explain why not.
+     *
+     * @return Task
+     */
+    public Task assertSupportsDatabaseReplicationAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.assert_supports_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Returns successfully if the given SR supports database replication. Otherwise returns an error to explain why not.
+     *
+     */
+    public void assertSupportsDatabaseReplication(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.assert_supports_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @return Task
+     */
+    public Task enableDatabaseReplicationAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.enable_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void enableDatabaseReplication(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.enable_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @return Task
+     */
+    public Task disableDatabaseReplicationAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.SR.disable_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void disableDatabaseReplication(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.disable_database_replication";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the SRs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<SR> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSR(result);
+    }
+
+    /**
+     * Return a map of SR references to SR records for all SRs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<SR, SR.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "SR.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfSRSRRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Secret.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Secret.java b/deps/XenServerJava/src/com/xensource/xenapi/Secret.java
new file mode 100644
index 0000000..418bb88
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Secret.java
@@ -0,0 +1,389 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A secret
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Secret extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Secret(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Secret, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Secret)
+        {
+            Secret other = (Secret) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Secret
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "value", this.value);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a secret.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("value", this.value == null ? "" : this.value);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the secret
+         */
+        public String value;
+        /**
+         * other_config
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given secret.
+     *
+     * @return all fields from the object
+     */
+    public Secret.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSecretRecord(result);
+    }
+
+    /**
+     * Get a reference to the secret instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Secret getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSecret(result);
+    }
+
+    /**
+     * Create a new secret instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Secret.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.secret.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new secret instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static Secret create(Connection c, Secret.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSecret(result);
+    }
+
+    /**
+     * Destroy the specified secret instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.secret.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified secret instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given secret.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the value field of the given secret.
+     *
+     * @return value of the field
+     */
+    public String getValue(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_value";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the other_config field of the given secret.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the value field of the given secret.
+     *
+     * @param value New value to set
+     */
+    public void setValue(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.set_value";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given secret.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given secret.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given secret.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the secrets known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Secret> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSecret(result);
+    }
+
+    /**
+     * Return a map of secret references to secret records for all secrets known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Secret, Secret.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "secret.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfSecretSecretRecord(result);
+    }
+
+}
\ No newline at end of file


[02/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VMAppliance.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMAppliance.java b/deps/XenServerJava/src/com/xensource/xenapi/VMAppliance.java
new file mode 100644
index 0000000..a0eb0d6
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VMAppliance.java
@@ -0,0 +1,655 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * VM appliance
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VMAppliance extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VMAppliance(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VMAppliance, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VMAppliance)
+        {
+            VMAppliance other = (VMAppliance) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VMAppliance
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "VMs", this.VMs);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VM_appliance.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.VmApplianceOperation>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.VmApplianceOperation>() : this.currentOperations);
+            map.put("VMs", this.VMs == null ? new LinkedHashSet<VM>() : this.VMs);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.VmApplianceOperation> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.VmApplianceOperation> currentOperations;
+        /**
+         * all VMs in this appliance
+         */
+        public Set<VM> VMs;
+    }
+
+    /**
+     * Get a record containing the current state of the given VM_appliance.
+     *
+     * @return all fields from the object
+     */
+    public VMAppliance.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMApplianceRecord(result);
+    }
+
+    /**
+     * Get a reference to the VM_appliance instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VMAppliance getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMAppliance(result);
+    }
+
+    /**
+     * Create a new VM_appliance instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VMAppliance.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VM_appliance.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VM_appliance instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VMAppliance create(Connection c, VMAppliance.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMAppliance(result);
+    }
+
+    /**
+     * Destroy the specified VM_appliance instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VM_appliance.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VM_appliance instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get all the VM_appliance instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<VMAppliance> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMAppliance(result);
+    }
+
+    /**
+     * Get the uuid field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public Set<Types.VmApplianceOperation> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVmApplianceOperation(result);
+    }
+
+    /**
+     * Get the current_operations field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.VmApplianceOperation> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringVmApplianceOperation(result);
+    }
+
+    /**
+     * Get the VMs field of the given VM_appliance.
+     *
+     * @return value of the field
+     */
+    public Set<VM> getVMs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_VMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Set the name/label field of the given VM_appliance.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given VM_appliance.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Start all VMs in the appliance
+     *
+     * @param paused Instantiate all VMs belonging to this appliance in paused state if set to true.
+     * @return Task
+     */
+    public Task startAsync(Connection c, Boolean paused) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "Async.VM_appliance.start";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(paused)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Start all VMs in the appliance
+     *
+     * @param paused Instantiate all VMs belonging to this appliance in paused state if set to true.
+     */
+    public void start(Connection c, Boolean paused) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "VM_appliance.start";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(paused)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Perform a clean shutdown of all the VMs in the appliance
+     *
+     * @return Task
+     */
+    public Task cleanShutdownAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "Async.VM_appliance.clean_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Perform a clean shutdown of all the VMs in the appliance
+     *
+     */
+    public void cleanShutdown(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "VM_appliance.clean_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Perform a hard shutdown of all the VMs in the appliance
+     *
+     * @return Task
+     */
+    public Task hardShutdownAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "Async.VM_appliance.hard_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Perform a hard shutdown of all the VMs in the appliance
+     *
+     */
+    public void hardShutdown(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "VM_appliance.hard_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM.
+     *
+     * @return Task
+     */
+    public Task shutdownAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "Async.VM_appliance.shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM.
+     *
+     */
+    public void shutdown(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationPartiallyFailed {
+        String method_call = "VM_appliance.shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Assert whether all SRs required to recover this VM appliance are available.
+     *
+     * @param sessionTo The session to which the VM appliance is to be recovered.
+     * @return Task
+     */
+    public Task assertCanBeRecoveredAsync(Connection c, Session sessionTo) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VmRequiresSr {
+        String method_call = "Async.VM_appliance.assert_can_be_recovered";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sessionTo)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Assert whether all SRs required to recover this VM appliance are available.
+     *
+     * @param sessionTo The session to which the VM appliance is to be recovered.
+     */
+    public void assertCanBeRecovered(Connection c, Session sessionTo) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VmRequiresSr {
+        String method_call = "VM_appliance.assert_can_be_recovered";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sessionTo)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Recover the VM appliance
+     *
+     * @param sessionTo The session to which the VM appliance is to be recovered.
+     * @param force Whether the VMs should replace newer versions of themselves.
+     * @return Task
+     */
+    public Task recoverAsync(Connection c, Session sessionTo, Boolean force) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VmRequiresSr {
+        String method_call = "Async.VM_appliance.recover";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sessionTo), Marshalling.toXMLRPC(force)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Recover the VM appliance
+     *
+     * @param sessionTo The session to which the VM appliance is to be recovered.
+     * @param force Whether the VMs should replace newer versions of themselves.
+     */
+    public void recover(Connection c, Session sessionTo, Boolean force) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VmRequiresSr {
+        String method_call = "VM_appliance.recover";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sessionTo), Marshalling.toXMLRPC(force)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VM_appliances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VMAppliance> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMAppliance(result);
+    }
+
+    /**
+     * Return a map of VM_appliance references to VM_appliance records for all VM_appliances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VMAppliance, VMAppliance.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_appliance.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMApplianceVMApplianceRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java
new file mode 100644
index 0000000..024f6c4
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java
@@ -0,0 +1,487 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics reported by the guest (as opposed to inferred from outside)
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VMGuestMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VMGuestMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VMGuestMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VMGuestMetrics)
+        {
+            VMGuestMetrics other = (VMGuestMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VMGuestMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "osVersion", this.osVersion);
+            print.printf("%1$20s: %2$s\n", "PVDriversVersion", this.PVDriversVersion);
+            print.printf("%1$20s: %2$s\n", "PVDriversUpToDate", this.PVDriversUpToDate);
+            print.printf("%1$20s: %2$s\n", "memory", this.memory);
+            print.printf("%1$20s: %2$s\n", "disks", this.disks);
+            print.printf("%1$20s: %2$s\n", "networks", this.networks);
+            print.printf("%1$20s: %2$s\n", "other", this.other);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "live", this.live);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VM_guest_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("os_version", this.osVersion == null ? new HashMap<String, String>() : this.osVersion);
+            map.put("PV_drivers_version", this.PVDriversVersion == null ? new HashMap<String, String>() : this.PVDriversVersion);
+            map.put("PV_drivers_up_to_date", this.PVDriversUpToDate == null ? false : this.PVDriversUpToDate);
+            map.put("memory", this.memory == null ? new HashMap<String, String>() : this.memory);
+            map.put("disks", this.disks == null ? new HashMap<String, String>() : this.disks);
+            map.put("networks", this.networks == null ? new HashMap<String, String>() : this.networks);
+            map.put("other", this.other == null ? new HashMap<String, String>() : this.other);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("live", this.live == null ? false : this.live);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * version of the OS
+         */
+        public Map<String, String> osVersion;
+        /**
+         * version of the PV drivers
+         */
+        public Map<String, String> PVDriversVersion;
+        /**
+         * true if the PV drivers appear to be up to date
+         */
+        public Boolean PVDriversUpToDate;
+        /**
+         * free/used/total memory
+         */
+        public Map<String, String> memory;
+        /**
+         * disk configuration/free space
+         */
+        public Map<String, String> disks;
+        /**
+         * network configuration
+         */
+        public Map<String, String> networks;
+        /**
+         * anything else
+         */
+        public Map<String, String> other;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * True if the guest is sending heartbeat messages via the guest agent
+         */
+        public Boolean live;
+    }
+
+    /**
+     * Get a record containing the current state of the given VM_guest_metrics.
+     *
+     * @return all fields from the object
+     */
+    public VMGuestMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMGuestMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the VM_guest_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VMGuestMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMGuestMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the os_version field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOsVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_os_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the PV_drivers_version field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getPVDriversVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_PV_drivers_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the PV_drivers_up_to_date field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Boolean getPVDriversUpToDate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_PV_drivers_up_to_date";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the memory field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getMemory(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_memory";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the disks field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getDisks(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_disks";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the networks field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getNetworks(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_networks";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the other field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOther(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_other";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the last_updated field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the live field of the given VM_guest_metrics.
+     *
+     * @return value of the field
+     */
+    public Boolean getLive(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_live";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Set the other_config field of the given VM_guest_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VM_guest_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VM_guest_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VM_guest_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VMGuestMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMGuestMetrics(result);
+    }
+
+    /**
+     * Return a map of VM_guest_metrics references to VM_guest_metrics records for all VM_guest_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VMGuestMetrics, VMGuestMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_guest_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMGuestMetricsVMGuestMetricsRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java
new file mode 100644
index 0000000..30f4984
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java
@@ -0,0 +1,510 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics associated with a VM
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VMMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VMMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VMMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VMMetrics)
+        {
+            VMMetrics other = (VMMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VMMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "memoryActual", this.memoryActual);
+            print.printf("%1$20s: %2$s\n", "VCPUsNumber", this.VCPUsNumber);
+            print.printf("%1$20s: %2$s\n", "VCPUsUtilisation", this.VCPUsUtilisation);
+            print.printf("%1$20s: %2$s\n", "VCPUsCPU", this.VCPUsCPU);
+            print.printf("%1$20s: %2$s\n", "VCPUsParams", this.VCPUsParams);
+            print.printf("%1$20s: %2$s\n", "VCPUsFlags", this.VCPUsFlags);
+            print.printf("%1$20s: %2$s\n", "state", this.state);
+            print.printf("%1$20s: %2$s\n", "startTime", this.startTime);
+            print.printf("%1$20s: %2$s\n", "installTime", this.installTime);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VM_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("memory_actual", this.memoryActual == null ? 0 : this.memoryActual);
+            map.put("VCPUs_number", this.VCPUsNumber == null ? 0 : this.VCPUsNumber);
+            map.put("VCPUs_utilisation", this.VCPUsUtilisation == null ? new HashMap<Long, Double>() : this.VCPUsUtilisation);
+            map.put("VCPUs_CPU", this.VCPUsCPU == null ? new HashMap<Long, Long>() : this.VCPUsCPU);
+            map.put("VCPUs_params", this.VCPUsParams == null ? new HashMap<String, String>() : this.VCPUsParams);
+            map.put("VCPUs_flags", this.VCPUsFlags == null ? new HashMap<Long, Set<String>>() : this.VCPUsFlags);
+            map.put("state", this.state == null ? new LinkedHashSet<String>() : this.state);
+            map.put("start_time", this.startTime == null ? new Date(0) : this.startTime);
+            map.put("install_time", this.installTime == null ? new Date(0) : this.installTime);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Guest's actual memory (bytes)
+         */
+        public Long memoryActual;
+        /**
+         * Current number of VCPUs
+         */
+        public Long VCPUsNumber;
+        /**
+         * Utilisation for all of guest's current VCPUs
+         */
+        public Map<Long, Double> VCPUsUtilisation;
+        /**
+         * VCPU to PCPU map
+         */
+        public Map<Long, Long> VCPUsCPU;
+        /**
+         * The live equivalent to VM.VCPUs_params
+         */
+        public Map<String, String> VCPUsParams;
+        /**
+         * CPU flags (blocked,online,running)
+         */
+        public Map<Long, Set<String>> VCPUsFlags;
+        /**
+         * The state of the guest, eg blocked, dying etc
+         */
+        public Set<String> state;
+        /**
+         * Time at which this VM was last booted
+         */
+        public Date startTime;
+        /**
+         * Time at which the VM was installed
+         */
+        public Date installTime;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given VM_metrics.
+     *
+     * @return all fields from the object
+     */
+    public VMMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the VM_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VMMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the memory/actual field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryActual(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_memory_actual";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VCPUs/number field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Long getVCPUsNumber(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_VCPUs_number";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VCPUs/utilisation field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<Long, Double> getVCPUsUtilisation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_VCPUs_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfLongDouble(result);
+    }
+
+    /**
+     * Get the VCPUs/CPU field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<Long, Long> getVCPUsCPU(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_VCPUs_CPU";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfLongLong(result);
+    }
+
+    /**
+     * Get the VCPUs/params field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getVCPUsParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the VCPUs/flags field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<Long, Set<String>> getVCPUsFlags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_VCPUs_flags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfLongSetOfString(result);
+    }
+
+    /**
+     * Get the state field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Set<String> getState(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_state";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the start_time field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getStartTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_start_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the install_time field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getInstallTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_install_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the last_updated field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given VM_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given VM_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VM_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VM_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VM_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VMMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVMMetrics(result);
+    }
+
+    /**
+     * Return a map of VM_metrics references to VM_metrics records for all VM_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VMMetrics, VMMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMMetricsVMMetricsRecord(result);
+    }
+
+}
\ No newline at end of file


[03/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VM.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VM.java b/deps/XenServerJava/src/com/xensource/xenapi/VM.java
new file mode 100644
index 0000000..6ed76af
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VM.java
@@ -0,0 +1,4956 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual machine (or 'guest').
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VM extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VM(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VM, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VM)
+        {
+            VM other = (VM) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VM
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "powerState", this.powerState);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "userVersion", this.userVersion);
+            print.printf("%1$20s: %2$s\n", "isATemplate", this.isATemplate);
+            print.printf("%1$20s: %2$s\n", "suspendVDI", this.suspendVDI);
+            print.printf("%1$20s: %2$s\n", "residentOn", this.residentOn);
+            print.printf("%1$20s: %2$s\n", "affinity", this.affinity);
+            print.printf("%1$20s: %2$s\n", "memoryOverhead", this.memoryOverhead);
+            print.printf("%1$20s: %2$s\n", "memoryTarget", this.memoryTarget);
+            print.printf("%1$20s: %2$s\n", "memoryStaticMax", this.memoryStaticMax);
+            print.printf("%1$20s: %2$s\n", "memoryDynamicMax", this.memoryDynamicMax);
+            print.printf("%1$20s: %2$s\n", "memoryDynamicMin", this.memoryDynamicMin);
+            print.printf("%1$20s: %2$s\n", "memoryStaticMin", this.memoryStaticMin);
+            print.printf("%1$20s: %2$s\n", "VCPUsParams", this.VCPUsParams);
+            print.printf("%1$20s: %2$s\n", "VCPUsMax", this.VCPUsMax);
+            print.printf("%1$20s: %2$s\n", "VCPUsAtStartup", this.VCPUsAtStartup);
+            print.printf("%1$20s: %2$s\n", "actionsAfterShutdown", this.actionsAfterShutdown);
+            print.printf("%1$20s: %2$s\n", "actionsAfterReboot", this.actionsAfterReboot);
+            print.printf("%1$20s: %2$s\n", "actionsAfterCrash", this.actionsAfterCrash);
+            print.printf("%1$20s: %2$s\n", "consoles", this.consoles);
+            print.printf("%1$20s: %2$s\n", "VIFs", this.VIFs);
+            print.printf("%1$20s: %2$s\n", "VBDs", this.VBDs);
+            print.printf("%1$20s: %2$s\n", "crashDumps", this.crashDumps);
+            print.printf("%1$20s: %2$s\n", "VTPMs", this.VTPMs);
+            print.printf("%1$20s: %2$s\n", "PVBootloader", this.PVBootloader);
+            print.printf("%1$20s: %2$s\n", "PVKernel", this.PVKernel);
+            print.printf("%1$20s: %2$s\n", "PVRamdisk", this.PVRamdisk);
+            print.printf("%1$20s: %2$s\n", "PVArgs", this.PVArgs);
+            print.printf("%1$20s: %2$s\n", "PVBootloaderArgs", this.PVBootloaderArgs);
+            print.printf("%1$20s: %2$s\n", "PVLegacyArgs", this.PVLegacyArgs);
+            print.printf("%1$20s: %2$s\n", "HVMBootPolicy", this.HVMBootPolicy);
+            print.printf("%1$20s: %2$s\n", "HVMBootParams", this.HVMBootParams);
+            print.printf("%1$20s: %2$s\n", "HVMShadowMultiplier", this.HVMShadowMultiplier);
+            print.printf("%1$20s: %2$s\n", "platform", this.platform);
+            print.printf("%1$20s: %2$s\n", "PCIBus", this.PCIBus);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "domid", this.domid);
+            print.printf("%1$20s: %2$s\n", "domarch", this.domarch);
+            print.printf("%1$20s: %2$s\n", "lastBootCPUFlags", this.lastBootCPUFlags);
+            print.printf("%1$20s: %2$s\n", "isControlDomain", this.isControlDomain);
+            print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+            print.printf("%1$20s: %2$s\n", "guestMetrics", this.guestMetrics);
+            print.printf("%1$20s: %2$s\n", "lastBootedRecord", this.lastBootedRecord);
+            print.printf("%1$20s: %2$s\n", "recommendations", this.recommendations);
+            print.printf("%1$20s: %2$s\n", "xenstoreData", this.xenstoreData);
+            print.printf("%1$20s: %2$s\n", "haAlwaysRun", this.haAlwaysRun);
+            print.printf("%1$20s: %2$s\n", "haRestartPriority", this.haRestartPriority);
+            print.printf("%1$20s: %2$s\n", "isASnapshot", this.isASnapshot);
+            print.printf("%1$20s: %2$s\n", "snapshotOf", this.snapshotOf);
+            print.printf("%1$20s: %2$s\n", "snapshots", this.snapshots);
+            print.printf("%1$20s: %2$s\n", "snapshotTime", this.snapshotTime);
+            print.printf("%1$20s: %2$s\n", "transportableSnapshotId", this.transportableSnapshotId);
+            print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "blockedOperations", this.blockedOperations);
+            print.printf("%1$20s: %2$s\n", "snapshotInfo", this.snapshotInfo);
+            print.printf("%1$20s: %2$s\n", "snapshotMetadata", this.snapshotMetadata);
+            print.printf("%1$20s: %2$s\n", "parent", this.parent);
+            print.printf("%1$20s: %2$s\n", "children", this.children);
+            print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
+            print.printf("%1$20s: %2$s\n", "protectionPolicy", this.protectionPolicy);
+            print.printf("%1$20s: %2$s\n", "isSnapshotFromVmpp", this.isSnapshotFromVmpp);
+            print.printf("%1$20s: %2$s\n", "appliance", this.appliance);
+            print.printf("%1$20s: %2$s\n", "startDelay", this.startDelay);
+            print.printf("%1$20s: %2$s\n", "shutdownDelay", this.shutdownDelay);
+            print.printf("%1$20s: %2$s\n", "order", this.order);
+            print.printf("%1$20s: %2$s\n", "VGPUs", this.VGPUs);
+            print.printf("%1$20s: %2$s\n", "attachedPCIs", this.attachedPCIs);
+            print.printf("%1$20s: %2$s\n", "suspendSR", this.suspendSR);
+            print.printf("%1$20s: %2$s\n", "version", this.version);
+            print.printf("%1$20s: %2$s\n", "generationId", this.generationId);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VM.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.VmOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.VmOperations>() : this.currentOperations);
+            map.put("power_state", this.powerState == null ? Types.VmPowerState.UNRECOGNIZED : this.powerState);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("user_version", this.userVersion == null ? 0 : this.userVersion);
+            map.put("is_a_template", this.isATemplate == null ? false : this.isATemplate);
+            map.put("suspend_VDI", this.suspendVDI == null ? new VDI("OpaqueRef:NULL") : this.suspendVDI);
+            map.put("resident_on", this.residentOn == null ? new Host("OpaqueRef:NULL") : this.residentOn);
+            map.put("affinity", this.affinity == null ? new Host("OpaqueRef:NULL") : this.affinity);
+            map.put("memory_overhead", this.memoryOverhead == null ? 0 : this.memoryOverhead);
+            map.put("memory_target", this.memoryTarget == null ? 0 : this.memoryTarget);
+            map.put("memory_static_max", this.memoryStaticMax == null ? 0 : this.memoryStaticMax);
+            map.put("memory_dynamic_max", this.memoryDynamicMax == null ? 0 : this.memoryDynamicMax);
+            map.put("memory_dynamic_min", this.memoryDynamicMin == null ? 0 : this.memoryDynamicMin);
+            map.put("memory_static_min", this.memoryStaticMin == null ? 0 : this.memoryStaticMin);
+            map.put("VCPUs_params", this.VCPUsParams == null ? new HashMap<String, String>() : this.VCPUsParams);
+            map.put("VCPUs_max", this.VCPUsMax == null ? 0 : this.VCPUsMax);
+            map.put("VCPUs_at_startup", this.VCPUsAtStartup == null ? 0 : this.VCPUsAtStartup);
+            map.put("actions_after_shutdown", this.actionsAfterShutdown == null ? Types.OnNormalExit.UNRECOGNIZED : this.actionsAfterShutdown);
+            map.put("actions_after_reboot", this.actionsAfterReboot == null ? Types.OnNormalExit.UNRECOGNIZED : this.actionsAfterReboot);
+            map.put("actions_after_crash", this.actionsAfterCrash == null ? Types.OnCrashBehaviour.UNRECOGNIZED : this.actionsAfterCrash);
+            map.put("consoles", this.consoles == null ? new LinkedHashSet<Console>() : this.consoles);
+            map.put("VIFs", this.VIFs == null ? new LinkedHashSet<VIF>() : this.VIFs);
+            map.put("VBDs", this.VBDs == null ? new LinkedHashSet<VBD>() : this.VBDs);
+            map.put("crash_dumps", this.crashDumps == null ? new LinkedHashSet<Crashdump>() : this.crashDumps);
+            map.put("VTPMs", this.VTPMs == null ? new LinkedHashSet<VTPM>() : this.VTPMs);
+            map.put("PV_bootloader", this.PVBootloader == null ? "" : this.PVBootloader);
+            map.put("PV_kernel", this.PVKernel == null ? "" : this.PVKernel);
+            map.put("PV_ramdisk", this.PVRamdisk == null ? "" : this.PVRamdisk);
+            map.put("PV_args", this.PVArgs == null ? "" : this.PVArgs);
+            map.put("PV_bootloader_args", this.PVBootloaderArgs == null ? "" : this.PVBootloaderArgs);
+            map.put("PV_legacy_args", this.PVLegacyArgs == null ? "" : this.PVLegacyArgs);
+            map.put("HVM_boot_policy", this.HVMBootPolicy == null ? "" : this.HVMBootPolicy);
+            map.put("HVM_boot_params", this.HVMBootParams == null ? new HashMap<String, String>() : this.HVMBootParams);
+            map.put("HVM_shadow_multiplier", this.HVMShadowMultiplier == null ? 0.0 : this.HVMShadowMultiplier);
+            map.put("platform", this.platform == null ? new HashMap<String, String>() : this.platform);
+            map.put("PCI_bus", this.PCIBus == null ? "" : this.PCIBus);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("domid", this.domid == null ? 0 : this.domid);
+            map.put("domarch", this.domarch == null ? "" : this.domarch);
+            map.put("last_boot_CPU_flags", this.lastBootCPUFlags == null ? new HashMap<String, String>() : this.lastBootCPUFlags);
+            map.put("is_control_domain", this.isControlDomain == null ? false : this.isControlDomain);
+            map.put("metrics", this.metrics == null ? new VMMetrics("OpaqueRef:NULL") : this.metrics);
+            map.put("guest_metrics", this.guestMetrics == null ? new VMGuestMetrics("OpaqueRef:NULL") : this.guestMetrics);
+            map.put("last_booted_record", this.lastBootedRecord == null ? "" : this.lastBootedRecord);
+            map.put("recommendations", this.recommendations == null ? "" : this.recommendations);
+            map.put("xenstore_data", this.xenstoreData == null ? new HashMap<String, String>() : this.xenstoreData);
+            map.put("ha_always_run", this.haAlwaysRun == null ? false : this.haAlwaysRun);
+            map.put("ha_restart_priority", this.haRestartPriority == null ? "" : this.haRestartPriority);
+            map.put("is_a_snapshot", this.isASnapshot == null ? false : this.isASnapshot);
+            map.put("snapshot_of", this.snapshotOf == null ? new VM("OpaqueRef:NULL") : this.snapshotOf);
+            map.put("snapshots", this.snapshots == null ? new LinkedHashSet<VM>() : this.snapshots);
+            map.put("snapshot_time", this.snapshotTime == null ? new Date(0) : this.snapshotTime);
+            map.put("transportable_snapshot_id", this.transportableSnapshotId == null ? "" : this.transportableSnapshotId);
+            map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("blocked_operations", this.blockedOperations == null ? new HashMap<Types.VmOperations, String>() : this.blockedOperations);
+            map.put("snapshot_info", this.snapshotInfo == null ? new HashMap<String, String>() : this.snapshotInfo);
+            map.put("snapshot_metadata", this.snapshotMetadata == null ? "" : this.snapshotMetadata);
+            map.put("parent", this.parent == null ? new VM("OpaqueRef:NULL") : this.parent);
+            map.put("children", this.children == null ? new LinkedHashSet<VM>() : this.children);
+            map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
+            map.put("protection_policy", this.protectionPolicy == null ? new VMPP("OpaqueRef:NULL") : this.protectionPolicy);
+            map.put("is_snapshot_from_vmpp", this.isSnapshotFromVmpp == null ? false : this.isSnapshotFromVmpp);
+            map.put("appliance", this.appliance == null ? new VMAppliance("OpaqueRef:NULL") : this.appliance);
+            map.put("start_delay", this.startDelay == null ? 0 : this.startDelay);
+            map.put("shutdown_delay", this.shutdownDelay == null ? 0 : this.shutdownDelay);
+            map.put("order", this.order == null ? 0 : this.order);
+            map.put("VGPUs", this.VGPUs == null ? new LinkedHashSet<VGPU>() : this.VGPUs);
+            map.put("attached_PCIs", this.attachedPCIs == null ? new LinkedHashSet<PCI>() : this.attachedPCIs);
+            map.put("suspend_SR", this.suspendSR == null ? new SR("OpaqueRef:NULL") : this.suspendSR);
+            map.put("version", this.version == null ? 0 : this.version);
+            map.put("generation_id", this.generationId == null ? "" : this.generationId);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.VmOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.VmOperations> currentOperations;
+        /**
+         * Current power state of the machine
+         */
+        public Types.VmPowerState powerState;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * a user version number for this machine
+         */
+        public Long userVersion;
+        /**
+         * true if this is a template. Template VMs can never be started, they are used only for cloning other VMs
+         */
+        public Boolean isATemplate;
+        /**
+         * The VDI that a suspend image is stored on. (Only has meaning if VM is currently suspended)
+         */
+        public VDI suspendVDI;
+        /**
+         * the host the VM is currently resident on
+         */
+        public Host residentOn;
+        /**
+         * a host which the VM has some affinity for (or NULL). This is used as a hint to the start call when it decides where to run the VM. Implementations are free to ignore this field.
+         */
+        public Host affinity;
+        /**
+         * Virtualization memory overhead (bytes).
+         */
+        public Long memoryOverhead;
+        /**
+         * Dynamically-set memory target (bytes). The value of this field indicates the current target for memory available to this VM.
+         */
+        public Long memoryTarget;
+        /**
+         * Statically-set (i.e. absolute) maximum (bytes). The value of this field at VM start time acts as a hard limit of the amount of memory a guest can use. New values only take effect on reboot.
+         */
+        public Long memoryStaticMax;
+        /**
+         * Dynamic maximum (bytes)
+         */
+        public Long memoryDynamicMax;
+        /**
+         * Dynamic minimum (bytes)
+         */
+        public Long memoryDynamicMin;
+        /**
+         * Statically-set (i.e. absolute) mininum (bytes). The value of this field indicates the least amount of memory this VM can boot with without crashing.
+         */
+        public Long memoryStaticMin;
+        /**
+         * configuration parameters for the selected VCPU policy
+         */
+        public Map<String, String> VCPUsParams;
+        /**
+         * Max number of VCPUs
+         */
+        public Long VCPUsMax;
+        /**
+         * Boot number of VCPUs
+         */
+        public Long VCPUsAtStartup;
+        /**
+         * action to take after the guest has shutdown itself
+         */
+        public Types.OnNormalExit actionsAfterShutdown;
+        /**
+         * action to take after the guest has rebooted itself
+         */
+        public Types.OnNormalExit actionsAfterReboot;
+        /**
+         * action to take if the guest crashes
+         */
+        public Types.OnCrashBehaviour actionsAfterCrash;
+        /**
+         * virtual console devices
+         */
+        public Set<Console> consoles;
+        /**
+         * virtual network interfaces
+         */
+        public Set<VIF> VIFs;
+        /**
+         * virtual block devices
+         */
+        public Set<VBD> VBDs;
+        /**
+         * crash dumps associated with this VM
+         */
+        public Set<Crashdump> crashDumps;
+        /**
+         * virtual TPMs
+         */
+        public Set<VTPM> VTPMs;
+        /**
+         * name of or path to bootloader
+         */
+        public String PVBootloader;
+        /**
+         * path to the kernel
+         */
+        public String PVKernel;
+        /**
+         * path to the initrd
+         */
+        public String PVRamdisk;
+        /**
+         * kernel command-line arguments
+         */
+        public String PVArgs;
+        /**
+         * miscellaneous arguments for the bootloader
+         */
+        public String PVBootloaderArgs;
+        /**
+         * to make Zurich guests boot
+         */
+        public String PVLegacyArgs;
+        /**
+         * HVM boot policy
+         */
+        public String HVMBootPolicy;
+        /**
+         * HVM boot params
+         */
+        public Map<String, String> HVMBootParams;
+        /**
+         * multiplier applied to the amount of shadow that will be made available to the guest
+         */
+        public Double HVMShadowMultiplier;
+        /**
+         * platform-specific configuration
+         */
+        public Map<String, String> platform;
+        /**
+         * PCI bus path for pass-through devices
+         */
+        public String PCIBus;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * domain ID (if available, -1 otherwise)
+         */
+        public Long domid;
+        /**
+         * Domain architecture (if available, null string otherwise)
+         */
+        public String domarch;
+        /**
+         * describes the CPU flags on which the VM was last booted
+         */
+        public Map<String, String> lastBootCPUFlags;
+        /**
+         * true if this is a control domain (domain 0 or a driver domain)
+         */
+        public Boolean isControlDomain;
+        /**
+         * metrics associated with this VM
+         */
+        public VMMetrics metrics;
+        /**
+         * metrics associated with the running guest
+         */
+        public VMGuestMetrics guestMetrics;
+        /**
+         * marshalled value containing VM record at time of last boot, updated dynamically to reflect the runtime state of the domain
+         */
+        public String lastBootedRecord;
+        /**
+         * An XML specification of recommended values and ranges for properties of this VM
+         */
+        public String recommendations;
+        /**
+         * data to be inserted into the xenstore tree (/local/domain/<domid>/vm-data) after the VM is created.
+         */
+        public Map<String, String> xenstoreData;
+        /**
+         * if true then the system will attempt to keep the VM running as much as possible.
+         */
+        public Boolean haAlwaysRun;
+        /**
+         * has possible values: "best-effort" meaning "try to restart this VM if possible but don't consider the Pool to be overcommitted if this is not possible"; "restart" meaning "this VM should be restarted"; "" meaning "do not try to restart this VM"
+         */
+        public String haRestartPriority;
+        /**
+         * true if this is a snapshot. Snapshotted VMs can never be started, they are used only for cloning other VMs
+         */
+        public Boolean isASnapshot;
+        /**
+         * Ref pointing to the VM this snapshot is of.
+         */
+        public VM snapshotOf;
+        /**
+         * List pointing to all the VM snapshots.
+         */
+        public Set<VM> snapshots;
+        /**
+         * Date/time when this snapshot was created.
+         */
+        public Date snapshotTime;
+        /**
+         * Transportable ID of the snapshot VM
+         */
+        public String transportableSnapshotId;
+        /**
+         * Binary blobs associated with this VM
+         */
+        public Map<String, Blob> blobs;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * List of operations which have been explicitly blocked and an error code
+         */
+        public Map<Types.VmOperations, String> blockedOperations;
+        /**
+         * Human-readable information concerning this snapshot
+         */
+        public Map<String, String> snapshotInfo;
+        /**
+         * Encoded information about the VM's metadata this is a snapshot of
+         */
+        public String snapshotMetadata;
+        /**
+         * Ref pointing to the parent of this VM
+         */
+        public VM parent;
+        /**
+         * List pointing to all the children of this VM
+         */
+        public Set<VM> children;
+        /**
+         * BIOS strings
+         */
+        public Map<String, String> biosStrings;
+        /**
+         * Ref pointing to a protection policy for this VM
+         */
+        public VMPP protectionPolicy;
+        /**
+         * true if this snapshot was created by the protection policy
+         */
+        public Boolean isSnapshotFromVmpp;
+        /**
+         * the appliance to which this VM belongs
+         */
+        public VMAppliance appliance;
+        /**
+         * The delay to wait before proceeding to the next order in the startup sequence (seconds)
+         */
+        public Long startDelay;
+        /**
+         * The delay to wait before proceeding to the next order in the shutdown sequence (seconds)
+         */
+        public Long shutdownDelay;
+        /**
+         * The point in the startup or shutdown sequence at which this VM will be started
+         */
+        public Long order;
+        /**
+         * Virtual GPUs
+         */
+        public Set<VGPU> VGPUs;
+        /**
+         * Currently passed-through PCI devices
+         */
+        public Set<PCI> attachedPCIs;
+        /**
+         * The SR on which a suspend image is stored
+         */
+        public SR suspendSR;
+        /**
+         * The number of times this VM has been recovered
+         */
+        public Long version;
+        /**
+         * Generation ID of the VM
+         */
+        public String generationId;
+    }
+
+    /**
+     * Get a record containing the current state of the given VM.
+     *
+     * @return all fields from the object
+     */
+    public VM.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMRecord(result);
+    }
+
+    /**
+     * Get a reference to the VM instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VM getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Create a new VM instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VM.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VM.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VM instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VM create(Connection c, VM.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Destroy the specified VM.  The VM is completely removed from the system.  This function can only be called when the VM is in the Halted State.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VM.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VM.  The VM is completely removed from the system.  This function can only be called when the VM is in the Halted State.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get all the VM instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<VM> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Get the uuid field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<Types.VmOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVmOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.VmOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringVmOperations(result);
+    }
+
+    /**
+     * Get the power_state field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Types.VmPowerState getPowerState(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_power_state";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVmPowerState(result);
+    }
+
+    /**
+     * Get the name/label field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the user_version field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getUserVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_user_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the is_a_template field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsATemplate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_is_a_template";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the suspend_VDI field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VDI getSuspendVDI(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_suspend_VDI";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the resident_on field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Host getResidentOn(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_resident_on";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the affinity field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Host getAffinity(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_affinity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the memory/overhead field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryOverhead(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_overhead";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/target field of the given VM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public Long getMemoryTarget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_target";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/static_max field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryStaticMax(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_static_max";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/dynamic_max field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryDynamicMax(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_dynamic_max";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/dynamic_min field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryDynamicMin(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_dynamic_min";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/static_min field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryStaticMin(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_memory_static_min";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VCPUs/params field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getVCPUsParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the VCPUs/max field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getVCPUsMax(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VCPUs_max";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VCPUs/at_startup field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getVCPUsAtStartup(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VCPUs_at_startup";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the actions/after_shutdown field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Types.OnNormalExit getActionsAfterShutdown(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_actions_after_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toOnNormalExit(result);
+    }
+
+    /**
+     * Get the actions/after_reboot field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Types.OnNormalExit getActionsAfterReboot(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_actions_after_reboot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toOnNormalExit(result);
+    }
+
+    /**
+     * Get the actions/after_crash field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Types.OnCrashBehaviour getActionsAfterCrash(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_actions_after_crash";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toOnCrashBehaviour(result);
+    }
+
+    /**
+     * Get the consoles field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<Console> getConsoles(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_consoles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfConsole(result);
+    }
+
+    /**
+     * Get the VIFs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VIF> getVIFs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VIFs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVIF(result);
+    }
+
+    /**
+     * Get the VBDs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VBD> getVBDs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VBDs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVBD(result);
+    }
+
+    /**
+     * Get the crash_dumps field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<Crashdump> getCrashDumps(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_crash_dumps";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfCrashdump(result);
+    }
+
+    /**
+     * Get the VTPMs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VTPM> getVTPMs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VTPMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVTPM(result);
+    }
+
+    /**
+     * Get the PV/bootloader field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVBootloader(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_bootloader";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PV/kernel field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVKernel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_kernel";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PV/ramdisk field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVRamdisk(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_ramdisk";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PV/args field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVArgs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PV/bootloader_args field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVBootloaderArgs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_bootloader_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PV/legacy_args field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getPVLegacyArgs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PV_legacy_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the HVM/boot_policy field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getHVMBootPolicy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_HVM_boot_policy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the HVM/boot_params field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getHVMBootParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_HVM_boot_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the HVM/shadow_multiplier field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Double getHVMShadowMultiplier(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_HVM_shadow_multiplier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the platform field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getPlatform(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_platform";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the PCI_bus field of the given VM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public String getPCIBus(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_PCI_bus";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the other_config field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the domid field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getDomid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_domid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the domarch field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getDomarch(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_domarch";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the last_boot_CPU_flags field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getLastBootCPUFlags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_last_boot_CPU_flags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the is_control_domain field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsControlDomain(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_is_control_domain";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the metrics field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VMMetrics getMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMMetrics(result);
+    }
+
+    /**
+     * Get the guest_metrics field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VMGuestMetrics getGuestMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_guest_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMGuestMetrics(result);
+    }
+
+    /**
+     * Get the last_booted_record field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getLastBootedRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_last_booted_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the recommendations field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getRecommendations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_recommendations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the xenstore_data field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getXenstoreData(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_xenstore_data";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the ha_always_run field of the given VM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public Boolean getHaAlwaysRun(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_ha_always_run";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the ha_restart_priority field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getHaRestartPriority(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_ha_restart_priority";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the is_a_snapshot field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsASnapshot(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_is_a_snapshot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the snapshot_of field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VM getSnapshotOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_snapshot_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the snapshots field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VM> getSnapshots(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_snapshots";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Get the snapshot_time field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Date getSnapshotTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_snapshot_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the transportable_snapshot_id field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getTransportableSnapshotId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_transportable_snapshot_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the blobs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, Blob> getBlobs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_blobs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringBlob(result);
+    }
+
+    /**
+     * Get the tags field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the blocked_operations field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<Types.VmOperations, String> getBlockedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_blocked_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVmOperationsString(result);
+    }
+
+    /**
+     * Get the snapshot_info field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getSnapshotInfo(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_snapshot_info";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the snapshot_metadata field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getSnapshotMetadata(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_snapshot_metadata";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the parent field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VM getParent(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_parent";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the children field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VM> getChildren(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_children";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Get the bios_strings field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getBiosStrings(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_bios_strings";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the protection_policy field of the given VM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public VMPP getProtectionPolicy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_protection_policy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMPP(result);
+    }
+
+    /**
+     * Get the is_snapshot_from_vmpp field of the given VM.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public Boolean getIsSnapshotFromVmpp(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_is_snapshot_from_vmpp";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the appliance field of the given VM.
+     *
+     * @return value of the field
+     */
+    public VMAppliance getAppliance(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_appliance";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVMAppliance(result);
+    }
+
+    /**
+     * Get the start_delay field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getStartDelay(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_start_delay";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the shutdown_delay field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getShutdownDelay(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_shutdown_delay";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the order field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getOrder(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_order";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VGPUs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<VGPU> getVGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_VGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPU(result);
+    }
+
+    /**
+     * Get the attached_PCIs field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Set<PCI> getAttachedPCIs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_attached_PCIs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPCI(result);
+    }
+
+    /**
+     * Get the suspend_SR field of the given VM.
+     *
+     * @return value of the field
+     */
+    public SR getSuspendSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_suspend_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the version field of the given VM.
+     *
+     * @return value of the field
+     */
+    public Long getVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the generation_id field of the given VM.
+     *
+     * @return value of the field
+     */
+    public String getGenerationId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.get_generation_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Set the name/label field of the given VM.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given VM.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the user_version field of the given VM.
+     *
+     * @param userVersion New value to set
+     */
+    public void setUserVersion(Connection c, Long userVersion) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_user_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(userVersion)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the is_a_template field of the given VM.
+     *
+     * @param isATemplate New value to set
+     */
+    public void setIsATemplate(Connection c, Boolean isATemplate) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_is_a_template";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(isATemplate)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the affinity field of the given VM.
+     *
+     * @param affinity New value to set
+     */
+    public void setAffinity(Connection c, Host affinity) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_affinity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(affinity)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the VCPUs/params field of the given VM.
+     *
+     * @param params New value to set
+     */
+    public void setVCPUsParams(Connection c, Map<String, String> params) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(params)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the VCPUs/params field of the given VM.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToVCPUsParams(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.add_to_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the VCPUs/params field of the given VM.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromVCPUsParams(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.remove_from_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the actions/after_shutdown field of the given VM.
+     *
+     * @param afterShutdown New value to set
+     */
+    public void setActionsAfterShutdown(Connection c, Types.OnNormalExit afterShutdown) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_actions_after_shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(afterShutdown)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the actions/after_reboot field of the given VM.
+     *
+     * @param afterReboot New value to set
+     */
+    public void setActionsAfterReboot(Connection c, Types.OnNormalExit afterReboot) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_actions_after_reboot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(afterReboot)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the actions/after_crash field of the given VM.
+     *
+     * @param afterCrash New value to set
+     */
+    public void setActionsAfterCrash(Connection c, Types.OnCrashBehaviour afterCrash) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_actions_after_crash";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(afterCrash)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/bootloader field of the given VM.
+     *
+     * @param bootloader New value to set
+     */
+    public void setPVBootloader(Connection c, String bootloader) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_bootloader";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(bootloader)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/kernel field of the given VM.
+     *
+     * @param kernel New value to set
+     */
+    public void setPVKernel(Connection c, String kernel) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_kernel";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(kernel)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/ramdisk field of the given VM.
+     *
+     * @param ramdisk New value to set
+     */
+    public void setPVRamdisk(Connection c, String ramdisk) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_ramdisk";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(ramdisk)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/args field of the given VM.
+     *
+     * @param args New value to set
+     */
+    public void setPVArgs(Connection c, String args) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(args)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/bootloader_args field of the given VM.
+     *
+     * @param bootloaderArgs New value to set
+     */
+    public void setPVBootloaderArgs(Connection c, String bootloaderArgs) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_bootloader_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(bootloaderArgs)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the PV/legacy_args field of the given VM.
+     *
+     * @param legacyArgs New value to set
+     */
+    public void setPVLegacyArgs(Connection c, String legacyArgs) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VM.set_PV_legacy_args";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(legacyArgs)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the HVM/boot_policy field of the given VM.
+     *
+     * @param bootPolicy New value to set
+    

<TRUNCATED>

[08/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Types.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Types.java b/deps/XenServerJava/src/com/xensource/xenapi/Types.java
new file mode 100644
index 0000000..50f49a0
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Types.java
@@ -0,0 +1,13529 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.LinkedHashSet;
+import java.io.IOException;
+
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * This class holds vital marshalling functions, enum types and exceptions.
+ * 
+ * @author Citrix Systems, Inc.
+ */
+public class Types
+{
+    /**
+     * Interface for all Record classes
+     */
+    public static interface Record
+    {
+        /**
+         * Convert a Record to a Map
+         */
+        Map<String, Object> toMap();
+    }
+
+    /**
+     * Helper method.
+     */
+    private static String[] ObjectArrayToStringArray(Object[] objArray)
+    {
+        String[] result = new String[objArray.length];
+        for (int i = 0; i < objArray.length; i++)
+        {
+            result[i] = (String) objArray[i];
+        }
+        return result;
+    }
+
+    /**
+     * Base class for all XenAPI Exceptions
+     */
+    public static class XenAPIException extends IOException {
+        public final String shortDescription;
+        public final String[] errorDescription;
+
+        XenAPIException(String shortDescription)
+        {
+            this.shortDescription = shortDescription;
+            this.errorDescription = null;
+        }
+
+        XenAPIException(String[] errorDescription)
+        {
+            this.errorDescription = errorDescription;
+
+            if (errorDescription.length > 0)
+            {
+                shortDescription = errorDescription[0];
+            } else
+            {
+                shortDescription = "";
+            }
+        }
+
+        public String toString()
+        {
+            if (errorDescription == null)
+            {
+                return shortDescription;
+            } else if (errorDescription.length == 0)
+            {
+                return "";
+            }
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < errorDescription.length - 1; i++)
+            {
+                sb.append(errorDescription[i]);
+            }
+            sb.append(errorDescription[errorDescription.length - 1]);
+
+            return sb.toString();
+        }
+    }
+    /**
+     * Thrown if the response from the server contains an invalid status.
+     */
+    public static class BadServerResponse extends XenAPIException
+    {
+        public BadServerResponse(Map response)
+        {
+            super(ObjectArrayToStringArray((Object[]) response.get("ErrorDescription")));
+        }
+    }
+
+    public static class BadAsyncResult extends XenAPIException
+    {
+        public final String result;
+
+        public BadAsyncResult(String result)
+        {
+            super(result);
+            this.result = result;
+        }
+    }
+
+    /*
+     * A call has been made which should not be made against this version of host.
+     * Probably the host is out of date and cannot handle this call, or is
+     * unable to comply with the details of the call.
+     */
+    public static class VersionException extends XenAPIException
+    {
+        public final String result;
+
+        public VersionException(String result)
+        {
+            super(result);
+            this.result = result;
+        }
+    }
+
+    private static String parseResult(String result) throws BadAsyncResult
+    {
+        Pattern pattern = Pattern.compile("<value>(.*)</value>");
+        Matcher matcher = pattern.matcher(result);
+        matcher.find();
+
+        if (matcher.groupCount() != 1)
+        {
+            throw new Types.BadAsyncResult("Can't interpret: " + result);
+        }
+
+        return matcher.group(1);
+    }
+      /**
+     * Checks the provided server response was successful. If the call failed, throws a XenAPIException. If the server
+     * returned an invalid response, throws a BadServerResponse. Otherwise, returns the server response as passed in.
+     */
+    static Map checkResponse(Map response) throws XenAPIException, BadServerResponse
+    {
+        if (response.get("Status").equals("Success"))
+        {
+            return response;
+        }
+
+        if (response.get("Status").equals("Failure"))
+        {
+            String[] ErrorDescription = ObjectArrayToStringArray((Object[]) response.get("ErrorDescription"));
+
+            if (ErrorDescription[0].equals("CANNOT_DESTROY_DISASTER_RECOVERY_TASK"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotDestroyDisasterRecoveryTask(p1);
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_ATTACHED_DISKS_NOT_FOUND"))
+            {
+                throw new Types.ImportErrorAttachedDisksNotFound();
+            }
+            if (ErrorDescription[0].equals("COULD_NOT_IMPORT_DATABASE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CouldNotImportDatabase(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_CANNOT_ATTACH_NETWORK"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.HostCannotAttachNetwork(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_INCOMPATIBLE_WITH_THIS_HOST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VmIncompatibleWithThisHost(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("SESSION_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SessionInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_CREATING_SNAPSHOT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorCreatingSnapshot(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_REVERT_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmRevertFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CPU_FEATURE_MASKING_NOT_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CpuFeatureMaskingNotSupported(p1);
+            }
+            if (ErrorDescription[0].equals("HA_LOST_STATEFILE"))
+            {
+                throw new Types.HaLostStatefile();
+            }
+            if (ErrorDescription[0].equals("VM_CANNOT_DELETE_DEFAULT_TEMPLATE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmCannotDeleteDefaultTemplate(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_ENABLE_FAILED_PERMISSION_DENIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthEnableFailedPermissionDenied(p1);
+            }
+            if (ErrorDescription[0].equals("TOO_BUSY"))
+            {
+                throw new Types.TooBusy();
+            }
+            if (ErrorDescription[0].equals("BACKUP_SCRIPT_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.BackupScriptFailed(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_NOT_LIVE"))
+            {
+                throw new Types.HostNotLive();
+            }
+            if (ErrorDescription[0].equals("LICENSE_EXPIRED"))
+            {
+                throw new Types.LicenseExpired();
+            }
+            if (ErrorDescription[0].equals("VM_REQUIRES_NETWORK"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmRequiresNetwork(p1, p2);
+            }
+            if (ErrorDescription[0].equals("LOCATION_NOT_UNIQUE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.LocationNotUnique(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VGPU_TYPE_NOT_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VgpuTypeNotSupported(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_HAS_NO_MANAGEMENT_IP"))
+            {
+                throw new Types.HostHasNoManagementIp();
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_CREATING_SNAPSHOT_XML_STRING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorCreatingSnapshotXmlString(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CANNOT_PLUG_BOND_SLAVE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotPlugBondSlave(p1);
+            }
+            if (ErrorDescription[0].equals("VGPU_TYPE_NOT_ENABLED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VgpuTypeNotEnabled(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CANNOT_FIND_OEM_BACKUP_PARTITION"))
+            {
+                throw new Types.CannotFindOemBackupPartition();
+            }
+            if (ErrorDescription[0].equals("PIF_ALREADY_BONDED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifAlreadyBonded(p1);
+            }
+            if (ErrorDescription[0].equals("RESTORE_INCOMPATIBLE_VERSION"))
+            {
+                throw new Types.RestoreIncompatibleVersion();
+            }
+            if (ErrorDescription[0].equals("SESSION_AUTHENTICATION_FAILED"))
+            {
+                throw new Types.SessionAuthenticationFailed();
+            }
+            if (ErrorDescription[0].equals("PIF_BOND_NEEDS_MORE_MEMBERS"))
+            {
+                throw new Types.PifBondNeedsMoreMembers();
+            }
+            if (ErrorDescription[0].equals("HA_HEARTBEAT_DAEMON_STARTUP_FAILED"))
+            {
+                throw new Types.HaHeartbeatDaemonStartupFailed();
+            }
+            if (ErrorDescription[0].equals("INVALID_VALUE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.InvalidValue(p1, p2);
+            }
+            if (ErrorDescription[0].equals("INVALID_IP_ADDRESS_SPECIFIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InvalidIpAddressSpecified(p1);
+            }
+            if (ErrorDescription[0].equals("LICENSE_CANNOT_DOWNGRADE_WHILE_IN_POOL"))
+            {
+                throw new Types.LicenseCannotDowngradeWhileInPool();
+            }
+            if (ErrorDescription[0].equals("VMS_FAILED_TO_COOPERATE"))
+            {
+                throw new Types.VmsFailedToCooperate();
+            }
+            if (ErrorDescription[0].equals("HOST_DISABLED_UNTIL_REBOOT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostDisabledUntilReboot(p1);
+            }
+            if (ErrorDescription[0].equals("SYSTEM_STATUS_RETRIEVAL_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SystemStatusRetrievalFailed(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_INCOMPATIBLE_PRIMARY_ADDRESS_TYPE"))
+            {
+                throw new Types.PifIncompatiblePrimaryAddressType();
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_PREMATURE_EOF"))
+            {
+                throw new Types.ImportErrorPrematureEof();
+            }
+            if (ErrorDescription[0].equals("PROVISION_ONLY_ALLOWED_ON_TEMPLATE"))
+            {
+                throw new Types.ProvisionOnlyAllowedOnTemplate();
+            }
+            if (ErrorDescription[0].equals("VBD_NOT_REMOVABLE_MEDIA"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VbdNotRemovableMedia(p1);
+            }
+            if (ErrorDescription[0].equals("GPU_GROUP_CONTAINS_NO_PGPUS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.GpuGroupContainsNoPgpus(p1);
+            }
+            if (ErrorDescription[0].equals("HA_HOST_CANNOT_SEE_PEERS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.HaHostCannotSeePeers(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("AUTH_ENABLE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthEnableFailed(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_NAME_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostNameInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_XENSERVER_CONNECTION_REFUSED"))
+            {
+                throw new Types.WlbXenserverConnectionRefused();
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_NO_VOLUMES_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorNoVolumesSupported(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_NOT_ENOUGH_FREE_MEMORY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.HostNotEnoughFreeMemory(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CANNOT_EVACUATE_HOST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotEvacuateHost(p1);
+            }
+            if (ErrorDescription[0].equals("VM_IS_PART_OF_AN_APPLIANCE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmIsPartOfAnAppliance(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VDI_IS_A_PHYSICAL_DEVICE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiIsAPhysicalDevice(p1);
+            }
+            if (ErrorDescription[0].equals("SR_VDI_LOCKING_FAILED"))
+            {
+                throw new Types.SrVdiLockingFailed();
+            }
+            if (ErrorDescription[0].equals("PIF_VLAN_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifVlanExists(p1);
+            }
+            if (ErrorDescription[0].equals("HOSTS_NOT_COMPATIBLE"))
+            {
+                throw new Types.HostsNotCompatible();
+            }
+            if (ErrorDescription[0].equals("VM_IS_PROTECTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmIsProtected(p1);
+            }
+            if (ErrorDescription[0].equals("HA_POOL_IS_ENABLED_BUT_HOST_IS_DISABLED"))
+            {
+                throw new Types.HaPoolIsEnabledButHostIsDisabled();
+            }
+            if (ErrorDescription[0].equals("V6D_FAILURE"))
+            {
+                throw new Types.V6dFailure();
+            }
+            if (ErrorDescription[0].equals("DEVICE_DETACH_TIMEOUT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.DeviceDetachTimeout(p1, p2);
+            }
+            if (ErrorDescription[0].equals("LICENSE_PROCESSING_ERROR"))
+            {
+                throw new Types.LicenseProcessingError();
+            }
+            if (ErrorDescription[0].equals("PIF_VLAN_STILL_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifVlanStillExists(p1);
+            }
+            if (ErrorDescription[0].equals("VM_REBOOTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmRebooted(p1);
+            }
+            if (ErrorDescription[0].equals("OBJECT_NOLONGER_EXISTS"))
+            {
+                throw new Types.ObjectNolongerExists();
+            }
+            if (ErrorDescription[0].equals("CERTIFICATE_LIBRARY_CORRUPT"))
+            {
+                throw new Types.CertificateLibraryCorrupt();
+            }
+            if (ErrorDescription[0].equals("DUPLICATE_VM"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DuplicateVm(p1);
+            }
+            if (ErrorDescription[0].equals("CERTIFICATE_ALREADY_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CertificateAlreadyExists(p1);
+            }
+            if (ErrorDescription[0].equals("CERTIFICATE_CORRUPT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CertificateCorrupt(p1);
+            }
+            if (ErrorDescription[0].equals("SM_PLUGIN_COMMUNICATION_FAILURE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SmPluginCommunicationFailure(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_DISABLED"))
+            {
+                throw new Types.WlbDisabled();
+            }
+            if (ErrorDescription[0].equals("GPU_GROUP_CONTAINS_PGPU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.GpuGroupContainsPgpu(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_NOT_IN_MAP"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiNotInMap(p1);
+            }
+            if (ErrorDescription[0].equals("LICENCE_RESTRICTION"))
+            {
+                throw new Types.LicenceRestriction();
+            }
+            if (ErrorDescription[0].equals("TOO_MANY_PENDING_TASKS"))
+            {
+                throw new Types.TooManyPendingTasks();
+            }
+            if (ErrorDescription[0].equals("VM_SNAPSHOT_WITH_QUIESCE_TIMEOUT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmSnapshotWithQuiesceTimeout(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_INCOMPATIBLE_TYPE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiIncompatibleType(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VIF_IN_USE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VifInUse(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VMPP_ARCHIVE_MORE_FREQUENT_THAN_BACKUP"))
+            {
+                throw new Types.VmppArchiveMoreFrequentThanBackup();
+            }
+            if (ErrorDescription[0].equals("IMPORT_INCOMPATIBLE_VERSION"))
+            {
+                throw new Types.ImportIncompatibleVersion();
+            }
+            if (ErrorDescription[0].equals("INVALID_EDITION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InvalidEdition(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_SERVICE_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthServiceError(p1);
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_ADDING_VOLUME_TO_SNAPSET_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorAddingVolumeToSnapsetFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("PERMISSION_DENIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PermissionDenied(p1);
+            }
+            if (ErrorDescription[0].equals("DEVICE_ALREADY_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DeviceAlreadyExists(p1);
+            }
+            if (ErrorDescription[0].equals("SR_UUID_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrUuidExists(p1);
+            }
+            if (ErrorDescription[0].equals("VM_HAS_VGPU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHasVgpu(p1);
+            }
+            if (ErrorDescription[0].equals("TOO_MANY_STORAGE_MIGRATES"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.TooManyStorageMigrates(p1);
+            }
+            if (ErrorDescription[0].equals("HA_IS_ENABLED"))
+            {
+                throw new Types.HaIsEnabled();
+            }
+            if (ErrorDescription[0].equals("CANNOT_DESTROY_SYSTEM_NETWORK"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotDestroySystemNetwork(p1);
+            }
+            if (ErrorDescription[0].equals("OPENVSWITCH_NOT_ACTIVE"))
+            {
+                throw new Types.OpenvswitchNotActive();
+            }
+            if (ErrorDescription[0].equals("NOT_IMPLEMENTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.NotImplemented(p1);
+            }
+            if (ErrorDescription[0].equals("VBD_NOT_UNPLUGGABLE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VbdNotUnpluggable(p1);
+            }
+            if (ErrorDescription[0].equals("VM_CRASHED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmCrashed(p1);
+            }
+            if (ErrorDescription[0].equals("VM_BAD_POWER_STATE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VmBadPowerState(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("FEATURE_REQUIRES_HVM"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.FeatureRequiresHvm(p1);
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_UNEXPECTED_FILE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.ImportErrorUnexpectedFile(p1, p2);
+            }
+            if (ErrorDescription[0].equals("SR_NOT_EMPTY"))
+            {
+                throw new Types.SrNotEmpty();
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CANNOT_HAVE_VMS_WITH_CURRENT_OPERATIONS"))
+            {
+                throw new Types.JoiningHostCannotHaveVmsWithCurrentOperations();
+            }
+            if (ErrorDescription[0].equals("VDI_NOT_MANAGED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiNotManaged(p1);
+            }
+            if (ErrorDescription[0].equals("VM_HALTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHalted(p1);
+            }
+            if (ErrorDescription[0].equals("COULD_NOT_FIND_NETWORK_INTERFACE_WITH_SPECIFIED_DEVICE_NAME_AND_MAC_ADDRESS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.CouldNotFindNetworkInterfaceWithSpecifiedDeviceNameAndMacAddress(p1, p2);
+            }
+            if (ErrorDescription[0].equals("SR_BACKEND_FAILURE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.SrBackendFailure(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("RESTORE_TARGET_MISSING_DEVICE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.RestoreTargetMissingDevice(p1);
+            }
+            if (ErrorDescription[0].equals("VM_IS_TEMPLATE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmIsTemplate(p1);
+            }
+            if (ErrorDescription[0].equals("HA_OPERATION_WOULD_BREAK_FAILOVER_PLAN"))
+            {
+                throw new Types.HaOperationWouldBreakFailoverPlan();
+            }
+            if (ErrorDescription[0].equals("VMPP_HAS_VM"))
+            {
+                throw new Types.VmppHasVm();
+            }
+            if (ErrorDescription[0].equals("HANDLE_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.HandleInvalid(p1, p2);
+            }
+            if (ErrorDescription[0].equals("POOL_JOINING_HOST_MUST_HAVE_PHYSICAL_MANAGEMENT_NIC"))
+            {
+                throw new Types.PoolJoiningHostMustHavePhysicalManagementNic();
+            }
+            if (ErrorDescription[0].equals("DEVICE_ALREADY_ATTACHED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DeviceAlreadyAttached(p1);
+            }
+            if (ErrorDescription[0].equals("NOT_SUPPORTED_DURING_UPGRADE"))
+            {
+                throw new Types.NotSupportedDuringUpgrade();
+            }
+            if (ErrorDescription[0].equals("OPERATION_PARTIALLY_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.OperationPartiallyFailed(p1);
+            }
+            if (ErrorDescription[0].equals("OTHER_OPERATION_IN_PROGRESS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.OtherOperationInProgress(p1, p2);
+            }
+            if (ErrorDescription[0].equals("PIF_CANNOT_BOND_CROSS_HOST"))
+            {
+                throw new Types.PifCannotBondCrossHost();
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_WRONG_SERVER_VERSION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.PatchPrecheckFailedWrongServerVersion(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("CANNOT_PLUG_VIF"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotPlugVif(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED_DOMAIN_LOOKUP_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailedDomainLookupFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("NOT_ALLOWED_ON_OEM_EDITION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.NotAllowedOnOemEdition(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_UNKNOWN_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PatchPrecheckFailedUnknownError(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CRL_CORRUPT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CrlCorrupt(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_JOINING_EXTERNAL_AUTH_MISMATCH"))
+            {
+                throw new Types.PoolJoiningExternalAuthMismatch();
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_SERVICE_FAILED"))
+            {
+                throw new Types.JoiningHostServiceFailed();
+            }
+            if (ErrorDescription[0].equals("CHANGE_PASSWORD_REJECTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.ChangePasswordRejected(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_UNMANAGED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifUnmanaged(p1);
+            }
+            if (ErrorDescription[0].equals("VM_DUPLICATE_VBD_DEVICE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VmDuplicateVbdDevice(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("RESTORE_SCRIPT_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.RestoreScriptFailed(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_XENSERVER_TIMEOUT"))
+            {
+                throw new Types.WlbXenserverTimeout();
+            }
+            if (ErrorDescription[0].equals("MAC_DOES_NOT_EXIST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.MacDoesNotExist(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_ITS_OWN_SLAVE"))
+            {
+                throw new Types.HostItsOwnSlave();
+            }
+            if (ErrorDescription[0].equals("AUTH_DISABLE_FAILED_WRONG_CREDENTIALS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthDisableFailedWrongCredentials(p1);
+            }
+            if (ErrorDescription[0].equals("HA_TOO_FEW_HOSTS"))
+            {
+                throw new Types.HaTooFewHosts();
+            }
+            if (ErrorDescription[0].equals("VM_ASSIGNED_TO_PROTECTION_POLICY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmAssignedToProtectionPolicy(p1, p2);
+            }
+            if (ErrorDescription[0].equals("MAP_DUPLICATE_KEY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                String p4 = ErrorDescription.length > 4 ? ErrorDescription[4] : "";
+                throw new Types.MapDuplicateKey(p1, p2, p3, p4);
+            }
+            if (ErrorDescription[0].equals("HOST_MASTER_CANNOT_TALK_BACK"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostMasterCannotTalkBack(p1);
+            }
+            if (ErrorDescription[0].equals("VM_CHECKPOINT_RESUME_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmCheckpointResumeFailed(p1);
+            }
+            if (ErrorDescription[0].equals("CRL_NAME_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CrlNameInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("EVENT_FROM_TOKEN_PARSE_FAILURE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.EventFromTokenParseFailure(p1);
+            }
+            if (ErrorDescription[0].equals("CANNOT_ENABLE_REDO_LOG"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotEnableRedoLog(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_DEVICE_NOT_FOUND"))
+            {
+                throw new Types.PifDeviceNotFound();
+            }
+            if (ErrorDescription[0].equals("LICENSE_DOES_NOT_SUPPORT_POOLING"))
+            {
+                throw new Types.LicenseDoesNotSupportPooling();
+            }
+            if (ErrorDescription[0].equals("OPERATION_BLOCKED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.OperationBlocked(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_NO_CRASHDUMP_SR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmNoCrashdumpSr(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_EVACUATE_IN_PROGRESS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostEvacuateInProgress(p1);
+            }
+            if (ErrorDescription[0].equals("SYSTEM_STATUS_MUST_USE_TAR_ON_OEM"))
+            {
+                throw new Types.SystemStatusMustUseTarOnOem();
+            }
+            if (ErrorDescription[0].equals("HA_NO_PLAN"))
+            {
+                throw new Types.HaNoPlan();
+            }
+            if (ErrorDescription[0].equals("HOST_UNKNOWN_TO_MASTER"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostUnknownToMaster(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_ENABLE_FAILED_WRONG_CREDENTIALS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthEnableFailedWrongCredentials(p1);
+            }
+            if (ErrorDescription[0].equals("OPERATION_NOT_ALLOWED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.OperationNotAllowed(p1);
+            }
+            if (ErrorDescription[0].equals("USER_IS_NOT_LOCAL_SUPERUSER"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.UserIsNotLocalSuperuser(p1);
+            }
+            if (ErrorDescription[0].equals("HA_FAILED_TO_FORM_LIVESET"))
+            {
+                throw new Types.HaFailedToFormLiveset();
+            }
+            if (ErrorDescription[0].equals("WLB_CONNECTION_RESET"))
+            {
+                throw new Types.WlbConnectionReset();
+            }
+            if (ErrorDescription[0].equals("HOST_CD_DRIVE_EMPTY"))
+            {
+                throw new Types.HostCdDriveEmpty();
+            }
+            if (ErrorDescription[0].equals("EVENTS_LOST"))
+            {
+                throw new Types.EventsLost();
+            }
+            if (ErrorDescription[0].equals("PROVISION_FAILED_OUT_OF_SPACE"))
+            {
+                throw new Types.ProvisionFailedOutOfSpace();
+            }
+            if (ErrorDescription[0].equals("LICENSE_FILE_DEPRECATED"))
+            {
+                throw new Types.LicenseFileDeprecated();
+            }
+            if (ErrorDescription[0].equals("SUBJECT_ALREADY_EXISTS"))
+            {
+                throw new Types.SubjectAlreadyExists();
+            }
+            if (ErrorDescription[0].equals("VM_HOST_INCOMPATIBLE_VERSION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmHostIncompatibleVersion(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_BROKEN"))
+            {
+                throw new Types.HostBroken();
+            }
+            if (ErrorDescription[0].equals("NOT_IN_EMERGENCY_MODE"))
+            {
+                throw new Types.NotInEmergencyMode();
+            }
+            if (ErrorDescription[0].equals("ROLE_NOT_FOUND"))
+            {
+                throw new Types.RoleNotFound();
+            }
+            if (ErrorDescription[0].equals("MAC_STILL_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.MacStillExists(p1);
+            }
+            if (ErrorDescription[0].equals("HA_HOST_IS_ARMED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HaHostIsArmed(p1);
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CANNOT_HAVE_RUNNING_VMS"))
+            {
+                throw new Types.JoiningHostCannotHaveRunningVms();
+            }
+            if (ErrorDescription[0].equals("DOMAIN_BUILDER_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.DomainBuilderError(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("HA_CONSTRAINT_VIOLATION_NETWORK_NOT_SHARED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HaConstraintViolationNetworkNotShared(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_CANNOT_DESTROY_SELF"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostCannotDestroySelf(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_INTERNAL_ERROR"))
+            {
+                throw new Types.WlbInternalError();
+            }
+            if (ErrorDescription[0].equals("FIELD_TYPE_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.FieldTypeError(p1);
+            }
+            if (ErrorDescription[0].equals("DEVICE_ALREADY_DETACHED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DeviceAlreadyDetached(p1);
+            }
+            if (ErrorDescription[0].equals("GPU_GROUP_CONTAINS_VGPU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.GpuGroupContainsVgpu(p1);
+            }
+            if (ErrorDescription[0].equals("DEVICE_DETACH_REJECTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.DeviceDetachRejected(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("SR_UNKNOWN_DRIVER"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrUnknownDriver(p1);
+            }
+            if (ErrorDescription[0].equals("HOSTS_NOT_HOMOGENEOUS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostsNotHomogeneous(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_CONTAINS_METADATA_OF_THIS_POOL"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiContainsMetadataOfThisPool(p1, p2);
+            }
+            if (ErrorDescription[0].equals("SR_NOT_SHARABLE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.SrNotSharable(p1, p2);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED_DUPLICATE_HOSTNAME"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailedDuplicateHostname(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HA_NOT_ENABLED"))
+            {
+                throw new Types.HaNotEnabled();
+            }
+            if (ErrorDescription[0].equals("SR_ATTACH_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrAttachFailed(p1);
+            }
+            if (ErrorDescription[0].equals("MESSAGE_PARAMETER_COUNT_MISMATCH"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.MessageParameterCountMismatch(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("VM_MEMORY_SIZE_TOO_LOW"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmMemorySizeTooLow(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_JOINING_HOST_MUST_HAVE_SAME_PRODUCT_VERSION"))
+            {
+                throw new Types.PoolJoiningHostMustHaveSameProductVersion();
+            }
+            if (ErrorDescription[0].equals("VM_REQUIRES_IOMMU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmRequiresIommu(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED_PERMISSION_DENIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailedPermissionDenied(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_REQUIRES_VDI"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmRequiresVdi(p1, p2);
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CONNECTION_FAILED"))
+            {
+                throw new Types.JoiningHostConnectionFailed();
+            }
+            if (ErrorDescription[0].equals("NETWORK_ALREADY_CONNECTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.NetworkAlreadyConnected(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_HAS_RESIDENT_VMS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostHasResidentVms(p1);
+            }
+            if (ErrorDescription[0].equals("SESSION_NOT_REGISTERED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SessionNotRegistered(p1);
+            }
+            if (ErrorDescription[0].equals("DB_UNIQUENESS_CONSTRAINT_VIOLATION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.DbUniquenessConstraintViolation(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("SR_INDESTRUCTIBLE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrIndestructible(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_XENSERVER_MALFORMED_RESPONSE"))
+            {
+                throw new Types.WlbXenserverMalformedResponse();
+            }
+            if (ErrorDescription[0].equals("VDI_NOT_AVAILABLE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiNotAvailable(p1);
+            }
+            if (ErrorDescription[0].equals("SR_FULL"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.SrFull(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CANNOT_FETCH_PATCH"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotFetchPatch(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_IN_EMERGENCY_MODE"))
+            {
+                throw new Types.HostInEmergencyMode();
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_SOME_CHECKSUMS_FAILED"))
+            {
+                throw new Types.ImportErrorSomeChecksumsFailed();
+            }
+            if (ErrorDescription[0].equals("XENAPI_MISSING_PLUGIN"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.XenapiMissingPlugin(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_ALREADY_ENABLED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.AuthAlreadyEnabled(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VALUE_NOT_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.ValueNotSupported(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("TRANSPORT_PIF_NOT_CONFIGURED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.TransportPifNotConfigured(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_VM_RUNNING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PatchPrecheckFailedVmRunning(p1);
+            }
+            if (ErrorDescription[0].equals("SR_HAS_PBD"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrHasPbd(p1);
+            }
+            if (ErrorDescription[0].equals("INVALID_DEVICE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InvalidDevice(p1);
+            }
+            if (ErrorDescription[0].equals("VGPU_TYPE_NOT_COMPATIBLE_WITH_RUNNING_TYPE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VgpuTypeNotCompatibleWithRunningType(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("ACTIVATION_WHILE_NOT_FREE"))
+            {
+                throw new Types.ActivationWhileNotFree();
+            }
+            if (ErrorDescription[0].equals("VDI_READONLY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiReadonly(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_IS_NOT_ISO"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiIsNotIso(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_DISABLED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostDisabled(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_CONNECTION_REFUSED"))
+            {
+                throw new Types.WlbConnectionRefused();
+            }
+            if (ErrorDescription[0].equals("VBD_NOT_EMPTY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VbdNotEmpty(p1);
+            }
+            if (ErrorDescription[0].equals("CANNOT_FIND_STATE_PARTITION"))
+            {
+                throw new Types.CannotFindStatePartition();
+            }
+            if (ErrorDescription[0].equals("INTERFACE_HAS_NO_IP"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InterfaceHasNoIp(p1);
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CANNOT_HAVE_RUNNING_OR_SUSPENDED_VMS"))
+            {
+                throw new Types.JoiningHostCannotHaveRunningOrSuspendedVms();
+            }
+            if (ErrorDescription[0].equals("AUTH_ENABLE_FAILED_DOMAIN_LOOKUP_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthEnableFailedDomainLookupFailed(p1);
+            }
+            if (ErrorDescription[0].equals("INVALID_FEATURE_STRING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InvalidFeatureString(p1);
+            }
+            if (ErrorDescription[0].equals("CANNOT_CONTACT_HOST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotContactHost(p1);
+            }
+            if (ErrorDescription[0].equals("MAC_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.MacInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("VBD_IS_EMPTY"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VbdIsEmpty(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED_INVALID_OU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailedInvalidOu(p1, p2);
+            }
+            if (ErrorDescription[0].equals("MESSAGE_METHOD_UNKNOWN"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.MessageMethodUnknown(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_DOES_NOT_ALLOW_UNPLUG"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifDoesNotAllowUnplug(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_PREREQUISITE_MISSING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PatchPrecheckFailedPrerequisiteMissing(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VDI_MISSING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiMissing(p1, p2);
+            }
+            if (ErrorDescription[0].equals("WLB_XENSERVER_AUTHENTICATION_FAILED"))
+            {
+                throw new Types.WlbXenserverAuthenticationFailed();
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CANNOT_CONTAIN_SHARED_SRS"))
+            {
+                throw new Types.JoiningHostCannotContainSharedSrs();
+            }
+            if (ErrorDescription[0].equals("RESTORE_TARGET_MGMT_IF_NOT_IN_BACKUP"))
+            {
+                throw new Types.RestoreTargetMgmtIfNotInBackup();
+            }
+            if (ErrorDescription[0].equals("VM_SNAPSHOT_WITH_QUIESCE_NOT_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmSnapshotWithQuiesceNotSupported(p1, p2);
+            }
+            if (ErrorDescription[0].equals("PIF_IS_PHYSICAL"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifIsPhysical(p1);
+            }
+            if (ErrorDescription[0].equals("DOMAIN_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.DomainExists(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_OLD_PV_DRIVERS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VmOldPvDrivers(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("IS_TUNNEL_ACCESS_PIF"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.IsTunnelAccessPif(p1);
+            }
+            if (ErrorDescription[0].equals("SR_REQUIRES_UPGRADE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrRequiresUpgrade(p1);
+            }
+            if (ErrorDescription[0].equals("ROLE_ALREADY_EXISTS"))
+            {
+                throw new Types.RoleAlreadyExists();
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_INIT_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorInitFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CRL_DOES_NOT_EXIST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CrlDoesNotExist(p1);
+            }
+            if (ErrorDescription[0].equals("INVALID_PATCH"))
+            {
+                throw new Types.InvalidPatch();
+            }
+            if (ErrorDescription[0].equals("LICENSE_DOES_NOT_SUPPORT_XHA"))
+            {
+                throw new Types.LicenseDoesNotSupportXha();
+            }
+            if (ErrorDescription[0].equals("AUTH_IS_DISABLED"))
+            {
+                throw new Types.AuthIsDisabled();
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_PROV_NOT_LOADED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorProvNotLoaded(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_HVM_REQUIRED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHvmRequired(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_MALFORMED_REQUEST"))
+            {
+                throw new Types.WlbMalformedRequest();
+            }
+            if (ErrorDescription[0].equals("VM_BIOS_STRINGS_ALREADY_SET"))
+            {
+                throw new Types.VmBiosStringsAlreadySet();
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_DISABLE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthDisableFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_HAS_PCI_ATTACHED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHasPciAttached(p1);
+            }
+            if (ErrorDescription[0].equals("VM_SNAPSHOT_WITH_QUIESCE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmSnapshotWithQuiesceFailed(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_UNKNOWN_HOST"))
+            {
+                throw new Types.WlbUnknownHost();
+            }
+            if (ErrorDescription[0].equals("SR_DEVICE_IN_USE"))
+            {
+                throw new Types.SrDeviceInUse();
+            }
+            if (ErrorDescription[0].equals("DISK_VBD_MUST_BE_READWRITE_FOR_HVM"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DiskVbdMustBeReadwriteForHvm(p1);
+            }
+            if (ErrorDescription[0].equals("DUPLICATE_PIF_DEVICE_NAME"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DuplicatePifDeviceName(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_ISO_MOUNTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PatchPrecheckFailedIsoMounted(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_PRECHECK_FAILED_WRONG_SERVER_BUILD"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.PatchPrecheckFailedWrongServerBuild(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("VM_NOT_RESIDENT_HERE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmNotResidentHere(p1, p2);
+            }
+            if (ErrorDescription[0].equals("TASK_CANCELLED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.TaskCancelled(p1);
+            }
+            if (ErrorDescription[0].equals("VM_TOO_MANY_VCPUS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmTooManyVcpus(p1);
+            }
+            if (ErrorDescription[0].equals("SUBJECT_CANNOT_BE_RESOLVED"))
+            {
+                throw new Types.SubjectCannotBeResolved();
+            }
+            if (ErrorDescription[0].equals("VM_MISSING_PV_DRIVERS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmMissingPvDrivers(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_APPLY_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PatchApplyFailed(p1);
+            }
+            if (ErrorDescription[0].equals("SLAVE_REQUIRES_MANAGEMENT_INTERFACE"))
+            {
+                throw new Types.SlaveRequiresManagementInterface();
+            }
+            if (ErrorDescription[0].equals("HOST_IS_LIVE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostIsLive(p1);
+            }
+            if (ErrorDescription[0].equals("VM_NO_SUSPEND_SR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmNoSuspendSr(p1);
+            }
+            if (ErrorDescription[0].equals("XEN_VSS_REQ_ERROR_START_SNAPSHOT_SET_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XenVssReqErrorStartSnapshotSetFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("EVENT_SUBSCRIPTION_PARSE_FAILURE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.EventSubscriptionParseFailure(p1);
+            }
+            if (ErrorDescription[0].equals("VM_TO_IMPORT_IS_NOT_NEWER_VERSION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.VmToImportIsNotNewerVersion(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("DEFAULT_SR_NOT_FOUND"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DefaultSrNotFound(p1);
+            }
+            if (ErrorDescription[0].equals("UUID_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.UuidInvalid(p1, p2);
+            }
+            if (ErrorDescription[0].equals("CANNOT_CREATE_STATE_FILE"))
+            {
+                throw new Types.CannotCreateStateFile();
+            }
+            if (ErrorDescription[0].equals("VM_REQUIRES_GPU"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmRequiresGpu(p1, p2);
+            }
+            if (ErrorDescription[0].equals("LICENSE_CHECKOUT_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.LicenseCheckoutError(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_IS_SLAVE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostIsSlave(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_STILL_BOOTING"))
+            {
+                throw new Types.HostStillBooting();
+            }
+            if (ErrorDescription[0].equals("PGPU_NOT_COMPATIBLE_WITH_GPU_GROUP"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PgpuNotCompatibleWithGpuGroup(p1, p2);
+            }
+            if (ErrorDescription[0].equals("XMLRPC_UNMARSHAL_FAILURE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.XmlrpcUnmarshalFailure(p1, p2);
+            }
+            if (ErrorDescription[0].equals("MESSAGE_REMOVED"))
+            {
+                throw new Types.MessageRemoved();
+            }
+            if (ErrorDescription[0].equals("NETWORK_CONTAINS_PIF"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.NetworkContainsPif(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_XENSERVER_UNKNOWN_HOST"))
+            {
+                throw new Types.WlbXenserverUnknownHost();
+            }
+            if (ErrorDescription[0].equals("DEVICE_ATTACH_TIMEOUT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.DeviceAttachTimeout(p1, p2);
+            }
+            if (ErrorDescription[0].equals("PATCH_ALREADY_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PatchAlreadyExists(p1);
+            }
+            if (ErrorDescription[0].equals("PGPU_IN_USE_BY_VM"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PgpuInUseByVm(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_ENABLE_FAILED_UNAVAILABLE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthEnableFailedUnavailable(p1);
+            }
+            if (ErrorDescription[0].equals("CANNOT_ADD_VLAN_TO_BOND_SLAVE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotAddVlanToBondSlave(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_LOCATION_MISSING"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiLocationMissing(p1, p2);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_DISABLE_FAILED_WRONG_CREDENTIALS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthDisableFailedWrongCredentials(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_FAILED_SHUTDOWN_ACKNOWLEDGMENT"))
+            {
+                throw new Types.VmFailedShutdownAcknowledgment();
+            }
+            if (ErrorDescription[0].equals("CERTIFICATE_NAME_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CertificateNameInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("UNKNOWN_BOOTLOADER"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.UnknownBootloader(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_ATTACHED_TO_MORE_THAN_ONE_VDI_WITH_TIMEOFFSET_MARKED_AS_RESET_ON_BOOT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmAttachedToMoreThanOneVdiWithTimeoffsetMarkedAsResetOnBoot(p1);
+            }
+            if (ErrorDescription[0].equals("INTERNAL_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.InternalError(p1);
+            }
+            if (ErrorDescription[0].equals("MESSAGE_DEPRECATED"))
+            {
+                throw new Types.MessageDeprecated();
+            }
+            if (ErrorDescription[0].equals("CANNOT_FIND_PATCH"))
+            {
+                throw new Types.CannotFindPatch();
+            }
+            if (ErrorDescription[0].equals("VM_UNSAFE_BOOT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmUnsafeBoot(p1);
+            }
+            if (ErrorDescription[0].equals("VM_MIGRATE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                String p4 = ErrorDescription.length > 4 ? ErrorDescription[4] : "";
+                throw new Types.VmMigrateFailed(p1, p2, p3, p4);
+            }
+            if (ErrorDescription[0].equals("JOINING_HOST_CANNOT_BE_MASTER_OF_OTHER_HOSTS"))
+            {
+                throw new Types.JoiningHostCannotBeMasterOfOtherHosts();
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_CANNOT_HANDLE_CHUNKED"))
+            {
+                throw new Types.ImportErrorCannotHandleChunked();
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED_WRONG_CREDENTIALS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailedWrongCredentials(p1, p2);
+            }
+            if (ErrorDescription[0].equals("ONLY_ALLOWED_ON_OEM_EDITION"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.OnlyAllowedOnOemEdition(p1);
+            }
+            if (ErrorDescription[0].equals("HOST_IN_USE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                throw new Types.HostInUse(p1, p2, p3);
+            }
+            if (ErrorDescription[0].equals("VM_CHECKPOINT_SUSPEND_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmCheckpointSuspendFailed(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_ALREADY_APPLIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PatchAlreadyApplied(p1);
+            }
+            if (ErrorDescription[0].equals("DEVICE_NOT_ATTACHED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.DeviceNotAttached(p1);
+            }
+            if (ErrorDescription[0].equals("POOL_AUTH_ENABLE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PoolAuthEnableFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VDI_IN_USE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VdiInUse(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HOST_NOT_DISABLED"))
+            {
+                throw new Types.HostNotDisabled();
+            }
+            if (ErrorDescription[0].equals("FEATURE_RESTRICTED"))
+            {
+                throw new Types.FeatureRestricted();
+            }
+            if (ErrorDescription[0].equals("VM_REQUIRES_SR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.VmRequiresSr(p1, p2);
+            }
+            if (ErrorDescription[0].equals("BOOTLOADER_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.BootloaderFailed(p1, p2);
+            }
+            if (ErrorDescription[0].equals("PIF_HAS_NO_NETWORK_CONFIGURATION"))
+            {
+                throw new Types.PifHasNoNetworkConfiguration();
+            }
+            if (ErrorDescription[0].equals("PIF_TUNNEL_STILL_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifTunnelStillExists(p1);
+            }
+            if (ErrorDescription[0].equals("IMPORT_ERROR_FAILED_TO_FIND_OBJECT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.ImportErrorFailedToFindObject(p1);
+            }
+            if (ErrorDescription[0].equals("VDI_NEEDS_VM_FOR_MIGRATE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VdiNeedsVmForMigrate(p1);
+            }
+            if (ErrorDescription[0].equals("SR_OPERATION_NOT_SUPPORTED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrOperationNotSupported(p1);
+            }
+            if (ErrorDescription[0].equals("VM_SNAPSHOT_WITH_QUIESCE_PLUGIN_DEOS_NOT_RESPOND"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmSnapshotWithQuiescePluginDeosNotRespond(p1);
+            }
+            if (ErrorDescription[0].equals("XAPI_HOOK_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                String p3 = ErrorDescription.length > 3 ? ErrorDescription[3] : "";
+                String p4 = ErrorDescription.length > 4 ? ErrorDescription[4] : "";
+                throw new Types.XapiHookFailed(p1, p2, p3, p4);
+            }
+            if (ErrorDescription[0].equals("REDO_LOG_IS_ENABLED"))
+            {
+                throw new Types.RedoLogIsEnabled();
+            }
+            if (ErrorDescription[0].equals("HOST_OFFLINE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HostOffline(p1);
+            }
+            if (ErrorDescription[0].equals("CRL_ALREADY_EXISTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CrlAlreadyExists(p1);
+            }
+            if (ErrorDescription[0].equals("SSL_VERIFY_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SslVerifyError(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_UNKNOWN_TYPE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthUnknownType(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_HAS_NO_V6_NETWORK_CONFIGURATION"))
+            {
+                throw new Types.PifHasNoV6NetworkConfiguration();
+            }
+            if (ErrorDescription[0].equals("HA_SHOULD_BE_FENCED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HaShouldBeFenced(p1);
+            }
+            if (ErrorDescription[0].equals("OUT_OF_SPACE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.OutOfSpace(p1);
+            }
+            if (ErrorDescription[0].equals("SR_HAS_NO_PBDS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.SrHasNoPbds(p1);
+            }
+            if (ErrorDescription[0].equals("RBAC_PERMISSION_DENIED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.RbacPermissionDenied(p1, p2);
+            }
+            if (ErrorDescription[0].equals("HA_HOST_CANNOT_ACCESS_STATEFILE"))
+            {
+                throw new Types.HaHostCannotAccessStatefile();
+            }
+            if (ErrorDescription[0].equals("WLB_TIMEOUT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.WlbTimeout(p1);
+            }
+            if (ErrorDescription[0].equals("HA_ABORT_NEW_MASTER"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HaAbortNewMaster(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_CONFIGURATION_ERROR"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                String p2 = ErrorDescription.length > 2 ? ErrorDescription[2] : "";
+                throw new Types.PifConfigurationError(p1, p2);
+            }
+            if (ErrorDescription[0].equals("VM_HAS_TOO_MANY_SNAPSHOTS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHasTooManySnapshots(p1);
+            }
+            if (ErrorDescription[0].equals("PATCH_IS_APPLIED"))
+            {
+                throw new Types.PatchIsApplied();
+            }
+            if (ErrorDescription[0].equals("MIRROR_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.MirrorFailed(p1);
+            }
+            if (ErrorDescription[0].equals("AUTH_DISABLE_FAILED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.AuthDisableFailed(p1);
+            }
+            if (ErrorDescription[0].equals("PIF_IS_MANAGEMENT_INTERFACE"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.PifIsManagementInterface(p1);
+            }
+            if (ErrorDescription[0].equals("CERTIFICATE_DOES_NOT_EXIST"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CertificateDoesNotExist(p1);
+            }
+            if (ErrorDescription[0].equals("NETWORK_CONTAINS_VIF"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.NetworkContainsVif(p1);
+            }
+            if (ErrorDescription[0].equals("CANNOT_RESET_CONTROL_DOMAIN"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.CannotResetControlDomain(p1);
+            }
+            if (ErrorDescription[0].equals("WLB_AUTHENTICATION_FAILED"))
+            {
+                throw new Types.WlbAuthenticationFailed();
+            }
+            if (ErrorDescription[0].equals("WLB_URL_INVALID"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.WlbUrlInvalid(p1);
+            }
+            if (ErrorDescription[0].equals("HA_CONSTRAINT_VIOLATION_SR_NOT_SHARED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.HaConstraintViolationSrNotShared(p1);
+            }
+            if (ErrorDescription[0].equals("VM_NO_VCPUS"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmNoVcpus(p1);
+            }
+            if (ErrorDescription[0].equals("VM_HAS_CHECKPOINT"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VmHasCheckpoint(p1);
+            }
+            if (ErrorDescription[0].equals("VBD_TRAY_LOCKED"))
+            {
+                String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : "";
+                throw new Types.VbdTrayLocked(p1);
+            }
+            if

<TRUNCATED>

[18/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Console.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Console.java b/deps/XenServerJava/src/com/xensource/xenapi/Console.java
new file mode 100644
index 0000000..bb4440ae
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Console.java
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A console
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Console extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Console(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Console, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Console)
+        {
+            Console other = (Console) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Console
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "protocol", this.protocol);
+            print.printf("%1$20s: %2$s\n", "location", this.location);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a console.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("protocol", this.protocol == null ? Types.ConsoleProtocol.UNRECOGNIZED : this.protocol);
+            map.put("location", this.location == null ? "" : this.location);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the protocol used by this console
+         */
+        public Types.ConsoleProtocol protocol;
+        /**
+         * URI for the console service
+         */
+        public String location;
+        /**
+         * VM to which this console is attached
+         */
+        public VM VM;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given console.
+     *
+     * @return all fields from the object
+     */
+    public Console.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toConsoleRecord(result);
+    }
+
+    /**
+     * Get a reference to the console instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Console getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toConsole(result);
+    }
+
+    /**
+     * Create a new console instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Console.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.console.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new console instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static Console create(Connection c, Console.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toConsole(result);
+    }
+
+    /**
+     * Destroy the specified console instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.console.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified console instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given console.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the protocol field of the given console.
+     *
+     * @return value of the field
+     */
+    public Types.ConsoleProtocol getProtocol(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_protocol";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toConsoleProtocol(result);
+    }
+
+    /**
+     * Get the location field of the given console.
+     *
+     * @return value of the field
+     */
+    public String getLocation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_location";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the VM field of the given console.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the other_config field of the given console.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given console.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given console.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given console.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the consoles known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Console> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfConsole(result);
+    }
+
+    /**
+     * Return a map of console references to console records for all consoles known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Console, Console.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "console.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfConsoleConsoleRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java
new file mode 100644
index 0000000..1d40d4d
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A VM crashdump
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Crashdump extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Crashdump(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Crashdump, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Crashdump)
+        {
+            Crashdump other = (Crashdump) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Crashdump
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "VDI", this.VDI);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a crashdump.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("VDI", this.VDI == null ? new VDI("OpaqueRef:NULL") : this.VDI);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the virtual machine
+         */
+        public VM VM;
+        /**
+         * the virtual disk
+         */
+        public VDI VDI;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given crashdump.
+     *
+     * @return all fields from the object
+     */
+    public Crashdump.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toCrashdumpRecord(result);
+    }
+
+    /**
+     * Get a reference to the crashdump instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Crashdump getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toCrashdump(result);
+    }
+
+    /**
+     * Get the uuid field of the given crashdump.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the VM field of the given crashdump.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the VDI field of the given crashdump.
+     *
+     * @return value of the field
+     */
+    public VDI getVDI(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_VDI";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the other_config field of the given crashdump.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given crashdump.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given crashdump.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given crashdump.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Destroy the specified crashdump
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.crashdump.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified crashdump
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the crashdumps known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Crashdump> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfCrashdump(result);
+    }
+
+    /**
+     * Return a map of crashdump references to crashdump records for all crashdumps known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Crashdump, Crashdump.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "crashdump.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfCrashdumpCrashdumpRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java b/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java
new file mode 100644
index 0000000..bbca81c
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * DR task
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class DRTask extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    DRTask(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a DRTask, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof DRTask)
+        {
+            DRTask other = (DRTask) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a DRTask
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "introducedSRs", this.introducedSRs);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a DR_task.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("introduced_SRs", this.introducedSRs == null ? new LinkedHashSet<SR>() : this.introducedSRs);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * All SRs introduced by this appliance
+         */
+        public Set<SR> introducedSRs;
+    }
+
+    /**
+     * Get a record containing the current state of the given DR_task.
+     *
+     * @return all fields from the object
+     */
+    public DRTask.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDRTaskRecord(result);
+    }
+
+    /**
+     * Get a reference to the DR_task instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static DRTask getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDRTask(result);
+    }
+
+    /**
+     * Get the uuid field of the given DR_task.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the introduced_SRs field of the given DR_task.
+     *
+     * @return value of the field
+     */
+    public Set<SR> getIntroducedSRs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_introduced_SRs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSR(result);
+    }
+
+    /**
+     * Create a disaster recovery task which will query the supplied list of devices
+     *
+     * @param type The SR driver type of the SRs to introduce
+     * @param deviceConfig The device configuration of the SRs to introduce
+     * @param whitelist The devices to use for disaster recovery
+     * @return Task
+     */
+    public static Task createAsync(Connection c, String type, Map<String, String> deviceConfig, Set<String> whitelist) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.DR_task.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(whitelist)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a disaster recovery task which will query the supplied list of devices
+     *
+     * @param type The SR driver type of the SRs to introduce
+     * @param deviceConfig The device configuration of the SRs to introduce
+     * @param whitelist The devices to use for disaster recovery
+     * @return The reference to the created task
+     */
+    public static DRTask create(Connection c, String type, Map<String, String> deviceConfig, Set<String> whitelist) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(whitelist)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDRTask(result);
+    }
+
+    /**
+     * Destroy the disaster recovery task, detaching and forgetting any SRs introduced which are no longer required
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.DR_task.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the disaster recovery task, detaching and forgetting any SRs introduced which are no longer required
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the DR_tasks known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<DRTask> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfDRTask(result);
+    }
+
+    /**
+     * Return a map of DR_task references to DR_task records for all DR_tasks known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<DRTask, DRTask.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "DR_task.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfDRTaskDRTaskRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java
new file mode 100644
index 0000000..9a4bfcd
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Data sources for logging in RRDs
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class DataSource extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    DataSource(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a DataSource, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof DataSource)
+        {
+            DataSource other = (DataSource) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a DataSource
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "enabled", this.enabled);
+            print.printf("%1$20s: %2$s\n", "standard", this.standard);
+            print.printf("%1$20s: %2$s\n", "units", this.units);
+            print.printf("%1$20s: %2$s\n", "min", this.min);
+            print.printf("%1$20s: %2$s\n", "max", this.max);
+            print.printf("%1$20s: %2$s\n", "value", this.value);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a data_source.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("enabled", this.enabled == null ? false : this.enabled);
+            map.put("standard", this.standard == null ? false : this.standard);
+            map.put("units", this.units == null ? "" : this.units);
+            map.put("min", this.min == null ? 0.0 : this.min);
+            map.put("max", this.max == null ? 0.0 : this.max);
+            map.put("value", this.value == null ? 0.0 : this.value);
+            return map;
+        }
+
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * true if the data source is being logged
+         */
+        public Boolean enabled;
+        /**
+         * true if the data source is enabled by default. Non-default data sources cannot be disabled
+         */
+        public Boolean standard;
+        /**
+         * the units of the value
+         */
+        public String units;
+        /**
+         * the minimum value of the data source
+         */
+        public Double min;
+        /**
+         * the maximum value of the data source
+         */
+        public Double max;
+        /**
+         * current value of the data source
+         */
+        public Double value;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Event.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Event.java b/deps/XenServerJava/src/com/xensource/xenapi/Event.java
new file mode 100644
index 0000000..27db4a5
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Event.java
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Asynchronous event registration and handling
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Event extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Event(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Event, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Event)
+        {
+            Event other = (Event) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Event
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "id", this.id);
+            print.printf("%1$20s: %2$s\n", "timestamp", this.timestamp);
+            print.printf("%1$20s: %2$s\n", "clazz", this.clazz);
+            print.printf("%1$20s: %2$s\n", "operation", this.operation);
+            print.printf("%1$20s: %2$s\n", "ref", this.ref);
+            print.printf("%1$20s: %2$s\n", "objUuid", this.objUuid);
+            print.printf("%1$20s: %2$s\n", "snapshot", this.snapshot);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a event.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("id", this.id == null ? 0 : this.id);
+            map.put("timestamp", this.timestamp == null ? new Date(0) : this.timestamp);
+            map.put("class", this.clazz == null ? "" : this.clazz);
+            map.put("operation", this.operation == null ? Types.EventOperation.UNRECOGNIZED : this.operation);
+            map.put("ref", this.ref == null ? "" : this.ref);
+            map.put("obj_uuid", this.objUuid == null ? "" : this.objUuid);
+            map.put("snapshot", this.snapshot);
+            return map;
+        }
+
+        /**
+         * An ID, monotonically increasing, and local to the current session
+         */
+        public Long id;
+        /**
+         * The time at which the event occurred
+         */
+        public Date timestamp;
+        /**
+         * The name of the class of the object that changed
+         */
+        public String clazz;
+        /**
+         * The operation that was performed
+         */
+        public Types.EventOperation operation;
+        /**
+         * A reference to the object that changed
+         */
+        public String ref;
+        /**
+         * The uuid of the object that changed
+         */
+        public String objUuid;
+        /**
+         * The record of the database object that was added, changed or deleted
+         * (the actual type will be VM.Record, VBD.Record or similar)
+         */
+        public Object snapshot;
+    }
+
+    /**
+     * Registers this session with the event system.  Specifying * as the desired class will register for all classes.
+     *
+     * @param classes register for events for the indicated classes
+     * @return Task
+     */
+    public static Task registerAsync(Connection c, Set<String> classes) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.event.register";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Registers this session with the event system.  Specifying * as the desired class will register for all classes.
+     *
+     * @param classes register for events for the indicated classes
+     */
+    public static void register(Connection c, Set<String> classes) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "event.register";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Unregisters this session with the event system
+     *
+     * @param classes remove this session's registration for the indicated classes
+     * @return Task
+     */
+    public static Task unregisterAsync(Connection c, Set<String> classes) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.event.unregister";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Unregisters this session with the event system
+     *
+     * @param classes remove this session's registration for the indicated classes
+     */
+    public static void unregister(Connection c, Set<String> classes) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "event.unregister";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Blocking call which returns a (possibly empty) batch of events
+     *
+     * @return the batch of events
+     */
+    public static Set<Event.Record> next(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SessionNotRegistered,
+       Types.EventsLost {
+        String method_call = "event.next";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfEventRecord(result);
+    }
+
+    /**
+     * Blocking call which returns a (possibly empty) batch of events
+     *
+     * @param classes register for events for the indicated classes
+     * @param token A token representing the point from which to generate database events. The empty string represents the beginning.
+     * @param timeout Return after this many seconds if no events match
+     * @return the batch of events
+     */
+    public static Set<Event.Record> from(Connection c, Set<String> classes, String token, Double timeout) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SessionNotRegistered,
+       Types.EventsLost {
+        String method_call = "event.from";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes), Marshalling.toXMLRPC(token), Marshalling.toXMLRPC(timeout)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfEventRecord(result);
+    }
+
+    /**
+     * Return the ID of the next event to be generated by the system
+     *
+     * @return the event ID
+     */
+    public static Long getCurrentId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "event.get_current_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Injects an artificial event on the given object and return the corresponding ID
+     *
+     * @param clazz class of the object
+     * @param ref A reference to the object that will be changed.
+     * @return the event ID
+     */
+    public static String inject(Connection c, String clazz, String ref) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "event.inject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(clazz), Marshalling.toXMLRPC(ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    public static Map properFrom(Connection c, Set<String> classes, String token, Double timeout) throws BadServerResponse, XenAPIException, XmlRpcException,
+       Types.SessionNotRegistered,
+       Types.EventsLost {
+        String method_call = "event.from";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes), Marshalling.toXMLRPC(token), Marshalling.toXMLRPC(timeout)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        Map value = (Map)result;
+        Map<String, Object> from = new HashMap<String, Object>();
+        from.put("token", value.get("token"));
+        from.put("events", Types.toSetOfEventRecord(value.get("events")));
+        return from;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java b/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java
new file mode 100644
index 0000000..916d8b6
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java
@@ -0,0 +1,638 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A group of compatible GPUs across the resource pool
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class GPUGroup extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    GPUGroup(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a GPUGroup, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof GPUGroup)
+        {
+            GPUGroup other = (GPUGroup) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a GPUGroup
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "PGPUs", this.PGPUs);
+            print.printf("%1$20s: %2$s\n", "VGPUs", this.VGPUs);
+            print.printf("%1$20s: %2$s\n", "GPUTypes", this.GPUTypes);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "allocationAlgorithm", this.allocationAlgorithm);
+            print.printf("%1$20s: %2$s\n", "supportedVGPUTypes", this.supportedVGPUTypes);
+            print.printf("%1$20s: %2$s\n", "enabledVGPUTypes", this.enabledVGPUTypes);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a GPU_group.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("PGPUs", this.PGPUs == null ? new LinkedHashSet<PGPU>() : this.PGPUs);
+            map.put("VGPUs", this.VGPUs == null ? new LinkedHashSet<VGPU>() : this.VGPUs);
+            map.put("GPU_types", this.GPUTypes == null ? new LinkedHashSet<String>() : this.GPUTypes);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("allocation_algorithm", this.allocationAlgorithm == null ? Types.AllocationAlgorithm.UNRECOGNIZED : this.allocationAlgorithm);
+            map.put("supported_VGPU_types", this.supportedVGPUTypes == null ? new LinkedHashSet<VGPUType>() : this.supportedVGPUTypes);
+            map.put("enabled_VGPU_types", this.enabledVGPUTypes == null ? new LinkedHashSet<VGPUType>() : this.enabledVGPUTypes);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * List of pGPUs in the group
+         */
+        public Set<PGPU> PGPUs;
+        /**
+         * List of vGPUs using the group
+         */
+        public Set<VGPU> VGPUs;
+        /**
+         * List of GPU types (vendor+device ID) that can be in this group
+         */
+        public Set<String> GPUTypes;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * Current allocation of vGPUs to pGPUs for this group
+         */
+        public Types.AllocationAlgorithm allocationAlgorithm;
+        /**
+         * vGPU types supported on at least one of the pGPUs in this group
+         */
+        public Set<VGPUType> supportedVGPUTypes;
+        /**
+         * vGPU types supported on at least one of the pGPUs in this group
+         */
+        public Set<VGPUType> enabledVGPUTypes;
+    }
+
+    /**
+     * Get a record containing the current state of the given GPU_group.
+     *
+     * @return all fields from the object
+     */
+    public GPUGroup.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toGPUGroupRecord(result);
+    }
+
+    /**
+     * Get a reference to the GPU_group instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static GPUGroup getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toGPUGroup(result);
+    }
+
+    /**
+     * Get all the GPU_group instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<GPUGroup> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfGPUGroup(result);
+    }
+
+    /**
+     * Get the uuid field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PGPUs field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Set<PGPU> getPGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_PGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPGPU(result);
+    }
+
+    /**
+     * Get the VGPUs field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Set<VGPU> getVGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_VGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPU(result);
+    }
+
+    /**
+     * Get the GPU_types field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Set<String> getGPUTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_GPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the other_config field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the allocation_algorithm field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Types.AllocationAlgorithm getAllocationAlgorithm(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_allocation_algorithm";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toAllocationAlgorithm(result);
+    }
+
+    /**
+     * Get the supported_VGPU_types field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Set<VGPUType> getSupportedVGPUTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_supported_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPUType(result);
+    }
+
+    /**
+     * Get the enabled_VGPU_types field of the given GPU_group.
+     *
+     * @return value of the field
+     */
+    public Set<VGPUType> getEnabledVGPUTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPUType(result);
+    }
+
+    /**
+     * Set the name/label field of the given GPU_group.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given GPU_group.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given GPU_group.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given GPU_group.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given GPU_group.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the allocation_algorithm field of the given GPU_group.
+     *
+     * @param allocationAlgorithm New value to set
+     */
+    public void setAllocationAlgorithm(Connection c, Types.AllocationAlgorithm allocationAlgorithm) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.set_allocation_algorithm";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(allocationAlgorithm)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param nameLabel 
+     * @param nameDescription 
+     * @param otherConfig 
+     * @return Task
+     */
+    public static Task createAsync(Connection c, String nameLabel, String nameDescription, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.GPU_group.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param nameLabel 
+     * @param nameDescription 
+     * @param otherConfig 
+     * @return 
+     */
+    public static GPUGroup create(Connection c, String nameLabel, String nameDescription, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toGPUGroup(result);
+    }
+
+    /**
+     * 
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.GPU_group.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param vgpuType The VGPU_type for which the remaining capacity will be calculated
+     * @return Task
+     */
+    public Task getRemainingCapacityAsync(Connection c, VGPUType vgpuType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.GPU_group.get_remaining_capacity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param vgpuType The VGPU_type for which the remaining capacity will be calculated
+     * @return The number of VGPUs of the given type which can still be started on the PGPUs in the group
+     */
+    public Long getRemainingCapacity(Connection c, VGPUType vgpuType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_remaining_capacity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Return a list of all the GPU_groups known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<GPUGroup> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfGPUGroup(result);
+    }
+
+    /**
+     * Return a map of GPU_group references to GPU_group records for all GPU_groups known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<GPUGroup, GPUGroup.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "GPU_group.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfGPUGroupGPUGroupRecord(result);
+    }
+
+}
\ No newline at end of file


[05/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VGPU.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VGPU.java b/deps/XenServerJava/src/com/xensource/xenapi/VGPU.java
new file mode 100644
index 0000000..ebd0a64
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VGPU.java
@@ -0,0 +1,494 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual GPU (vGPU)
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VGPU extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VGPU(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VGPU, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VGPU)
+        {
+            VGPU other = (VGPU) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VGPU
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "GPUGroup", this.GPUGroup);
+            print.printf("%1$20s: %2$s\n", "device", this.device);
+            print.printf("%1$20s: %2$s\n", "currentlyAttached", this.currentlyAttached);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "residentOn", this.residentOn);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VGPU.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("GPU_group", this.GPUGroup == null ? new GPUGroup("OpaqueRef:NULL") : this.GPUGroup);
+            map.put("device", this.device == null ? "" : this.device);
+            map.put("currently_attached", this.currentlyAttached == null ? false : this.currentlyAttached);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("type", this.type == null ? new VGPUType("OpaqueRef:NULL") : this.type);
+            map.put("resident_on", this.residentOn == null ? new PGPU("OpaqueRef:NULL") : this.residentOn);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * VM that owns the vGPU
+         */
+        public VM VM;
+        /**
+         * GPU group used by the vGPU
+         */
+        public GPUGroup GPUGroup;
+        /**
+         * Order in which the devices are plugged into the VM
+         */
+        public String device;
+        /**
+         * Reflects whether the virtual device is currently connected to a physical device
+         */
+        public Boolean currentlyAttached;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * Preset type for this VGPU
+         */
+        public VGPUType type;
+        /**
+         * The PGPU on which this VGPU is running
+         */
+        public PGPU residentOn;
+    }
+
+    /**
+     * Get a record containing the current state of the given VGPU.
+     *
+     * @return all fields from the object
+     */
+    public VGPU.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPURecord(result);
+    }
+
+    /**
+     * Get a reference to the VGPU instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VGPU getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPU(result);
+    }
+
+    /**
+     * Get the uuid field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the VM field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the GPU_group field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public GPUGroup getGPUGroup(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_GPU_group";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toGPUGroup(result);
+    }
+
+    /**
+     * Get the device field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public String getDevice(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_device";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the currently_attached field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public Boolean getCurrentlyAttached(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_currently_attached";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the type field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public VGPUType getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPUType(result);
+    }
+
+    /**
+     * Get the resident_on field of the given VGPU.
+     *
+     * @return value of the field
+     */
+    public PGPU getResidentOn(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_resident_on";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPGPU(result);
+    }
+
+    /**
+     * Set the other_config field of the given VGPU.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VGPU.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VGPU.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param VM 
+     * @param GPUGroup 
+     * @param device 
+     * @param otherConfig 
+     * @param type 
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VM VM, GPUGroup GPUGroup, String device, Map<String, String> otherConfig, VGPUType type) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VGPU.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(VM), Marshalling.toXMLRPC(GPUGroup), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(type)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param VM 
+     * @param GPUGroup 
+     * @param device 
+     * @param otherConfig 
+     * @param type 
+     * @return reference to the newly created object
+     */
+    public static VGPU create(Connection c, VM VM, GPUGroup GPUGroup, String device, Map<String, String> otherConfig, VGPUType type) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(VM), Marshalling.toXMLRPC(GPUGroup), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(type)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPU(result);
+    }
+
+    /**
+     * 
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VGPU.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VGPUs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VGPU> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPU(result);
+    }
+
+    /**
+     * Return a map of VGPU references to VGPU records for all VGPUs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VGPU, VGPU.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVGPUVGPURecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VGPUType.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VGPUType.java b/deps/XenServerJava/src/com/xensource/xenapi/VGPUType.java
new file mode 100644
index 0000000..075ec18
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VGPUType.java
@@ -0,0 +1,461 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A type of virtual GPU
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VGPUType extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VGPUType(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VGPUType, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VGPUType)
+        {
+            VGPUType other = (VGPUType) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VGPUType
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "vendorName", this.vendorName);
+            print.printf("%1$20s: %2$s\n", "modelName", this.modelName);
+            print.printf("%1$20s: %2$s\n", "framebufferSize", this.framebufferSize);
+            print.printf("%1$20s: %2$s\n", "maxHeads", this.maxHeads);
+            print.printf("%1$20s: %2$s\n", "maxResolutionX", this.maxResolutionX);
+            print.printf("%1$20s: %2$s\n", "maxResolutionY", this.maxResolutionY);
+            print.printf("%1$20s: %2$s\n", "supportedOnPGPUs", this.supportedOnPGPUs);
+            print.printf("%1$20s: %2$s\n", "enabledOnPGPUs", this.enabledOnPGPUs);
+            print.printf("%1$20s: %2$s\n", "VGPUs", this.VGPUs);
+            print.printf("%1$20s: %2$s\n", "supportedOnGPUGroups", this.supportedOnGPUGroups);
+            print.printf("%1$20s: %2$s\n", "enabledOnGPUGroups", this.enabledOnGPUGroups);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VGPU_type.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("vendor_name", this.vendorName == null ? "" : this.vendorName);
+            map.put("model_name", this.modelName == null ? "" : this.modelName);
+            map.put("framebuffer_size", this.framebufferSize == null ? 0 : this.framebufferSize);
+            map.put("max_heads", this.maxHeads == null ? 0 : this.maxHeads);
+            map.put("max_resolution_x", this.maxResolutionX == null ? 0 : this.maxResolutionX);
+            map.put("max_resolution_y", this.maxResolutionY == null ? 0 : this.maxResolutionY);
+            map.put("supported_on_PGPUs", this.supportedOnPGPUs == null ? new LinkedHashSet<PGPU>() : this.supportedOnPGPUs);
+            map.put("enabled_on_PGPUs", this.enabledOnPGPUs == null ? new LinkedHashSet<PGPU>() : this.enabledOnPGPUs);
+            map.put("VGPUs", this.VGPUs == null ? new LinkedHashSet<VGPU>() : this.VGPUs);
+            map.put("supported_on_GPU_groups", this.supportedOnGPUGroups == null ? new LinkedHashSet<GPUGroup>() : this.supportedOnGPUGroups);
+            map.put("enabled_on_GPU_groups", this.enabledOnGPUGroups == null ? new LinkedHashSet<GPUGroup>() : this.enabledOnGPUGroups);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Name of VGPU vendor
+         */
+        public String vendorName;
+        /**
+         * Model name associated with the VGPU type
+         */
+        public String modelName;
+        /**
+         * Framebuffer size of the VGPU type, in bytes
+         */
+        public Long framebufferSize;
+        /**
+         * Maximum number of displays supported by the VGPU type
+         */
+        public Long maxHeads;
+        /**
+         * Maximum resultion (width) supported by the VGPU type
+         */
+        public Long maxResolutionX;
+        /**
+         * Maximum resoltion (height) supported by the VGPU type
+         */
+        public Long maxResolutionY;
+        /**
+         * List of PGPUs that support this VGPU type
+         */
+        public Set<PGPU> supportedOnPGPUs;
+        /**
+         * List of PGPUs that have this VGPU type enabled
+         */
+        public Set<PGPU> enabledOnPGPUs;
+        /**
+         * List of VGPUs of this type
+         */
+        public Set<VGPU> VGPUs;
+        /**
+         * List of GPU groups in which at least one PGPU supports this VGPU type
+         */
+        public Set<GPUGroup> supportedOnGPUGroups;
+        /**
+         * List of GPU groups in which at least one have this VGPU type enabled
+         */
+        public Set<GPUGroup> enabledOnGPUGroups;
+    }
+
+    /**
+     * Get a record containing the current state of the given VGPU_type.
+     *
+     * @return all fields from the object
+     */
+    public VGPUType.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPUTypeRecord(result);
+    }
+
+    /**
+     * Get a reference to the VGPU_type instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VGPUType getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVGPUType(result);
+    }
+
+    /**
+     * Get the uuid field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the vendor_name field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public String getVendorName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_vendor_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the model_name field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public String getModelName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_model_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the framebuffer_size field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Long getFramebufferSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_framebuffer_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the max_heads field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Long getMaxHeads(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_max_heads";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the max_resolution_x field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Long getMaxResolutionX(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_max_resolution_x";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the max_resolution_y field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Long getMaxResolutionY(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_max_resolution_y";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the supported_on_PGPUs field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Set<PGPU> getSupportedOnPGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_supported_on_PGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPGPU(result);
+    }
+
+    /**
+     * Get the enabled_on_PGPUs field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Set<PGPU> getEnabledOnPGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_enabled_on_PGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPGPU(result);
+    }
+
+    /**
+     * Get the VGPUs field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Set<VGPU> getVGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_VGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPU(result);
+    }
+
+    /**
+     * Get the supported_on_GPU_groups field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Set<GPUGroup> getSupportedOnGPUGroups(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_supported_on_GPU_groups";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfGPUGroup(result);
+    }
+
+    /**
+     * Get the enabled_on_GPU_groups field of the given VGPU_type.
+     *
+     * @return value of the field
+     */
+    public Set<GPUGroup> getEnabledOnGPUGroups(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_enabled_on_GPU_groups";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfGPUGroup(result);
+    }
+
+    /**
+     * Return a list of all the VGPU_types known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VGPUType> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPUType(result);
+    }
+
+    /**
+     * Return a map of VGPU_type references to VGPU_type records for all VGPU_types known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VGPUType, VGPUType.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VGPU_type.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVGPUTypeVGPUTypeRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VIF.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VIF.java b/deps/XenServerJava/src/com/xensource/xenapi/VIF.java
new file mode 100644
index 0000000..c755dc4
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VIF.java
@@ -0,0 +1,1186 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual network interface
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VIF extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VIF(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VIF, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VIF)
+        {
+            VIF other = (VIF) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VIF
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "device", this.device);
+            print.printf("%1$20s: %2$s\n", "network", this.network);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "MAC", this.MAC);
+            print.printf("%1$20s: %2$s\n", "MTU", this.MTU);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "currentlyAttached", this.currentlyAttached);
+            print.printf("%1$20s: %2$s\n", "statusCode", this.statusCode);
+            print.printf("%1$20s: %2$s\n", "statusDetail", this.statusDetail);
+            print.printf("%1$20s: %2$s\n", "runtimeProperties", this.runtimeProperties);
+            print.printf("%1$20s: %2$s\n", "qosAlgorithmType", this.qosAlgorithmType);
+            print.printf("%1$20s: %2$s\n", "qosAlgorithmParams", this.qosAlgorithmParams);
+            print.printf("%1$20s: %2$s\n", "qosSupportedAlgorithms", this.qosSupportedAlgorithms);
+            print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+            print.printf("%1$20s: %2$s\n", "MACAutogenerated", this.MACAutogenerated);
+            print.printf("%1$20s: %2$s\n", "lockingMode", this.lockingMode);
+            print.printf("%1$20s: %2$s\n", "ipv4Allowed", this.ipv4Allowed);
+            print.printf("%1$20s: %2$s\n", "ipv6Allowed", this.ipv6Allowed);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VIF.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.VifOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.VifOperations>() : this.currentOperations);
+            map.put("device", this.device == null ? "" : this.device);
+            map.put("network", this.network == null ? new Network("OpaqueRef:NULL") : this.network);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("MAC", this.MAC == null ? "" : this.MAC);
+            map.put("MTU", this.MTU == null ? 0 : this.MTU);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("currently_attached", this.currentlyAttached == null ? false : this.currentlyAttached);
+            map.put("status_code", this.statusCode == null ? 0 : this.statusCode);
+            map.put("status_detail", this.statusDetail == null ? "" : this.statusDetail);
+            map.put("runtime_properties", this.runtimeProperties == null ? new HashMap<String, String>() : this.runtimeProperties);
+            map.put("qos_algorithm_type", this.qosAlgorithmType == null ? "" : this.qosAlgorithmType);
+            map.put("qos_algorithm_params", this.qosAlgorithmParams == null ? new HashMap<String, String>() : this.qosAlgorithmParams);
+            map.put("qos_supported_algorithms", this.qosSupportedAlgorithms == null ? new LinkedHashSet<String>() : this.qosSupportedAlgorithms);
+            map.put("metrics", this.metrics == null ? new VIFMetrics("OpaqueRef:NULL") : this.metrics);
+            map.put("MAC_autogenerated", this.MACAutogenerated == null ? false : this.MACAutogenerated);
+            map.put("locking_mode", this.lockingMode == null ? Types.VifLockingMode.NETWORK_DEFAULT : this.lockingMode);
+            map.put("ipv4_allowed", this.ipv4Allowed == null ? new LinkedHashSet<String>() : this.ipv4Allowed);
+            map.put("ipv6_allowed", this.ipv6Allowed == null ? new LinkedHashSet<String>() : this.ipv6Allowed);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.VifOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.VifOperations> currentOperations;
+        /**
+         * order in which VIF backends are created by xapi
+         */
+        public String device;
+        /**
+         * virtual network to which this vif is connected
+         */
+        public Network network;
+        /**
+         * virtual machine to which this vif is connected
+         */
+        public VM VM;
+        /**
+         * ethernet MAC address of virtual interface, as exposed to guest
+         */
+        public String MAC;
+        /**
+         * MTU in octets
+         */
+        public Long MTU;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * is the device currently attached (erased on reboot)
+         */
+        public Boolean currentlyAttached;
+        /**
+         * error/success code associated with last attach-operation (erased on reboot)
+         */
+        public Long statusCode;
+        /**
+         * error/success information associated with last attach-operation status (erased on reboot)
+         */
+        public String statusDetail;
+        /**
+         * Device runtime properties
+         */
+        public Map<String, String> runtimeProperties;
+        /**
+         * QoS algorithm to use
+         */
+        public String qosAlgorithmType;
+        /**
+         * parameters for chosen QoS algorithm
+         */
+        public Map<String, String> qosAlgorithmParams;
+        /**
+         * supported QoS algorithms for this VIF
+         */
+        public Set<String> qosSupportedAlgorithms;
+        /**
+         * metrics associated with this VIF
+         */
+        public VIFMetrics metrics;
+        /**
+         * true if the MAC was autogenerated; false indicates it was set manually
+         */
+        public Boolean MACAutogenerated;
+        /**
+         * current locking mode of the VIF
+         */
+        public Types.VifLockingMode lockingMode;
+        /**
+         * A list of IPv4 addresses which can be used to filter traffic passing through this VIF
+         */
+        public Set<String> ipv4Allowed;
+        /**
+         * A list of IPv6 addresses which can be used to filter traffic passing through this VIF
+         */
+        public Set<String> ipv6Allowed;
+    }
+
+    /**
+     * Get a record containing the current state of the given VIF.
+     *
+     * @return all fields from the object
+     */
+    public VIF.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIFRecord(result);
+    }
+
+    /**
+     * Get a reference to the VIF instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VIF getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIF(result);
+    }
+
+    /**
+     * Create a new VIF instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VIF.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VIF instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VIF create(Connection c, VIF.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIF(result);
+    }
+
+    /**
+     * Destroy the specified VIF instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VIF instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Set<Types.VifOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVifOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.VifOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringVifOperations(result);
+    }
+
+    /**
+     * Get the device field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public String getDevice(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_device";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the network field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Network getNetwork(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_network";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetwork(result);
+    }
+
+    /**
+     * Get the VM field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the MAC field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public String getMAC(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_MAC";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the MTU field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Long getMTU(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_MTU";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the other_config field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the currently_attached field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getCurrentlyAttached(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_currently_attached";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the status_code field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Long getStatusCode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_status_code";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the status_detail field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public String getStatusDetail(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_status_detail";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the runtime_properties field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getRuntimeProperties(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_runtime_properties";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the qos/algorithm_type field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public String getQosAlgorithmType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_qos_algorithm_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the qos/algorithm_params field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getQosAlgorithmParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the qos/supported_algorithms field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Set<String> getQosSupportedAlgorithms(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_qos_supported_algorithms";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the metrics field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public VIFMetrics getMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIFMetrics(result);
+    }
+
+    /**
+     * Get the MAC_autogenerated field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getMACAutogenerated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_MAC_autogenerated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the locking_mode field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Types.VifLockingMode getLockingMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVifLockingMode(result);
+    }
+
+    /**
+     * Get the ipv4_allowed field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Set<String> getIpv4Allowed(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the ipv6_allowed field of the given VIF.
+     *
+     * @return value of the field
+     */
+    public Set<String> getIpv6Allowed(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Set the other_config field of the given VIF.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VIF.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VIF.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the qos/algorithm_type field of the given VIF.
+     *
+     * @param algorithmType New value to set
+     */
+    public void setQosAlgorithmType(Connection c, String algorithmType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_qos_algorithm_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(algorithmType)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the qos/algorithm_params field of the given VIF.
+     *
+     * @param algorithmParams New value to set
+     */
+    public void setQosAlgorithmParams(Connection c, Map<String, String> algorithmParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(algorithmParams)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the qos/algorithm_params field of the given VIF.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToQosAlgorithmParams(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.add_to_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the qos/algorithm_params field of the given VIF.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromQosAlgorithmParams(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.remove_from_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Hotplug the specified VIF, dynamically attaching it to the running VM
+     *
+     * @return Task
+     */
+    public Task plugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Hotplug the specified VIF, dynamically attaching it to the running VM
+     *
+     */
+    public void plug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Hot-unplug the specified VIF, dynamically unattaching it from the running VM
+     *
+     * @return Task
+     */
+    public Task unplugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Hot-unplug the specified VIF, dynamically unattaching it from the running VM
+     *
+     */
+    public void unplug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Forcibly unplug the specified VIF
+     *
+     * @return Task
+     */
+    public Task unplugForceAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.unplug_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Forcibly unplug the specified VIF
+     *
+     */
+    public void unplugForce(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.unplug_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the locking mode for this VIF
+     *
+     * @param value The new locking mode for the VIF
+     * @return Task
+     */
+    public Task setLockingModeAsync(Connection c, Types.VifLockingMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.set_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the locking mode for this VIF
+     *
+     * @param value The new locking mode for the VIF
+     */
+    public void setLockingMode(Connection c, Types.VifLockingMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the IPv4 addresses to which traffic on this VIF can be restricted
+     *
+     * @param value The IP addresses which will be associated with the VIF
+     * @return Task
+     */
+    public Task setIpv4AllowedAsync(Connection c, Set<String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.set_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the IPv4 addresses to which traffic on this VIF can be restricted
+     *
+     * @param value The IP addresses which will be associated with the VIF
+     */
+    public void setIpv4Allowed(Connection c, Set<String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Associates an IPv4 address with this VIF
+     *
+     * @param value The IP address which will be associated with the VIF
+     * @return Task
+     */
+    public Task addIpv4AllowedAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.add_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Associates an IPv4 address with this VIF
+     *
+     * @param value The IP address which will be associated with the VIF
+     */
+    public void addIpv4Allowed(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.add_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes an IPv4 address from this VIF
+     *
+     * @param value The IP address which will be removed from the VIF
+     * @return Task
+     */
+    public Task removeIpv4AllowedAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.remove_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes an IPv4 address from this VIF
+     *
+     * @param value The IP address which will be removed from the VIF
+     */
+    public void removeIpv4Allowed(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.remove_ipv4_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the IPv6 addresses to which traffic on this VIF can be restricted
+     *
+     * @param value The IP addresses which will be associated with the VIF
+     * @return Task
+     */
+    public Task setIpv6AllowedAsync(Connection c, Set<String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.set_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the IPv6 addresses to which traffic on this VIF can be restricted
+     *
+     * @param value The IP addresses which will be associated with the VIF
+     */
+    public void setIpv6Allowed(Connection c, Set<String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.set_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Associates an IPv6 address with this VIF
+     *
+     * @param value The IP address which will be associated with the VIF
+     * @return Task
+     */
+    public Task addIpv6AllowedAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.add_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Associates an IPv6 address with this VIF
+     *
+     * @param value The IP address which will be associated with the VIF
+     */
+    public void addIpv6Allowed(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.add_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes an IPv6 address from this VIF
+     *
+     * @param value The IP address which will be removed from the VIF
+     * @return Task
+     */
+    public Task removeIpv6AllowedAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VIF.remove_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes an IPv6 address from this VIF
+     *
+     * @param value The IP address which will be removed from the VIF
+     */
+    public void removeIpv6Allowed(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.remove_ipv6_allowed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VIFs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VIF> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVIF(result);
+    }
+
+    /**
+     * Return a map of VIF references to VIF records for all VIFs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VIF, VIF.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVIFVIFRecord(result);
+    }
+
+}
\ No newline at end of file


[17/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Host.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Host.java b/deps/XenServerJava/src/com/xensource/xenapi/Host.java
new file mode 100644
index 0000000..0bbae11
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Host.java
@@ -0,0 +1,3024 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A physical host
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Host extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Host(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Host, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Host)
+        {
+            Host other = (Host) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Host
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "memoryOverhead", this.memoryOverhead);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "APIVersionMajor", this.APIVersionMajor);
+            print.printf("%1$20s: %2$s\n", "APIVersionMinor", this.APIVersionMinor);
+            print.printf("%1$20s: %2$s\n", "APIVersionVendor", this.APIVersionVendor);
+            print.printf("%1$20s: %2$s\n", "APIVersionVendorImplementation", this.APIVersionVendorImplementation);
+            print.printf("%1$20s: %2$s\n", "enabled", this.enabled);
+            print.printf("%1$20s: %2$s\n", "softwareVersion", this.softwareVersion);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "capabilities", this.capabilities);
+            print.printf("%1$20s: %2$s\n", "cpuConfiguration", this.cpuConfiguration);
+            print.printf("%1$20s: %2$s\n", "schedPolicy", this.schedPolicy);
+            print.printf("%1$20s: %2$s\n", "supportedBootloaders", this.supportedBootloaders);
+            print.printf("%1$20s: %2$s\n", "residentVMs", this.residentVMs);
+            print.printf("%1$20s: %2$s\n", "logging", this.logging);
+            print.printf("%1$20s: %2$s\n", "PIFs", this.PIFs);
+            print.printf("%1$20s: %2$s\n", "suspendImageSr", this.suspendImageSr);
+            print.printf("%1$20s: %2$s\n", "crashDumpSr", this.crashDumpSr);
+            print.printf("%1$20s: %2$s\n", "crashdumps", this.crashdumps);
+            print.printf("%1$20s: %2$s\n", "patches", this.patches);
+            print.printf("%1$20s: %2$s\n", "PBDs", this.PBDs);
+            print.printf("%1$20s: %2$s\n", "hostCPUs", this.hostCPUs);
+            print.printf("%1$20s: %2$s\n", "cpuInfo", this.cpuInfo);
+            print.printf("%1$20s: %2$s\n", "hostname", this.hostname);
+            print.printf("%1$20s: %2$s\n", "address", this.address);
+            print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+            print.printf("%1$20s: %2$s\n", "licenseParams", this.licenseParams);
+            print.printf("%1$20s: %2$s\n", "haStatefiles", this.haStatefiles);
+            print.printf("%1$20s: %2$s\n", "haNetworkPeers", this.haNetworkPeers);
+            print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "externalAuthType", this.externalAuthType);
+            print.printf("%1$20s: %2$s\n", "externalAuthServiceName", this.externalAuthServiceName);
+            print.printf("%1$20s: %2$s\n", "externalAuthConfiguration", this.externalAuthConfiguration);
+            print.printf("%1$20s: %2$s\n", "edition", this.edition);
+            print.printf("%1$20s: %2$s\n", "licenseServer", this.licenseServer);
+            print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
+            print.printf("%1$20s: %2$s\n", "powerOnMode", this.powerOnMode);
+            print.printf("%1$20s: %2$s\n", "powerOnConfig", this.powerOnConfig);
+            print.printf("%1$20s: %2$s\n", "localCacheSr", this.localCacheSr);
+            print.printf("%1$20s: %2$s\n", "chipsetInfo", this.chipsetInfo);
+            print.printf("%1$20s: %2$s\n", "PCIs", this.PCIs);
+            print.printf("%1$20s: %2$s\n", "PGPUs", this.PGPUs);
+            print.printf("%1$20s: %2$s\n", "guestVCPUsParams", this.guestVCPUsParams);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a host.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("memory_overhead", this.memoryOverhead == null ? 0 : this.memoryOverhead);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.HostAllowedOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.HostAllowedOperations>() : this.currentOperations);
+            map.put("API_version_major", this.APIVersionMajor == null ? 0 : this.APIVersionMajor);
+            map.put("API_version_minor", this.APIVersionMinor == null ? 0 : this.APIVersionMinor);
+            map.put("API_version_vendor", this.APIVersionVendor == null ? "" : this.APIVersionVendor);
+            map.put("API_version_vendor_implementation", this.APIVersionVendorImplementation == null ? new HashMap<String, String>() : this.APIVersionVendorImplementation);
+            map.put("enabled", this.enabled == null ? false : this.enabled);
+            map.put("software_version", this.softwareVersion == null ? new HashMap<String, String>() : this.softwareVersion);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("capabilities", this.capabilities == null ? new LinkedHashSet<String>() : this.capabilities);
+            map.put("cpu_configuration", this.cpuConfiguration == null ? new HashMap<String, String>() : this.cpuConfiguration);
+            map.put("sched_policy", this.schedPolicy == null ? "" : this.schedPolicy);
+            map.put("supported_bootloaders", this.supportedBootloaders == null ? new LinkedHashSet<String>() : this.supportedBootloaders);
+            map.put("resident_VMs", this.residentVMs == null ? new LinkedHashSet<VM>() : this.residentVMs);
+            map.put("logging", this.logging == null ? new HashMap<String, String>() : this.logging);
+            map.put("PIFs", this.PIFs == null ? new LinkedHashSet<PIF>() : this.PIFs);
+            map.put("suspend_image_sr", this.suspendImageSr == null ? new SR("OpaqueRef:NULL") : this.suspendImageSr);
+            map.put("crash_dump_sr", this.crashDumpSr == null ? new SR("OpaqueRef:NULL") : this.crashDumpSr);
+            map.put("crashdumps", this.crashdumps == null ? new LinkedHashSet<HostCrashdump>() : this.crashdumps);
+            map.put("patches", this.patches == null ? new LinkedHashSet<HostPatch>() : this.patches);
+            map.put("PBDs", this.PBDs == null ? new LinkedHashSet<PBD>() : this.PBDs);
+            map.put("host_CPUs", this.hostCPUs == null ? new LinkedHashSet<HostCpu>() : this.hostCPUs);
+            map.put("cpu_info", this.cpuInfo == null ? new HashMap<String, String>() : this.cpuInfo);
+            map.put("hostname", this.hostname == null ? "" : this.hostname);
+            map.put("address", this.address == null ? "" : this.address);
+            map.put("metrics", this.metrics == null ? new HostMetrics("OpaqueRef:NULL") : this.metrics);
+            map.put("license_params", this.licenseParams == null ? new HashMap<String, String>() : this.licenseParams);
+            map.put("ha_statefiles", this.haStatefiles == null ? new LinkedHashSet<String>() : this.haStatefiles);
+            map.put("ha_network_peers", this.haNetworkPeers == null ? new LinkedHashSet<String>() : this.haNetworkPeers);
+            map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("external_auth_type", this.externalAuthType == null ? "" : this.externalAuthType);
+            map.put("external_auth_service_name", this.externalAuthServiceName == null ? "" : this.externalAuthServiceName);
+            map.put("external_auth_configuration", this.externalAuthConfiguration == null ? new HashMap<String, String>() : this.externalAuthConfiguration);
+            map.put("edition", this.edition == null ? "" : this.edition);
+            map.put("license_server", this.licenseServer == null ? new HashMap<String, String>() : this.licenseServer);
+            map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
+            map.put("power_on_mode", this.powerOnMode == null ? "" : this.powerOnMode);
+            map.put("power_on_config", this.powerOnConfig == null ? new HashMap<String, String>() : this.powerOnConfig);
+            map.put("local_cache_sr", this.localCacheSr == null ? new SR("OpaqueRef:NULL") : this.localCacheSr);
+            map.put("chipset_info", this.chipsetInfo == null ? new HashMap<String, String>() : this.chipsetInfo);
+            map.put("PCIs", this.PCIs == null ? new LinkedHashSet<PCI>() : this.PCIs);
+            map.put("PGPUs", this.PGPUs == null ? new LinkedHashSet<PGPU>() : this.PGPUs);
+            map.put("guest_VCPUs_params", this.guestVCPUsParams == null ? new HashMap<String, String>() : this.guestVCPUsParams);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * Virtualization memory overhead (bytes).
+         */
+        public Long memoryOverhead;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.HostAllowedOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.HostAllowedOperations> currentOperations;
+        /**
+         * major version number
+         */
+        public Long APIVersionMajor;
+        /**
+         * minor version number
+         */
+        public Long APIVersionMinor;
+        /**
+         * identification of vendor
+         */
+        public String APIVersionVendor;
+        /**
+         * details of vendor implementation
+         */
+        public Map<String, String> APIVersionVendorImplementation;
+        /**
+         * True if the host is currently enabled
+         */
+        public Boolean enabled;
+        /**
+         * version strings
+         */
+        public Map<String, String> softwareVersion;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * Xen capabilities
+         */
+        public Set<String> capabilities;
+        /**
+         * The CPU configuration on this host.  May contain keys such as "nr_nodes", "sockets_per_node", "cores_per_socket", or "threads_per_core"
+         */
+        public Map<String, String> cpuConfiguration;
+        /**
+         * Scheduler policy currently in force on this host
+         */
+        public String schedPolicy;
+        /**
+         * a list of the bootloaders installed on the machine
+         */
+        public Set<String> supportedBootloaders;
+        /**
+         * list of VMs currently resident on host
+         */
+        public Set<VM> residentVMs;
+        /**
+         * logging configuration
+         */
+        public Map<String, String> logging;
+        /**
+         * physical network interfaces
+         */
+        public Set<PIF> PIFs;
+        /**
+         * The SR in which VDIs for suspend images are created
+         */
+        public SR suspendImageSr;
+        /**
+         * The SR in which VDIs for crash dumps are created
+         */
+        public SR crashDumpSr;
+        /**
+         * Set of host crash dumps
+         */
+        public Set<HostCrashdump> crashdumps;
+        /**
+         * Set of host patches
+         */
+        public Set<HostPatch> patches;
+        /**
+         * physical blockdevices
+         */
+        public Set<PBD> PBDs;
+        /**
+         * The physical CPUs on this host
+         */
+        public Set<HostCpu> hostCPUs;
+        /**
+         * Details about the physical CPUs on this host
+         */
+        public Map<String, String> cpuInfo;
+        /**
+         * The hostname of this host
+         */
+        public String hostname;
+        /**
+         * The address by which this host can be contacted from any other host in the pool
+         */
+        public String address;
+        /**
+         * metrics associated with this host
+         */
+        public HostMetrics metrics;
+        /**
+         * State of the current license
+         */
+        public Map<String, String> licenseParams;
+        /**
+         * The set of statefiles accessible from this host
+         */
+        public Set<String> haStatefiles;
+        /**
+         * The set of hosts visible via the network from this host
+         */
+        public Set<String> haNetworkPeers;
+        /**
+         * Binary blobs associated with this host
+         */
+        public Map<String, Blob> blobs;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * type of external authentication service configured; empty if none configured.
+         */
+        public String externalAuthType;
+        /**
+         * name of external authentication service configured; empty if none configured.
+         */
+        public String externalAuthServiceName;
+        /**
+         * configuration specific to external authentication service
+         */
+        public Map<String, String> externalAuthConfiguration;
+        /**
+         * XenServer edition
+         */
+        public String edition;
+        /**
+         * Contact information of the license server
+         */
+        public Map<String, String> licenseServer;
+        /**
+         * BIOS strings
+         */
+        public Map<String, String> biosStrings;
+        /**
+         * The power on mode
+         */
+        public String powerOnMode;
+        /**
+         * The power on config
+         */
+        public Map<String, String> powerOnConfig;
+        /**
+         * The SR that is used as a local cache
+         */
+        public SR localCacheSr;
+        /**
+         * Information about chipset features
+         */
+        public Map<String, String> chipsetInfo;
+        /**
+         * List of PCI devices in the host
+         */
+        public Set<PCI> PCIs;
+        /**
+         * List of physical GPUs in the host
+         */
+        public Set<PGPU> PGPUs;
+        /**
+         * VCPUs params to apply to all resident guests
+         */
+        public Map<String, String> guestVCPUsParams;
+    }
+
+    /**
+     * Get a record containing the current state of the given host.
+     *
+     * @return all fields from the object
+     */
+    public Host.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostRecord(result);
+    }
+
+    /**
+     * Get a reference to the host instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Host getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get all the host instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<Host> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHost(result);
+    }
+
+    /**
+     * Get the uuid field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the memory/overhead field of the given host.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryOverhead(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_memory_overhead";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<Types.HostAllowedOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostAllowedOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.HostAllowedOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringHostAllowedOperations(result);
+    }
+
+    /**
+     * Get the API_version/major field of the given host.
+     *
+     * @return value of the field
+     */
+    public Long getAPIVersionMajor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_API_version_major";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the API_version/minor field of the given host.
+     *
+     * @return value of the field
+     */
+    public Long getAPIVersionMinor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_API_version_minor";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the API_version/vendor field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getAPIVersionVendor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_API_version_vendor";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the API_version/vendor_implementation field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getAPIVersionVendorImplementation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_API_version_vendor_implementation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the enabled field of the given host.
+     *
+     * @return value of the field
+     */
+    public Boolean getEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the software_version field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getSoftwareVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_software_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the other_config field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the capabilities field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<String> getCapabilities(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_capabilities";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the cpu_configuration field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getCpuConfiguration(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_cpu_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the sched_policy field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getSchedPolicy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_sched_policy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the supported_bootloaders field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<String> getSupportedBootloaders(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_supported_bootloaders";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the resident_VMs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<VM> getResidentVMs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_resident_VMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Get the logging field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getLogging(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_logging";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the PIFs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<PIF> getPIFs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_PIFs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Get the suspend_image_sr field of the given host.
+     *
+     * @return value of the field
+     */
+    public SR getSuspendImageSr(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_suspend_image_sr";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the crash_dump_sr field of the given host.
+     *
+     * @return value of the field
+     */
+    public SR getCrashDumpSr(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_crash_dump_sr";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the crashdumps field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<HostCrashdump> getCrashdumps(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_crashdumps";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostCrashdump(result);
+    }
+
+    /**
+     * Get the patches field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<HostPatch> getPatches(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_patches";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostPatch(result);
+    }
+
+    /**
+     * Get the PBDs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<PBD> getPBDs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_PBDs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPBD(result);
+    }
+
+    /**
+     * Get the host_CPUs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<HostCpu> getHostCPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_host_CPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostCpu(result);
+    }
+
+    /**
+     * Get the cpu_info field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getCpuInfo(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_cpu_info";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the hostname field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getHostname(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_hostname";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the address field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getAddress(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_address";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the metrics field of the given host.
+     *
+     * @return value of the field
+     */
+    public HostMetrics getMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostMetrics(result);
+    }
+
+    /**
+     * Get the license_params field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getLicenseParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_license_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the ha_statefiles field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<String> getHaStatefiles(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_ha_statefiles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the ha_network_peers field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<String> getHaNetworkPeers(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_ha_network_peers";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the blobs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, Blob> getBlobs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_blobs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringBlob(result);
+    }
+
+    /**
+     * Get the tags field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the external_auth_type field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getExternalAuthType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_external_auth_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the external_auth_service_name field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getExternalAuthServiceName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_external_auth_service_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the external_auth_configuration field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getExternalAuthConfiguration(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_external_auth_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the edition field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getEdition(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_edition";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the license_server field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getLicenseServer(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_license_server";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the bios_strings field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getBiosStrings(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_bios_strings";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the power_on_mode field of the given host.
+     *
+     * @return value of the field
+     */
+    public String getPowerOnMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_power_on_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the power_on_config field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getPowerOnConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_power_on_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the local_cache_sr field of the given host.
+     *
+     * @return value of the field
+     */
+    public SR getLocalCacheSr(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_local_cache_sr";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the chipset_info field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getChipsetInfo(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_chipset_info";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the PCIs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<PCI> getPCIs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_PCIs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPCI(result);
+    }
+
+    /**
+     * Get the PGPUs field of the given host.
+     *
+     * @return value of the field
+     */
+    public Set<PGPU> getPGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_PGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPGPU(result);
+    }
+
+    /**
+     * Get the guest_VCPUs_params field of the given host.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getGuestVCPUsParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_guest_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the name/label field of the given host.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given host.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given host.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given host.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given host.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the logging field of the given host.
+     *
+     * @param logging New value to set
+     */
+    public void setLogging(Connection c, Map<String, String> logging) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_logging";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(logging)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the logging field of the given host.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToLogging(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.add_to_logging";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the logging field of the given host.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromLogging(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.remove_from_logging";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the suspend_image_sr field of the given host.
+     *
+     * @param suspendImageSr New value to set
+     */
+    public void setSuspendImageSr(Connection c, SR suspendImageSr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_suspend_image_sr";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(suspendImageSr)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the crash_dump_sr field of the given host.
+     *
+     * @param crashDumpSr New value to set
+     */
+    public void setCrashDumpSr(Connection c, SR crashDumpSr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_crash_dump_sr";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(crashDumpSr)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the hostname field of the given host.
+     *
+     * @param hostname New value to set
+     */
+    public void setHostname(Connection c, String hostname) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_hostname";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(hostname)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the address field of the given host.
+     *
+     * @param address New value to set
+     */
+    public void setAddress(Connection c, String address) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_address";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(address)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the tags field of the given host.
+     *
+     * @param tags New value to set
+     */
+    public void setTags(Connection c, Set<String> tags) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given value to the tags field of the given host.  If the value is already in that Set, then do nothing.
+     *
+     * @param value New value to add
+     */
+    public void addTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.add_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given value from the tags field of the given host.  If the value is not in that Set, then do nothing.
+     *
+     * @param value Value to remove
+     */
+    public void removeTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.remove_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the license_server field of the given host.
+     *
+     * @param licenseServer New value to set
+     */
+    public void setLicenseServer(Connection c, Map<String, String> licenseServer) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_license_server";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(licenseServer)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the license_server field of the given host.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToLicenseServer(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.add_to_license_server";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the license_server field of the given host.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromLicenseServer(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.remove_from_license_server";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the guest_VCPUs_params field of the given host.
+     *
+     * @param guestVCPUsParams New value to set
+     */
+    public void setGuestVCPUsParams(Connection c, Map<String, String> guestVCPUsParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.set_guest_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(guestVCPUsParams)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the guest_VCPUs_params field of the given host.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToGuestVCPUsParams(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.add_to_guest_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the guest_VCPUs_params field of the given host.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromGuestVCPUsParams(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.remove_from_guest_VCPUs_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Puts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.
+     *
+     * @return Task
+     */
+    public Task disableAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.disable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Puts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.
+     *
+     */
+    public void disable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.disable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Puts the host into a state in which new VMs can be started.
+     *
+     * @return Task
+     */
+    public Task enableAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.enable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Puts the host into a state in which new VMs can be started.
+     *
+     */
+    public void enable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.enable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Shutdown the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+     *
+     * @return Task
+     */
+    public Task shutdownAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Shutdown the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+     *
+     */
+    public void shutdown(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.shutdown";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Reboot the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+     *
+     * @return Task
+     */
+    public Task rebootAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.reboot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Reboot the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+     *
+     */
+    public void reboot(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.reboot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the host xen dmesg.
+     *
+     * @return Task
+     */
+    public Task dmesgAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.dmesg";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Get the host xen dmesg.
+     *
+     * @return dmesg string
+     */
+    public String dmesg(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.dmesg";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host xen dmesg, and clear the buffer.
+     *
+     * @return Task
+     */
+    public Task dmesgClearAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.dmesg_clear";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Get the host xen dmesg, and clear the buffer.
+     *
+     * @return dmesg string
+     */
+    public String dmesgClear(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.dmesg_clear";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host's log file
+     *
+     * @return Task
+     */
+    public Task getLogAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.get_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Get the host's log file
+     *
+     * @return The contents of the host's primary log file
+     */
+    public String getLog(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Inject the given string as debugging keys into Xen
+     *
+     * @param keys The keys to send
+     * @return Task
+     */
+    public Task sendDebugKeysAsync(Connection c, String keys) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.send_debug_keys";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(keys)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Inject the given string as debugging keys into Xen
+     *
+     * @param keys The keys to send
+     */
+    public void sendDebugKeys(Connection c, String keys) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.send_debug_keys";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(keys)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Run xen-bugtool --yestoall and upload the output to Citrix support
+     *
+     * @param url The URL to upload to
+     * @param options Extra configuration operations
+     * @return Task
+     */
+    public Task bugreportUploadAsync(Connection c, String url, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.bugreport_upload";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Run xen-bugtool --yestoall and upload the output to Citrix support
+     *
+     * @param url The URL to upload to
+     * @param options Extra configuration operations
+     */
+    public void bugreportUpload(Connection c, String url, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.bugreport_upload";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * List all supported methods
+     *
+     * @return The name of every supported method.
+     */
+    public static Set<String> listMethods(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.list_methods";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Apply a new license to a host
+     *
+     * @param contents The contents of the license file, base64 encoded
+     * @return Task
+     */
+    public Task licenseApplyAsync(Connection c, String contents) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.LicenseProcessingError {
+        String method_call = "Async.host.license_apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(contents)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Apply a new license to a host
+     *
+     * @param contents The contents of the license file, base64 encoded
+     */
+    public void licenseApply(Connection c, String contents) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.LicenseProcessingError {
+        String method_call = "host.license_apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(contents)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Destroy specified host record in database
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy specified host record in database
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Attempt to power-on the host (if the capability exists).
+     *
+     * @return Task
+     */
+    public Task powerOnAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.power_on";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Attempt to power-on the host (if the capability exists).
+     *
+     */
+    public void powerOn(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.power_on";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call disables HA on the local host. This should only be used with extreme care.
+     *
+     */
+    public static void emergencyHaDisable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.emergency_ha_disable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @return A set of data sources
+     */
+    public Set<DataSource.Record> getDataSources(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_data_sources";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfDataSourceRecord(result);
+    }
+
+    /**
+     * Start recording the specified data source
+     *
+     * @param dataSource The data source to record
+     */
+    public void recordDataSource(Connection c, String dataSource) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.record_data_source";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Query the latest value of the specified data source
+     *
+     * @param dataSource The data source to query
+     * @return The latest value, averaged over the last 5 seconds
+     */
+    public Double queryDataSource(Connection c, String dataSource) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.query_data_source";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Forget the recorded statistics related to the specified data source
+     *
+     * @param dataSource The data source whose archives are to be forgotten
+     */
+    public void forgetDataSourceArchives(Connection c, String dataSource) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.forget_data_source_archives";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Check this host can be evacuated.
+     *
+     * @return Task
+     */
+    public Task assertCanEvacuateAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.assert_can_evacuate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Check this host can be evacuated.
+     *
+     */
+    public void assertCanEvacuate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.assert_can_evacuate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a set of VMs which prevent the host being evacuated, with per-VM error codes
+     *
+     * @return Task
+     */
+    public Task getVmsWhichPreventEvacuationAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.get_vms_which_prevent_evacuation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Return a set of VMs which prevent the host being evacuated, with per-VM error codes
+     *
+     * @return VMs which block evacuation together with reasons
+     */
+    public Map<VM, Set<String>> getVmsWhichPreventEvacuation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_vms_which_prevent_evacuation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMSetOfString(result);
+    }
+
+    /**
+     * Return a set of VMs which are not co-operating with the host's memory control system
+     * @deprecated
+     *
+     * @return Task
+     */
+   @Deprecated public Task getUncooperativeResidentVMsAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.get_uncooperative_resident_VMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Return a set of VMs which are not co-operating with the host's memory control system
+     * @deprecated
+     *
+     * @return VMs which are not co-operating
+     */
+   @Deprecated public Set<VM> getUncooperativeResidentVMs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.get_uncooperative_resident_VMs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVM(result);
+    }
+
+    /**
+     * Migrate all VMs off of this host, where possible.
+     *
+     * @return Task
+     */
+    public Task evacuateAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.evacuate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Migrate all VMs off of this host, where possible.
+     *
+     */
+    public void evacuate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.evacuate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Re-configure syslog logging
+     *
+     * @return Task
+     */
+    public Task syslogReconfigureAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host.syslog_reconfigure";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Re-configure syslog logging
+     *
+     */
+    public void syslogReconfigure(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host.syslog_reconfigure";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Reconfigure the management network interface
+     *
+     * @param pif reference to a PIF object corresponding to the management interface
+     * @return Task
+     */
+    public static Task managementReconfigureAsync(Connection c, PIF pif) throws
+       BadServerResponse,
+   

<TRUNCATED>

[14/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PGPU.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PGPU.java b/deps/XenServerJava/src/com/xensource/xenapi/PGPU.java
new file mode 100644
index 0000000..43eadf5
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PGPU.java
@@ -0,0 +1,613 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A physical GPU (pGPU)
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PGPU extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PGPU(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PGPU, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PGPU)
+        {
+            PGPU other = (PGPU) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PGPU
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "PCI", this.PCI);
+            print.printf("%1$20s: %2$s\n", "GPUGroup", this.GPUGroup);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "supportedVGPUTypes", this.supportedVGPUTypes);
+            print.printf("%1$20s: %2$s\n", "enabledVGPUTypes", this.enabledVGPUTypes);
+            print.printf("%1$20s: %2$s\n", "residentVGPUs", this.residentVGPUs);
+            print.printf("%1$20s: %2$s\n", "supportedVGPUMaxCapacities", this.supportedVGPUMaxCapacities);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a PGPU.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("PCI", this.PCI == null ? new PCI("OpaqueRef:NULL") : this.PCI);
+            map.put("GPU_group", this.GPUGroup == null ? new GPUGroup("OpaqueRef:NULL") : this.GPUGroup);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("supported_VGPU_types", this.supportedVGPUTypes == null ? new LinkedHashSet<VGPUType>() : this.supportedVGPUTypes);
+            map.put("enabled_VGPU_types", this.enabledVGPUTypes == null ? new LinkedHashSet<VGPUType>() : this.enabledVGPUTypes);
+            map.put("resident_VGPUs", this.residentVGPUs == null ? new LinkedHashSet<VGPU>() : this.residentVGPUs);
+            map.put("supported_VGPU_max_capacities", this.supportedVGPUMaxCapacities == null ? new HashMap<VGPUType, Long>() : this.supportedVGPUMaxCapacities);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Link to underlying PCI device
+         */
+        public PCI PCI;
+        /**
+         * GPU group the pGPU is contained in
+         */
+        public GPUGroup GPUGroup;
+        /**
+         * Host that own the GPU
+         */
+        public Host host;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * List of VGPU types supported by the underlying hardware
+         */
+        public Set<VGPUType> supportedVGPUTypes;
+        /**
+         * List of VGPU types which have been enabled for this PGPU
+         */
+        public Set<VGPUType> enabledVGPUTypes;
+        /**
+         * List of VGPUs running on this PGPU
+         */
+        public Set<VGPU> residentVGPUs;
+        /**
+         * A map relating each VGPU type supported on this GPU to the maximum number of VGPUs of that type which can run simultaneously on this GPU
+         */
+        public Map<VGPUType, Long> supportedVGPUMaxCapacities;
+    }
+
+    /**
+     * Get a record containing the current state of the given PGPU.
+     *
+     * @return all fields from the object
+     */
+    public PGPU.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPGPURecord(result);
+    }
+
+    /**
+     * Get a reference to the PGPU instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PGPU getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPGPU(result);
+    }
+
+    /**
+     * Get the uuid field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the PCI field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public PCI getPCI(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_PCI";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPCI(result);
+    }
+
+    /**
+     * Get the GPU_group field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public GPUGroup getGPUGroup(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_GPU_group";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toGPUGroup(result);
+    }
+
+    /**
+     * Get the host field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the other_config field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the supported_VGPU_types field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Set<VGPUType> getSupportedVGPUTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_supported_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPUType(result);
+    }
+
+    /**
+     * Get the enabled_VGPU_types field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Set<VGPUType> getEnabledVGPUTypes(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPUType(result);
+    }
+
+    /**
+     * Get the resident_VGPUs field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Set<VGPU> getResidentVGPUs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_resident_VGPUs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVGPU(result);
+    }
+
+    /**
+     * Get the supported_VGPU_max_capacities field of the given PGPU.
+     *
+     * @return value of the field
+     */
+    public Map<VGPUType, Long> getSupportedVGPUMaxCapacities(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_supported_VGPU_max_capacities";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVGPUTypeLong(result);
+    }
+
+    /**
+     * Set the other_config field of the given PGPU.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given PGPU.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given PGPU.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU type to enable
+     * @return Task
+     */
+    public Task addEnabledVGPUTypesAsync(Connection c, VGPUType value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PGPU.add_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU type to enable
+     */
+    public void addEnabledVGPUTypes(Connection c, VGPUType value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.add_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU type to disable
+     * @return Task
+     */
+    public Task removeEnabledVGPUTypesAsync(Connection c, VGPUType value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PGPU.remove_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU type to disable
+     */
+    public void removeEnabledVGPUTypes(Connection c, VGPUType value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.remove_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU types to enable
+     * @return Task
+     */
+    public Task setEnabledVGPUTypesAsync(Connection c, Set<VGPUType> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PGPU.set_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param value The VGPU types to enable
+     */
+    public void setEnabledVGPUTypes(Connection c, Set<VGPUType> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.set_enabled_VGPU_types";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param value The group to which the PGPU will be moved
+     * @return Task
+     */
+    public Task setGPUGroupAsync(Connection c, GPUGroup value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PGPU.set_GPU_group";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param value The group to which the PGPU will be moved
+     */
+    public void setGPUGroup(Connection c, GPUGroup value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.set_GPU_group";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param vgpuType The VGPU type for which we want to find the number of VGPUs which can still be started on this PGPU
+     * @return Task
+     */
+    public Task getRemainingCapacityAsync(Connection c, VGPUType vgpuType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PGPU.get_remaining_capacity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 
+     *
+     * @param vgpuType The VGPU type for which we want to find the number of VGPUs which can still be started on this PGPU
+     * @return The number of VGPUs of the specified type which can still be started on this PGPU
+     */
+    public Long getRemainingCapacity(Connection c, VGPUType vgpuType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_remaining_capacity";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Return a list of all the PGPUs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PGPU> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPGPU(result);
+    }
+
+    /**
+     * Return a map of PGPU references to PGPU records for all PGPUs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PGPU, PGPU.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PGPU.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPGPUPGPURecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PIF.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PIF.java b/deps/XenServerJava/src/com/xensource/xenapi/PIF.java
new file mode 100644
index 0000000..e75b565
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PIF.java
@@ -0,0 +1,1401 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A physical network interface (note separate VLANs are represented as several PIFs)
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PIF extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PIF(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PIF, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PIF)
+        {
+            PIF other = (PIF) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PIF
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "device", this.device);
+            print.printf("%1$20s: %2$s\n", "network", this.network);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "MAC", this.MAC);
+            print.printf("%1$20s: %2$s\n", "MTU", this.MTU);
+            print.printf("%1$20s: %2$s\n", "VLAN", this.VLAN);
+            print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+            print.printf("%1$20s: %2$s\n", "physical", this.physical);
+            print.printf("%1$20s: %2$s\n", "currentlyAttached", this.currentlyAttached);
+            print.printf("%1$20s: %2$s\n", "ipConfigurationMode", this.ipConfigurationMode);
+            print.printf("%1$20s: %2$s\n", "IP", this.IP);
+            print.printf("%1$20s: %2$s\n", "netmask", this.netmask);
+            print.printf("%1$20s: %2$s\n", "gateway", this.gateway);
+            print.printf("%1$20s: %2$s\n", "DNS", this.DNS);
+            print.printf("%1$20s: %2$s\n", "bondSlaveOf", this.bondSlaveOf);
+            print.printf("%1$20s: %2$s\n", "bondMasterOf", this.bondMasterOf);
+            print.printf("%1$20s: %2$s\n", "VLANMasterOf", this.VLANMasterOf);
+            print.printf("%1$20s: %2$s\n", "VLANSlaveOf", this.VLANSlaveOf);
+            print.printf("%1$20s: %2$s\n", "management", this.management);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "disallowUnplug", this.disallowUnplug);
+            print.printf("%1$20s: %2$s\n", "tunnelAccessPIFOf", this.tunnelAccessPIFOf);
+            print.printf("%1$20s: %2$s\n", "tunnelTransportPIFOf", this.tunnelTransportPIFOf);
+            print.printf("%1$20s: %2$s\n", "ipv6ConfigurationMode", this.ipv6ConfigurationMode);
+            print.printf("%1$20s: %2$s\n", "IPv6", this.IPv6);
+            print.printf("%1$20s: %2$s\n", "ipv6Gateway", this.ipv6Gateway);
+            print.printf("%1$20s: %2$s\n", "primaryAddressType", this.primaryAddressType);
+            print.printf("%1$20s: %2$s\n", "managed", this.managed);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a PIF.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("device", this.device == null ? "" : this.device);
+            map.put("network", this.network == null ? new Network("OpaqueRef:NULL") : this.network);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("MAC", this.MAC == null ? "" : this.MAC);
+            map.put("MTU", this.MTU == null ? 0 : this.MTU);
+            map.put("VLAN", this.VLAN == null ? 0 : this.VLAN);
+            map.put("metrics", this.metrics == null ? new PIFMetrics("OpaqueRef:NULL") : this.metrics);
+            map.put("physical", this.physical == null ? false : this.physical);
+            map.put("currently_attached", this.currentlyAttached == null ? false : this.currentlyAttached);
+            map.put("ip_configuration_mode", this.ipConfigurationMode == null ? Types.IpConfigurationMode.UNRECOGNIZED : this.ipConfigurationMode);
+            map.put("IP", this.IP == null ? "" : this.IP);
+            map.put("netmask", this.netmask == null ? "" : this.netmask);
+            map.put("gateway", this.gateway == null ? "" : this.gateway);
+            map.put("DNS", this.DNS == null ? "" : this.DNS);
+            map.put("bond_slave_of", this.bondSlaveOf == null ? new Bond("OpaqueRef:NULL") : this.bondSlaveOf);
+            map.put("bond_master_of", this.bondMasterOf == null ? new LinkedHashSet<Bond>() : this.bondMasterOf);
+            map.put("VLAN_master_of", this.VLANMasterOf == null ? new VLAN("OpaqueRef:NULL") : this.VLANMasterOf);
+            map.put("VLAN_slave_of", this.VLANSlaveOf == null ? new LinkedHashSet<VLAN>() : this.VLANSlaveOf);
+            map.put("management", this.management == null ? false : this.management);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("disallow_unplug", this.disallowUnplug == null ? false : this.disallowUnplug);
+            map.put("tunnel_access_PIF_of", this.tunnelAccessPIFOf == null ? new LinkedHashSet<Tunnel>() : this.tunnelAccessPIFOf);
+            map.put("tunnel_transport_PIF_of", this.tunnelTransportPIFOf == null ? new LinkedHashSet<Tunnel>() : this.tunnelTransportPIFOf);
+            map.put("ipv6_configuration_mode", this.ipv6ConfigurationMode == null ? Types.Ipv6ConfigurationMode.UNRECOGNIZED : this.ipv6ConfigurationMode);
+            map.put("IPv6", this.IPv6 == null ? new LinkedHashSet<String>() : this.IPv6);
+            map.put("ipv6_gateway", this.ipv6Gateway == null ? "" : this.ipv6Gateway);
+            map.put("primary_address_type", this.primaryAddressType == null ? Types.PrimaryAddressType.UNRECOGNIZED : this.primaryAddressType);
+            map.put("managed", this.managed == null ? false : this.managed);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * machine-readable name of the interface (e.g. eth0)
+         */
+        public String device;
+        /**
+         * virtual network to which this pif is connected
+         */
+        public Network network;
+        /**
+         * physical machine to which this pif is connected
+         */
+        public Host host;
+        /**
+         * ethernet MAC address of physical interface
+         */
+        public String MAC;
+        /**
+         * MTU in octets
+         */
+        public Long MTU;
+        /**
+         * VLAN tag for all traffic passing through this interface
+         */
+        public Long VLAN;
+        /**
+         * metrics associated with this PIF
+         */
+        public PIFMetrics metrics;
+        /**
+         * true if this represents a physical network interface
+         */
+        public Boolean physical;
+        /**
+         * true if this interface is online
+         */
+        public Boolean currentlyAttached;
+        /**
+         * Sets if and how this interface gets an IP address
+         */
+        public Types.IpConfigurationMode ipConfigurationMode;
+        /**
+         * IP address
+         */
+        public String IP;
+        /**
+         * IP netmask
+         */
+        public String netmask;
+        /**
+         * IP gateway
+         */
+        public String gateway;
+        /**
+         * IP address of DNS servers to use
+         */
+        public String DNS;
+        /**
+         * Indicates which bond this interface is part of
+         */
+        public Bond bondSlaveOf;
+        /**
+         * Indicates this PIF represents the results of a bond
+         */
+        public Set<Bond> bondMasterOf;
+        /**
+         * Indicates wich VLAN this interface receives untagged traffic from
+         */
+        public VLAN VLANMasterOf;
+        /**
+         * Indicates which VLANs this interface transmits tagged traffic to
+         */
+        public Set<VLAN> VLANSlaveOf;
+        /**
+         * Indicates whether the control software is listening for connections on this interface
+         */
+        public Boolean management;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * Prevent this PIF from being unplugged; set this to notify the management tool-stack that the PIF has a special use and should not be unplugged under any circumstances (e.g. because you're running storage traffic over it)
+         */
+        public Boolean disallowUnplug;
+        /**
+         * Indicates to which tunnel this PIF gives access
+         */
+        public Set<Tunnel> tunnelAccessPIFOf;
+        /**
+         * Indicates to which tunnel this PIF provides transport
+         */
+        public Set<Tunnel> tunnelTransportPIFOf;
+        /**
+         * Sets if and how this interface gets an IPv6 address
+         */
+        public Types.Ipv6ConfigurationMode ipv6ConfigurationMode;
+        /**
+         * IPv6 address
+         */
+        public Set<String> IPv6;
+        /**
+         * IPv6 gateway
+         */
+        public String ipv6Gateway;
+        /**
+         * Which protocol should define the primary address of this interface
+         */
+        public Types.PrimaryAddressType primaryAddressType;
+        /**
+         * Indicates whether the interface is managed by xapi. If it is not, then xapi will not configure the interface, the commands PIF.plug/unplug/reconfigure_ip(v6) can not be used, nor can the interface be bonded or have VLANs based on top through xapi.
+         */
+        public Boolean managed;
+    }
+
+    /**
+     * Get a record containing the current state of the given PIF.
+     *
+     * @return all fields from the object
+     */
+    public PIF.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIFRecord(result);
+    }
+
+    /**
+     * Get a reference to the PIF instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PIF getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the uuid field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the device field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getDevice(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_device";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the network field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Network getNetwork(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_network";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetwork(result);
+    }
+
+    /**
+     * Get the host field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the MAC field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getMAC(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_MAC";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the MTU field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Long getMTU(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_MTU";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the VLAN field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Long getVLAN(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_VLAN";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the metrics field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public PIFMetrics getMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIFMetrics(result);
+    }
+
+    /**
+     * Get the physical field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getPhysical(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_physical";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the currently_attached field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getCurrentlyAttached(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_currently_attached";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the ip_configuration_mode field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Types.IpConfigurationMode getIpConfigurationMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_ip_configuration_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toIpConfigurationMode(result);
+    }
+
+    /**
+     * Get the IP field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getIP(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_IP";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the netmask field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getNetmask(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_netmask";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the gateway field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getGateway(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_gateway";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the DNS field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getDNS(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_DNS";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the bond_slave_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Bond getBondSlaveOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_bond_slave_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBond(result);
+    }
+
+    /**
+     * Get the bond_master_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Set<Bond> getBondMasterOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_bond_master_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfBond(result);
+    }
+
+    /**
+     * Get the VLAN_master_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public VLAN getVLANMasterOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_VLAN_master_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVLAN(result);
+    }
+
+    /**
+     * Get the VLAN_slave_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Set<VLAN> getVLANSlaveOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_VLAN_slave_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVLAN(result);
+    }
+
+    /**
+     * Get the management field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getManagement(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_management";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the disallow_unplug field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getDisallowUnplug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_disallow_unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the tunnel_access_PIF_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Set<Tunnel> getTunnelAccessPIFOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_tunnel_access_PIF_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTunnel(result);
+    }
+
+    /**
+     * Get the tunnel_transport_PIF_of field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Set<Tunnel> getTunnelTransportPIFOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_tunnel_transport_PIF_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTunnel(result);
+    }
+
+    /**
+     * Get the ipv6_configuration_mode field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Types.Ipv6ConfigurationMode getIpv6ConfigurationMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_ipv6_configuration_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toIpv6ConfigurationMode(result);
+    }
+
+    /**
+     * Get the IPv6 field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Set<String> getIPv6(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_IPv6";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the ipv6_gateway field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public String getIpv6Gateway(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_ipv6_gateway";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the primary_address_type field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Types.PrimaryAddressType getPrimaryAddressType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_primary_address_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPrimaryAddressType(result);
+    }
+
+    /**
+     * Get the managed field of the given PIF.
+     *
+     * @return value of the field
+     */
+    public Boolean getManaged(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_managed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Set the other_config field of the given PIF.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given PIF.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given PIF.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the disallow_unplug field of the given PIF.
+     *
+     * @param disallowUnplug New value to set
+     */
+    public void setDisallowUnplug(Connection c, Boolean disallowUnplug) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.set_disallow_unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(disallowUnplug)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a VLAN interface from an existing physical interface. This call is deprecated: use VLAN.create instead
+     * @deprecated
+     *
+     * @param device physical interface on which to create the VLAN interface
+     * @param network network to which this interface should be connected
+     * @param host physical machine to which this PIF is connected
+     * @param VLAN VLAN tag for the new interface
+     * @return Task
+     */
+   @Deprecated public static Task createVLANAsync(Connection c, String device, Network network, Host host, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "Async.PIF.create_VLAN";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a VLAN interface from an existing physical interface. This call is deprecated: use VLAN.create instead
+     * @deprecated
+     *
+     * @param device physical interface on which to create the VLAN interface
+     * @param network network to which this interface should be connected
+     * @param host physical machine to which this PIF is connected
+     * @param VLAN VLAN tag for the new interface
+     * @return The reference of the created PIF object
+     */
+   @Deprecated public static PIF createVLAN(Connection c, String device, Network network, Host host, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "PIF.create_VLAN";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use VLAN.destroy or Bond.destroy instead
+     * @deprecated
+     *
+     * @return Task
+     */
+   @Deprecated public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.PifIsPhysical {
+        String method_call = "Async.PIF.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use VLAN.destroy or Bond.destroy instead
+     * @deprecated
+     *
+     */
+   @Deprecated public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.PifIsPhysical {
+        String method_call = "PIF.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Reconfigure the IP address settings for this interface
+     *
+     * @param mode whether to use dynamic/static/no-assignment
+     * @param IP the new IP address
+     * @param netmask the new netmask
+     * @param gateway the new gateway
+     * @param DNS the new DNS settings
+     * @return Task
+     */
+    public Task reconfigureIpAsync(Connection c, Types.IpConfigurationMode mode, String IP, String netmask, String gateway, String DNS) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.reconfigure_ip";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(IP), Marshalling.toXMLRPC(netmask), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Reconfigure the IP address settings for this interface
+     *
+     * @param mode whether to use dynamic/static/no-assignment
+     * @param IP the new IP address
+     * @param netmask the new netmask
+     * @param gateway the new gateway
+     * @param DNS the new DNS settings
+     */
+    public void reconfigureIp(Connection c, Types.IpConfigurationMode mode, String IP, String netmask, String gateway, String DNS) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.reconfigure_ip";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(IP), Marshalling.toXMLRPC(netmask), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Reconfigure the IPv6 address settings for this interface
+     *
+     * @param mode whether to use dynamic/static/no-assignment
+     * @param IPv6 the new IPv6 address (in <addr>/<prefix length> format)
+     * @param gateway the new gateway
+     * @param DNS the new DNS settings
+     * @return Task
+     */
+    public Task reconfigureIpv6Async(Connection c, Types.Ipv6ConfigurationMode mode, String IPv6, String gateway, String DNS) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.reconfigure_ipv6";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(IPv6), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Reconfigure the IPv6 address settings for this interface
+     *
+     * @param mode whether to use dynamic/static/no-assignment
+     * @param IPv6 the new IPv6 address (in <addr>/<prefix length> format)
+     * @param gateway the new gateway
+     * @param DNS the new DNS settings
+     */
+    public void reconfigureIpv6(Connection c, Types.Ipv6ConfigurationMode mode, String IPv6, String gateway, String DNS) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.reconfigure_ipv6";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(IPv6), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Change the primary address type used by this PIF
+     *
+     * @param primaryAddressType Whether to prefer IPv4 or IPv6 connections
+     * @return Task
+     */
+    public Task setPrimaryAddressTypeAsync(Connection c, Types.PrimaryAddressType primaryAddressType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.set_primary_address_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(primaryAddressType)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Change the primary address type used by this PIF
+     *
+     * @param primaryAddressType Whether to prefer IPv4 or IPv6 connections
+     */
+    public void setPrimaryAddressType(Connection c, Types.PrimaryAddressType primaryAddressType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.set_primary_address_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(primaryAddressType)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Scan for physical interfaces on a host and create PIF objects to represent them
+     *
+     * @param host The host on which to scan
+     * @return Task
+     */
+    public static Task scanAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.scan";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Scan for physical interfaces on a host and create PIF objects to represent them
+     *
+     * @param host The host on which to scan
+     */
+    public static void scan(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.scan";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a PIF object matching a particular network interface
+     *
+     * @param host The host on which the interface exists
+     * @param MAC The MAC address of the interface
+     * @param device The device name to use for the interface
+     * @param managed Indicates whether the interface is managed by xapi (defaults to "true")
+     * @return Task
+     */
+    public static Task introduceAsync(Connection c, Host host, String MAC, String device, Boolean managed) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(managed)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a PIF object matching a particular network interface
+     *
+     * @param host The host on which the interface exists
+     * @param MAC The MAC address of the interface
+     * @param device The device name to use for the interface
+     * @param managed Indicates whether the interface is managed by xapi (defaults to "true")
+     * @return The reference of the created PIF object
+     */
+    public static PIF introduce(Connection c, Host host, String MAC, String device, Boolean managed) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(managed)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Destroy the PIF object matching a particular network interface
+     *
+     * @return Task
+     */
+    public Task forgetAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.PifTunnelStillExists {
+        String method_call = "Async.PIF.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the PIF object matching a particular network interface
+     *
+     */
+    public void forget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.PifTunnelStillExists {
+        String method_call = "PIF.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Attempt to bring down a physical interface
+     *
+     * @return Task
+     */
+    public Task unplugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Attempt to bring down a physical interface
+     *
+     */
+    public void unplug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Attempt to bring up a physical interface
+     *
+     * @return Task
+     */
+    public Task plugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.TransportPifNotConfigured {
+        String method_call = "Async.PIF.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Attempt to bring up a physical interface
+     *
+     */
+    public void plug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.TransportPifNotConfigured {
+        String method_call = "PIF.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a new PIF record in the database only
+     *
+     * @param device 
+     * @param network 
+     * @param host 
+     * @param MAC 
+     * @param MTU 
+     * @param VLAN 
+     * @param physical 
+     * @param ipConfigurationMode 
+     * @param IP 
+     * @param netmask 
+     * @param gateway 
+     * @param DNS 
+     * @param bondSlaveOf 
+     * @param VLANMasterOf 
+     * @param management 
+     * @param otherConfig 
+     * @param disallowUnplug 
+     * @param ipv6ConfigurationMode 
+     * @param IPv6 
+     * @param ipv6Gateway 
+     * @param primaryAddressType 
+     * @param managed 
+     * @return Task
+     */
+    public static Task dbIntroduceAsync(Connection c, String device, Network network, Host host, String MAC, Long MTU, Long VLAN, Boolean physical, Types.IpConfigurationMode ipConfigurationMode, String IP, String netmask, String gateway, String DNS, Bond bondSlaveOf, VLAN VLANMasterOf, Boolean management, Map<String, String> otherConfig, Boolean disallowUnplug, Types.Ipv6ConfigurationMode ipv6ConfigurationMode, Set<String> IPv6, String ipv6Gateway, Types.PrimaryAddressType primaryAddressType, Boolean managed) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.db_introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(MTU), Marshalling.toXMLRPC(VLAN), Marshalling.toXMLRPC(physical), Marshalling.toXMLRPC(ipConfigurationMode), Marshalling.toXMLRPC(IP), Marshalling.toXMLRPC(netmask), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS), Marshalling.toXMLRPC(bondSlaveOf), Marshalling.toXMLRPC(VLANMasterOf), Marshalling.toXMLRPC(management), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(disallowUnplug), Marshalling.toXMLRPC(ipv6ConfigurationMode), Marshalling.toXMLRPC(IPv6), Marshalling.toXMLRPC(ipv6Gateway), Marshalling.toXMLRPC(primaryAddressType), Marshalling.toXMLRPC(managed)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new PIF record in the database only
+     *
+     * @param device 
+     * @param network 
+     * @param host 
+     * @param MAC 
+     * @param MTU 
+     * @param VLAN 
+     * @param physical 
+     * @param ipConfigurationMode 
+     * @param IP 
+     * @param netmask 
+     * @param gateway 
+     * @param DNS 
+     * @param bondSlaveOf 
+     * @param VLANMasterOf 
+     * @param management 
+     * @param otherConfig 
+     * @param disallowUnplug 
+     * @param ipv6ConfigurationMode 
+     * @param IPv6 
+     * @param ipv6Gateway 
+     * @param primaryAddressType 
+     * @param managed 
+     * @return The ref of the newly created PIF record.
+     */
+    public static PIF dbIntroduce(Connection c, String device, Network network, Host host, String MAC, Long MTU, Long VLAN, Boolean physical, Types.IpConfigurationMode ipConfigurationMode, String IP, String netmask, String gateway, String DNS, Bond bondSlaveOf, VLAN VLANMasterOf, Boolean management, Map<String, String> otherConfig, Boolean disallowUnplug, Types.Ipv6ConfigurationMode ipv6ConfigurationMode, Set<String> IPv6, String ipv6Gateway, Types.PrimaryAddressType primaryAddressType, Boolean managed) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.db_introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(MTU), Marshalling.toXMLRPC(VLAN), Marshalling.toXMLRPC(physical), Marshalling.toXMLRPC(ipConfigurationMode), Marshalling.toXMLRPC(IP), Marshalling.toXMLRPC(netmask), Marshalling.toXMLRPC(gateway), Marshalling.toXMLRPC(DNS), Marshalling.toXMLRPC(bondSlaveOf), Marshalling.toXMLRPC(VLANMasterOf), Marshalling.toXMLRPC(management), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(disallowUnplug), Marshalling.toXMLRPC(ipv6ConfigurationMode), Marshalling.toXMLRPC(IPv6), Marshalling.toXMLRPC(ipv6Gateway), Marshalling.toXMLRPC(primaryAddressType), Marshalling.toXMLRPC(managed)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Destroy a PIF database record.
+     *
+     * @return Task
+     */
+    public Task dbForgetAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PIF.db_forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy a PIF database record.
+     *
+     */
+    public void dbForget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.db_forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the PIFs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PIF> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Return a map of PIF references to PIF records for all PIFs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PIF, PIF.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPIFPIFRecord(result);
+    }
+
+}
\ No newline at end of file


[06/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VDI.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VDI.java b/deps/XenServerJava/src/com/xensource/xenapi/VDI.java
new file mode 100644
index 0000000..1431ce0
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VDI.java
@@ -0,0 +1,1997 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual disk image
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VDI extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VDI(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VDI, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VDI)
+        {
+            VDI other = (VDI) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VDI
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "SR", this.SR);
+            print.printf("%1$20s: %2$s\n", "VBDs", this.VBDs);
+            print.printf("%1$20s: %2$s\n", "crashDumps", this.crashDumps);
+            print.printf("%1$20s: %2$s\n", "virtualSize", this.virtualSize);
+            print.printf("%1$20s: %2$s\n", "physicalUtilisation", this.physicalUtilisation);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "sharable", this.sharable);
+            print.printf("%1$20s: %2$s\n", "readOnly", this.readOnly);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "storageLock", this.storageLock);
+            print.printf("%1$20s: %2$s\n", "location", this.location);
+            print.printf("%1$20s: %2$s\n", "managed", this.managed);
+            print.printf("%1$20s: %2$s\n", "missing", this.missing);
+            print.printf("%1$20s: %2$s\n", "parent", this.parent);
+            print.printf("%1$20s: %2$s\n", "xenstoreData", this.xenstoreData);
+            print.printf("%1$20s: %2$s\n", "smConfig", this.smConfig);
+            print.printf("%1$20s: %2$s\n", "isASnapshot", this.isASnapshot);
+            print.printf("%1$20s: %2$s\n", "snapshotOf", this.snapshotOf);
+            print.printf("%1$20s: %2$s\n", "snapshots", this.snapshots);
+            print.printf("%1$20s: %2$s\n", "snapshotTime", this.snapshotTime);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "allowCaching", this.allowCaching);
+            print.printf("%1$20s: %2$s\n", "onBoot", this.onBoot);
+            print.printf("%1$20s: %2$s\n", "metadataOfPool", this.metadataOfPool);
+            print.printf("%1$20s: %2$s\n", "metadataLatest", this.metadataLatest);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VDI.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.VdiOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.VdiOperations>() : this.currentOperations);
+            map.put("SR", this.SR == null ? new SR("OpaqueRef:NULL") : this.SR);
+            map.put("VBDs", this.VBDs == null ? new LinkedHashSet<VBD>() : this.VBDs);
+            map.put("crash_dumps", this.crashDumps == null ? new LinkedHashSet<Crashdump>() : this.crashDumps);
+            map.put("virtual_size", this.virtualSize == null ? 0 : this.virtualSize);
+            map.put("physical_utilisation", this.physicalUtilisation == null ? 0 : this.physicalUtilisation);
+            map.put("type", this.type == null ? Types.VdiType.UNRECOGNIZED : this.type);
+            map.put("sharable", this.sharable == null ? false : this.sharable);
+            map.put("read_only", this.readOnly == null ? false : this.readOnly);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("storage_lock", this.storageLock == null ? false : this.storageLock);
+            map.put("location", this.location == null ? "" : this.location);
+            map.put("managed", this.managed == null ? false : this.managed);
+            map.put("missing", this.missing == null ? false : this.missing);
+            map.put("parent", this.parent == null ? new VDI("OpaqueRef:NULL") : this.parent);
+            map.put("xenstore_data", this.xenstoreData == null ? new HashMap<String, String>() : this.xenstoreData);
+            map.put("sm_config", this.smConfig == null ? new HashMap<String, String>() : this.smConfig);
+            map.put("is_a_snapshot", this.isASnapshot == null ? false : this.isASnapshot);
+            map.put("snapshot_of", this.snapshotOf == null ? new VDI("OpaqueRef:NULL") : this.snapshotOf);
+            map.put("snapshots", this.snapshots == null ? new LinkedHashSet<VDI>() : this.snapshots);
+            map.put("snapshot_time", this.snapshotTime == null ? new Date(0) : this.snapshotTime);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("allow_caching", this.allowCaching == null ? false : this.allowCaching);
+            map.put("on_boot", this.onBoot == null ? Types.OnBoot.UNRECOGNIZED : this.onBoot);
+            map.put("metadata_of_pool", this.metadataOfPool == null ? new Pool("OpaqueRef:NULL") : this.metadataOfPool);
+            map.put("metadata_latest", this.metadataLatest == null ? false : this.metadataLatest);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.VdiOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.VdiOperations> currentOperations;
+        /**
+         * storage repository in which the VDI resides
+         */
+        public SR SR;
+        /**
+         * list of vbds that refer to this disk
+         */
+        public Set<VBD> VBDs;
+        /**
+         * list of crash dumps that refer to this disk
+         */
+        public Set<Crashdump> crashDumps;
+        /**
+         * size of disk as presented to the guest (in bytes). Note that, depending on storage backend type, requested size may not be respected exactly
+         */
+        public Long virtualSize;
+        /**
+         * amount of physical space that the disk image is currently taking up on the storage repository (in bytes)
+         */
+        public Long physicalUtilisation;
+        /**
+         * type of the VDI
+         */
+        public Types.VdiType type;
+        /**
+         * true if this disk may be shared
+         */
+        public Boolean sharable;
+        /**
+         * true if this disk may ONLY be mounted read-only
+         */
+        public Boolean readOnly;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * true if this disk is locked at the storage level
+         */
+        public Boolean storageLock;
+        /**
+         * location information
+         */
+        public String location;
+        /**
+         * 
+         */
+        public Boolean managed;
+        /**
+         * true if SR scan operation reported this VDI as not present on disk
+         */
+        public Boolean missing;
+        /**
+         * References the parent disk, if this VDI is part of a chain
+         */
+        public VDI parent;
+        /**
+         * data to be inserted into the xenstore tree (/local/domain/0/backend/vbd/<domid>/<device-id>/sm-data) after the VDI is attached. This is generally set by the SM backends on vdi_attach.
+         */
+        public Map<String, String> xenstoreData;
+        /**
+         * SM dependent data
+         */
+        public Map<String, String> smConfig;
+        /**
+         * true if this is a snapshot.
+         */
+        public Boolean isASnapshot;
+        /**
+         * Ref pointing to the VDI this snapshot is of.
+         */
+        public VDI snapshotOf;
+        /**
+         * List pointing to all the VDIs snapshots.
+         */
+        public Set<VDI> snapshots;
+        /**
+         * Date/time when this snapshot was created.
+         */
+        public Date snapshotTime;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * true if this VDI is to be cached in the local cache SR
+         */
+        public Boolean allowCaching;
+        /**
+         * The behaviour of this VDI on a VM boot
+         */
+        public Types.OnBoot onBoot;
+        /**
+         * The pool whose metadata is contained in this VDI
+         */
+        public Pool metadataOfPool;
+        /**
+         * Whether this VDI contains the latest known accessible metadata for the pool
+         */
+        public Boolean metadataLatest;
+    }
+
+    /**
+     * Get a record containing the current state of the given VDI.
+     *
+     * @return all fields from the object
+     */
+    public VDI.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDIRecord(result);
+    }
+
+    /**
+     * Get a reference to the VDI instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VDI getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Create a new VDI instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VDI.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VDI instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VDI create(Connection c, VDI.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Destroy the specified VDI instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VDI instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get all the VDI instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<VDI> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVDI(result);
+    }
+
+    /**
+     * Get the uuid field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Set<Types.VdiOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVdiOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.VdiOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringVdiOperations(result);
+    }
+
+    /**
+     * Get the SR field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public SR getSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the VBDs field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Set<VBD> getVBDs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_VBDs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVBD(result);
+    }
+
+    /**
+     * Get the crash_dumps field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Set<Crashdump> getCrashDumps(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_crash_dumps";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfCrashdump(result);
+    }
+
+    /**
+     * Get the virtual_size field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Long getVirtualSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_virtual_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the physical_utilisation field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Long getPhysicalUtilisation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_physical_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the type field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Types.VdiType getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVdiType(result);
+    }
+
+    /**
+     * Get the sharable field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getSharable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_sharable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the read_only field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getReadOnly(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_read_only";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the storage_lock field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getStorageLock(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_storage_lock";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the location field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public String getLocation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_location";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the managed field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getManaged(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_managed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the missing field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getMissing(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_missing";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the parent field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public VDI getParent(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_parent";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the xenstore_data field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getXenstoreData(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_xenstore_data";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the sm_config field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getSmConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the is_a_snapshot field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsASnapshot(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_is_a_snapshot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the snapshot_of field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public VDI getSnapshotOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_snapshot_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the snapshots field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Set<VDI> getSnapshots(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_snapshots";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVDI(result);
+    }
+
+    /**
+     * Get the snapshot_time field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Date getSnapshotTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_snapshot_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the tags field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the allow_caching field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getAllowCaching(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_allow_caching";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the on_boot field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Types.OnBoot getOnBoot(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_on_boot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toOnBoot(result);
+    }
+
+    /**
+     * Get the metadata_of_pool field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Pool getMetadataOfPool(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_metadata_of_pool";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPool(result);
+    }
+
+    /**
+     * Get the metadata_latest field of the given VDI.
+     *
+     * @return value of the field
+     */
+    public Boolean getMetadataLatest(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_metadata_latest";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Set the other_config field of the given VDI.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VDI.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VDI.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the xenstore_data field of the given VDI.
+     *
+     * @param xenstoreData New value to set
+     */
+    public void setXenstoreData(Connection c, Map<String, String> xenstoreData) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_xenstore_data";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(xenstoreData)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the xenstore_data field of the given VDI.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToXenstoreData(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.add_to_xenstore_data";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the xenstore_data field of the given VDI.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromXenstoreData(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.remove_from_xenstore_data";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the sm_config field of the given VDI.
+     *
+     * @param smConfig New value to set
+     */
+    public void setSmConfig(Connection c, Map<String, String> smConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(smConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the sm_config field of the given VDI.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToSmConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.add_to_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the sm_config field of the given VDI.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromSmConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.remove_from_sm_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the tags field of the given VDI.
+     *
+     * @param tags New value to set
+     */
+    public void setTags(Connection c, Set<String> tags) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given value to the tags field of the given VDI.  If the value is already in that Set, then do nothing.
+     *
+     * @param value New value to add
+     */
+    public void addTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.add_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given value from the tags field of the given VDI.  If the value is not in that Set, then do nothing.
+     *
+     * @param value Value to remove
+     */
+    public void removeTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.remove_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Take a read-only snapshot of the VDI, returning a reference to the snapshot. If any driver_params are specified then these are passed through to the storage-specific substrate driver that takes the snapshot. NB the snapshot lives in the same Storage Repository as its parent.
+     *
+     * @param driverParams Optional parameters that can be passed through to backend driver in order to specify storage-type-specific snapshot options
+     * @return Task
+     */
+    public Task snapshotAsync(Connection c, Map<String, String> driverParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.snapshot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(driverParams)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Take a read-only snapshot of the VDI, returning a reference to the snapshot. If any driver_params are specified then these are passed through to the storage-specific substrate driver that takes the snapshot. NB the snapshot lives in the same Storage Repository as its parent.
+     *
+     * @param driverParams Optional parameters that can be passed through to backend driver in order to specify storage-type-specific snapshot options
+     * @return The ID of the newly created VDI.
+     */
+    public VDI snapshot(Connection c, Map<String, String> driverParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.snapshot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(driverParams)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Take an exact copy of the VDI and return a reference to the new disk. If any driver_params are specified then these are passed through to the storage-specific substrate driver that implements the clone operation. NB the clone lives in the same Storage Repository as its parent.
+     *
+     * @param driverParams Optional parameters that are passed through to the backend driver in order to specify storage-type-specific clone options
+     * @return Task
+     */
+    public Task createCloneAsync(Connection c, Map<String, String> driverParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.clone";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(driverParams)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Take an exact copy of the VDI and return a reference to the new disk. If any driver_params are specified then these are passed through to the storage-specific substrate driver that implements the clone operation. NB the clone lives in the same Storage Repository as its parent.
+     *
+     * @param driverParams Optional parameters that are passed through to the backend driver in order to specify storage-type-specific clone options
+     * @return The ID of the newly created VDI.
+     */
+    public VDI createClone(Connection c, Map<String, String> driverParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.clone";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(driverParams)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Resize the VDI.
+     *
+     * @param size The new size of the VDI
+     * @return Task
+     */
+    public Task resizeAsync(Connection c, Long size) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.resize";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(size)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Resize the VDI.
+     *
+     * @param size The new size of the VDI
+     */
+    public void resize(Connection c, Long size) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.resize";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(size)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Resize the VDI which may or may not be attached to running guests.
+     *
+     * @param size The new size of the VDI
+     * @return Task
+     */
+    public Task resizeOnlineAsync(Connection c, Long size) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.resize_online";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(size)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Resize the VDI which may or may not be attached to running guests.
+     *
+     * @param size The new size of the VDI
+     */
+    public void resizeOnline(Connection c, Long size) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.resize_online";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(size)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a new VDI record in the database only
+     *
+     * @param uuid The uuid of the disk to introduce
+     * @param nameLabel The name of the disk record
+     * @param nameDescription The description of the disk record
+     * @param SR The SR that the VDI is in
+     * @param type The type of the VDI
+     * @param sharable true if this disk may be shared
+     * @param readOnly true if this disk may ONLY be mounted read-only
+     * @param otherConfig additional configuration
+     * @param location location information
+     * @param xenstoreData Data to insert into xenstore
+     * @param smConfig Storage-specific config
+     * @param managed Storage-specific config
+     * @param virtualSize Storage-specific config
+     * @param physicalUtilisation Storage-specific config
+     * @param metadataOfPool Storage-specific config
+     * @param isASnapshot Storage-specific config
+     * @param snapshotTime Storage-specific config
+     * @param snapshotOf Storage-specific config
+     * @return Task
+     */
+    public static Task introduceAsync(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String, String> otherConfig, String location, Map<String, String> xenstoreData, Map<String, String> smConfig, Boolean managed, Long virtualSize, Long physicalUtilisation, Pool metadataOfPool, Boolean isASnapshot, Date snapshotTime, VDI snapshotOf) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrOperationNotSupported {
+        String method_call = "Async.VDI.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(SR), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(sharable), Marshalling.toXMLRPC(readOnly), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(location), Marshalling.toXMLRPC(xenstoreData), Marshalling.toXMLRPC(smConfig), Marshalling.toXMLRPC(managed), Marshalling.toXMLRPC(virtualSize), Marshalling.toXMLRPC(physicalUtilisation), Marshalling.toXMLRPC(metadataOfPool), Marshalling.toXMLRPC(isASnapshot), Marshalling.toXMLRPC(snapshotTime), Marshalling.toXMLRPC(snapshotOf)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VDI record in the database only
+     *
+     * @param uuid The uuid of the disk to introduce
+     * @param nameLabel The name of the disk record
+     * @param nameDescription The description of the disk record
+     * @param SR The SR that the VDI is in
+     * @param type The type of the VDI
+     * @param sharable true if this disk may be shared
+     * @param readOnly true if this disk may ONLY be mounted read-only
+     * @param otherConfig additional configuration
+     * @param location location information
+     * @param xenstoreData Data to insert into xenstore
+     * @param smConfig Storage-specific config
+     * @param managed Storage-specific config
+     * @param virtualSize Storage-specific config
+     * @param physicalUtilisation Storage-specific config
+     * @param metadataOfPool Storage-specific config
+     * @param isASnapshot Storage-specific config
+     * @param snapshotTime Storage-specific config
+     * @param snapshotOf Storage-specific config
+     * @return The ref of the newly created VDI record.
+     */
+    public static VDI introduce(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String, String> otherConfig, String location, Map<String, String> xenstoreData, Map<String, String> smConfig, Boolean managed, Long virtualSize, Long physicalUtilisation, Pool metadataOfPool, Boolean isASnapshot, Date snapshotTime, VDI snapshotOf) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrOperationNotSupported {
+        String method_call = "VDI.introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(SR), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(sharable), Marshalling.toXMLRPC(readOnly), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(location), Marshalling.toXMLRPC(xenstoreData), Marshalling.toXMLRPC(smConfig), Marshalling.toXMLRPC(managed), Marshalling.toXMLRPC(virtualSize), Marshalling.toXMLRPC(physicalUtilisation), Marshalling.toXMLRPC(metadataOfPool), Marshalling.toXMLRPC(isASnapshot), Marshalling.toXMLRPC(snapshotTime), Marshalling.toXMLRPC(snapshotOf)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Create a new VDI record in the database only
+     *
+     * @param uuid The uuid of the disk to introduce
+     * @param nameLabel The name of the disk record
+     * @param nameDescription The description of the disk record
+     * @param SR The SR that the VDI is in
+     * @param type The type of the VDI
+     * @param sharable true if this disk may be shared
+     * @param readOnly true if this disk may ONLY be mounted read-only
+     * @param otherConfig additional configuration
+     * @param location location information
+     * @param xenstoreData Data to insert into xenstore
+     * @param smConfig Storage-specific config
+     * @param managed Storage-specific config
+     * @param virtualSize Storage-specific config
+     * @param physicalUtilisation Storage-specific config
+     * @param metadataOfPool Storage-specific config
+     * @param isASnapshot Storage-specific config
+     * @param snapshotTime Storage-specific config
+     * @param snapshotOf Storage-specific config
+     * @return Task
+     */
+    public static Task dbIntroduceAsync(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String, String> otherConfig, String location, Map<String, String> xenstoreData, Map<String, String> smConfig, Boolean managed, Long virtualSize, Long physicalUtilisation, Pool metadataOfPool, Boolean isASnapshot, Date snapshotTime, VDI snapshotOf) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.db_introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(SR), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(sharable), Marshalling.toXMLRPC(readOnly), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(location), Marshalling.toXMLRPC(xenstoreData), Marshalling.toXMLRPC(smConfig), Marshalling.toXMLRPC(managed), Marshalling.toXMLRPC(virtualSize), Marshalling.toXMLRPC(physicalUtilisation), Marshalling.toXMLRPC(metadataOfPool), Marshalling.toXMLRPC(isASnapshot), Marshalling.toXMLRPC(snapshotTime), Marshalling.toXMLRPC(snapshotOf)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VDI record in the database only
+     *
+     * @param uuid The uuid of the disk to introduce
+     * @param nameLabel The name of the disk record
+     * @param nameDescription The description of the disk record
+     * @param SR The SR that the VDI is in
+     * @param type The type of the VDI
+     * @param sharable true if this disk may be shared
+     * @param readOnly true if this disk may ONLY be mounted read-only
+     * @param otherConfig additional configuration
+     * @param location location information
+     * @param xenstoreData Data to insert into xenstore
+     * @param smConfig Storage-specific config
+     * @param managed Storage-specific config
+     * @param virtualSize Storage-specific config
+     * @param physicalUtilisation Storage-specific config
+     * @param metadataOfPool Storage-specific config
+     * @param isASnapshot Storage-specific config
+     * @param snapshotTime Storage-specific config
+     * @param snapshotOf Storage-specific config
+     * @return The ref of the newly created VDI record.
+     */
+    public static VDI dbIntroduce(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String, String> otherConfig, String location, Map<String, String> xenstoreData, Map<String, String> smConfig, Boolean managed, Long virtualSize, Long physicalUtilisation, Pool metadataOfPool, Boolean isASnapshot, Date snapshotTime, VDI snapshotOf) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.db_introduce";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(SR), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(sharable), Marshalling.toXMLRPC(readOnly), Marshalling.toXMLRPC(otherConfig), Marshalling.toXMLRPC(location), Marshalling.toXMLRPC(xenstoreData), Marshalling.toXMLRPC(smConfig), Marshalling.toXMLRPC(managed), Marshalling.toXMLRPC(virtualSize), Marshalling.toXMLRPC(physicalUtilisation), Marshalling.toXMLRPC(metadataOfPool), Marshalling.toXMLRPC(isASnapshot), Marshalling.toXMLRPC(snapshotTime), Marshalling.toXMLRPC(snapshotOf)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Removes a VDI record from the database
+     *
+     * @return Task
+     */
+    public Task dbForgetAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.db_forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes a VDI record from the database
+     *
+     */
+    public void dbForget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.db_forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Ask the storage backend to refresh the fields in the VDI object
+     *
+     * @return Task
+     */
+    public Task updateAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrOperationNotSupported {
+        String method_call = "Async.VDI.update";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Ask the storage backend to refresh the fields in the VDI object
+     *
+     */
+    public void update(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrOperationNotSupported {
+        String method_call = "VDI.update";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Copy either a full VDI or the block differences between two VDIs into either a fresh VDI or an existing VDI.
+     *
+     * @param sr The destination SR (only required if the destination VDI is not specified
+     * @param baseVdi The base VDI (only required if copying only changed blocks, by default all blocks will be copied)
+     * @param intoVdi The destination VDI to copy blocks into (if omitted then a destination SR must be provided and a fresh VDI will be created)
+     * @return Task
+     */
+    public Task copyAsync2(Connection c, SR sr, VDI baseVdi, VDI intoVdi) throws
+            BadServerResponse,
+            XenAPIException,
+            XmlRpcException,
+            Types.VdiReadonly {
+        String method_call = "Async.VDI.copy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr), Marshalling.toXMLRPC(baseVdi), Marshalling.toXMLRPC(intoVdi)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk
+     *
+     * @param sr The destination SR
+     * @return Task
+     */
+    public Task copyAsync(Connection c, SR sr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.copy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk
+     *
+     * @param sr The destination SR
+     * @return The reference of the newly created VDI.
+     */
+    public VDI copy(Connection c, SR sr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.copy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Sets the VDI's managed field
+     *
+     * @param value The new value of the VDI's managed field
+     */
+    public void setManaged(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_managed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Removes a VDI record from the database
+     *
+     * @return Task
+     */
+    public Task forgetAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Removes a VDI record from the database
+     *
+     */
+    public void forget(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.forget";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI's sharable field
+     *
+     * @param value The new value of the VDI's sharable field
+     */
+    public void setSharable(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_sharable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI's read_only field
+     *
+     * @param value The new value of the VDI's read_only field
+     */
+    public void setReadOnly(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_read_only";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI's missing field
+     *
+     * @param value The new value of the VDI's missing field
+     */
+    public void setMissing(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_missing";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI's virtual_size field
+     *
+     * @param value The new value of the VDI's virtual size
+     */
+    public void setVirtualSize(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_virtual_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI's physical_utilisation field
+     *
+     * @param value The new value of the VDI's physical utilisation
+     */
+    public void setPhysicalUtilisation(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_physical_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets whether this VDI is a snapshot
+     *
+     * @param value The new value indicating whether this VDI is a snapshot
+     */
+    public void setIsASnapshot(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_is_a_snapshot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the VDI of which this VDI is a snapshot
+     *
+     * @param value The VDI of which this VDI is a snapshot
+     */
+    public void setSnapshotOf(Connection c, VDI value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_snapshot_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the snapshot time of this VDI.
+     *
+     * @param value The snapshot time of this VDI.
+     */
+    public void setSnapshotTime(Connection c, Date value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_snapshot_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Records the pool whose metadata is contained by this VDI.
+     *
+     * @param value The pool whose metadata is contained by this VDI
+     */
+    public void setMetadataOfPool(Connection c, Pool value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_metadata_of_pool";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name label of the VDI. This can only happen when then its SR is currently attached.
+     *
+     * @param value The name lable for the VDI
+     * @return Task
+     */
+    public Task setNameLabelAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the name label of the VDI. This can only happen when then its SR is currently attached.
+     *
+     * @param value The name lable for the VDI
+     */
+    public void setNameLabel(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name description of the VDI. This can only happen when its SR is currently attached.
+     *
+     * @param value The name description for the VDI
+     * @return Task
+     */
+    public Task setNameDescriptionAsync(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the name description of the VDI. This can only happen when its SR is currently attached.
+     *
+     * @param value The name description for the VDI
+     */
+    public void setNameDescription(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the on_boot parameter. This value can only be changed when the VDI is not attached to a running VM.
+     *
+     * @param value The value to set
+     * @return Task
+     */
+    public Task setOnBootAsync(Connection c, Types.OnBoot value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.set_on_boot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the value of the on_boot parameter. This value can only be changed when the VDI is not attached to a running VM.
+     *
+     * @param value The value to set
+     */
+    public void setOnBoot(Connection c, Types.OnBoot value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_on_boot";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of the allow_caching parameter. This value can only be changed when the VDI is not attached to a running VM. The caching behaviour is only affected by this flag for VHD-based VDIs that have one parent and no child VHDs. Moreover, caching only takes place when the host running the VM containing this VDI has a nominated SR for local caching.
+     *
+     * @param value The value to set
+     * @return Task
+     */
+    public Task setAllowCachingAsync(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.set_allow_caching";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the value of the allow_caching parameter. This value can only be changed when the VDI is not attached to a running VM. The caching behaviour is only affected by this flag for VHD-based VDIs that have one parent and no child VHDs. Moreover, caching only takes place when the host running the VM containing this VDI has a nominated SR for local caching.
+     *
+     * @param value The value to set
+     */
+    public void setAllowCaching(Connection c, Boolean value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.set_allow_caching";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Load the metadata found on the supplied VDI and return a session reference which can be used in XenAPI calls to query its contents.
+     *
+     * @return Task
+     */
+    public Task openDatabaseAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.open_database";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Load the metadata found on the supplied VDI and return a session reference which can be used in XenAPI calls to query its contents.
+     *
+     * @return A session which can be used to query the database
+     */
+    public Session openDatabase(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.open_database";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSession(result);
+    }
+
+    /**
+     * Check the VDI cache for the pool UUID of the database on this VDI.
+     *
+     * @return Task
+     */
+    public Task readDatabasePoolUuidAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.read_database_pool_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Check the VDI cache for the pool UUID of the database on this VDI.
+     *
+     * @return The cached pool UUID of the database on the VDI.
+     */
+    public String readDatabasePoolUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.read_database_pool_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Migrate a VDI, which may be attached to a running guest, to a different SR. The destination SR must be visible to the guest.
+     *
+     * @param sr The destination SR
+     * @param options Other parameters
+     * @return Task
+     */
+    public Task poolMigrateAsync(Connection c, SR sr, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VDI.pool_migrate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Migrate a VDI, which may be attached to a running guest, to a different SR. The destination SR must be visible to the guest.
+     *
+     * @param sr The destination SR
+     * @param options Other parameters
+     * @return The new reference of the migrated VDI.
+     */
+    public VDI poolMigrate(Connection c, SR sr, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.pool_migrate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Return a list of all the VDIs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VDI> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVDI(result);
+    }
+
+    /**
+     * Return a map of VDI references to VDI records for all VDIs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VDI, VDI.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VDI.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVDIVDIRecord(result);
+    }
+
+}
\ No newline at end of file


[09/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Session.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Session.java b/deps/XenServerJava/src/com/xensource/xenapi/Session.java
new file mode 100644
index 0000000..a00ab7d
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Session.java
@@ -0,0 +1,675 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A session
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Session extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Session(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Session, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Session)
+        {
+            Session other = (Session) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Session
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "thisHost", this.thisHost);
+            print.printf("%1$20s: %2$s\n", "thisUser", this.thisUser);
+            print.printf("%1$20s: %2$s\n", "lastActive", this.lastActive);
+            print.printf("%1$20s: %2$s\n", "pool", this.pool);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "isLocalSuperuser", this.isLocalSuperuser);
+            print.printf("%1$20s: %2$s\n", "subject", this.subject);
+            print.printf("%1$20s: %2$s\n", "validationTime", this.validationTime);
+            print.printf("%1$20s: %2$s\n", "authUserSid", this.authUserSid);
+            print.printf("%1$20s: %2$s\n", "authUserName", this.authUserName);
+            print.printf("%1$20s: %2$s\n", "rbacPermissions", this.rbacPermissions);
+            print.printf("%1$20s: %2$s\n", "tasks", this.tasks);
+            print.printf("%1$20s: %2$s\n", "parent", this.parent);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a session.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("this_host", this.thisHost == null ? new Host("OpaqueRef:NULL") : this.thisHost);
+            map.put("this_user", this.thisUser == null ? new User("OpaqueRef:NULL") : this.thisUser);
+            map.put("last_active", this.lastActive == null ? new Date(0) : this.lastActive);
+            map.put("pool", this.pool == null ? false : this.pool);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("is_local_superuser", this.isLocalSuperuser == null ? false : this.isLocalSuperuser);
+            map.put("subject", this.subject == null ? new Subject("OpaqueRef:NULL") : this.subject);
+            map.put("validation_time", this.validationTime == null ? new Date(0) : this.validationTime);
+            map.put("auth_user_sid", this.authUserSid == null ? "" : this.authUserSid);
+            map.put("auth_user_name", this.authUserName == null ? "" : this.authUserName);
+            map.put("rbac_permissions", this.rbacPermissions == null ? new LinkedHashSet<String>() : this.rbacPermissions);
+            map.put("tasks", this.tasks == null ? new LinkedHashSet<Task>() : this.tasks);
+            map.put("parent", this.parent == null ? new Session("OpaqueRef:NULL") : this.parent);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Currently connected host
+         */
+        public Host thisHost;
+        /**
+         * Currently connected user
+         */
+        public User thisUser;
+        /**
+         * Timestamp for last time session was active
+         */
+        public Date lastActive;
+        /**
+         * True if this session relates to a intra-pool login, false otherwise
+         */
+        public Boolean pool;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * true iff this session was created using local superuser credentials
+         */
+        public Boolean isLocalSuperuser;
+        /**
+         * references the subject instance that created the session. If a session instance has is_local_superuser set, then the value of this field is undefined.
+         */
+        public Subject subject;
+        /**
+         * time when session was last validated
+         */
+        public Date validationTime;
+        /**
+         * the subject identifier of the user that was externally authenticated. If a session instance has is_local_superuser set, then the value of this field is undefined.
+         */
+        public String authUserSid;
+        /**
+         * the subject name of the user that was externally authenticated. If a session instance has is_local_superuser set, then the value of this field is undefined.
+         */
+        public String authUserName;
+        /**
+         * list with all RBAC permissions for this session
+         */
+        public Set<String> rbacPermissions;
+        /**
+         * list of tasks created using the current session
+         */
+        public Set<Task> tasks;
+        /**
+         * references the parent session that created this session
+         */
+        public Session parent;
+    }
+
+    /**
+     * Get a record containing the current state of the given session.
+     *
+     * @return all fields from the object
+     */
+    public Session.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSessionRecord(result);
+    }
+
+    /**
+     * Get a reference to the session instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Session getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSession(result);
+    }
+
+    /**
+     * Get the uuid field of the given session.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the this_host field of the given session.
+     *
+     * @return value of the field
+     */
+    public Host getThisHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_this_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the this_user field of the given session.
+     *
+     * @return value of the field
+     */
+    public User getThisUser(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_this_user";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toUser(result);
+    }
+
+    /**
+     * Get the last_active field of the given session.
+     *
+     * @return value of the field
+     */
+    public Date getLastActive(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_last_active";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the pool field of the given session.
+     *
+     * @return value of the field
+     */
+    public Boolean getPool(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_pool";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given session.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the is_local_superuser field of the given session.
+     *
+     * @return value of the field
+     */
+    public Boolean getIsLocalSuperuser(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_is_local_superuser";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the subject field of the given session.
+     *
+     * @return value of the field
+     */
+    public Subject getSubject(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_subject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSubject(result);
+    }
+
+    /**
+     * Get the validation_time field of the given session.
+     *
+     * @return value of the field
+     */
+    public Date getValidationTime(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_validation_time";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the auth_user_sid field of the given session.
+     *
+     * @return value of the field
+     */
+    public String getAuthUserSid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_auth_user_sid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the auth_user_name field of the given session.
+     *
+     * @return value of the field
+     */
+    public String getAuthUserName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_auth_user_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the rbac_permissions field of the given session.
+     *
+     * @return value of the field
+     */
+    public Set<String> getRbacPermissions(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_rbac_permissions";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the tasks field of the given session.
+     *
+     * @return value of the field
+     */
+    public Set<Task> getTasks(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_tasks";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTask(result);
+    }
+
+    /**
+     * Get the parent field of the given session.
+     *
+     * @return value of the field
+     */
+    public Session getParent(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_parent";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSession(result);
+    }
+
+    /**
+     * Set the other_config field of the given session.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given session.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given session.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Attempt to authenticate the user, returning a session reference if successful
+     *
+     * @param uname Username for login.
+     * @param pwd Password for login.
+     * @param version Client API version.
+     * @return reference of newly created session
+     */
+    public static Session loginWithPassword(Connection c, String uname, String pwd, String version) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SessionAuthenticationFailed {
+        String method_call = "session.login_with_password";
+        Object[] method_params = {Marshalling.toXMLRPC(uname), Marshalling.toXMLRPC(pwd), Marshalling.toXMLRPC(version)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSession(result);
+    }
+
+    /**
+     * Log out of a session
+     *
+     */
+    public static void logout(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.logout";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Change the account password; if your session is authenticated with root priviledges then the old_pwd is validated and the new_pwd is set regardless
+     *
+     * @param oldPwd Old password for account
+     * @param newPwd New password for account
+     */
+    public static void changePassword(Connection c, String oldPwd, String newPwd) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.change_password";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(oldPwd), Marshalling.toXMLRPC(newPwd)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Authenticate locally against a slave in emergency mode. Note the resulting sessions are only good for use on this host.
+     *
+     * @param uname Username for login.
+     * @param pwd Password for login.
+     * @return ID of newly created session
+     */
+    public static Session slaveLocalLoginWithPassword(Connection c, String uname, String pwd) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.slave_local_login_with_password";
+        Object[] method_params = {Marshalling.toXMLRPC(uname), Marshalling.toXMLRPC(pwd)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSession(result);
+    }
+
+    /**
+     * Log out of local session.
+     *
+     */
+    public static void localLogout(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.local_logout";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the user subject-identifiers of all existing sessions
+     *
+     * @return Task
+     */
+    public static Task getAllSubjectIdentifiersAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.session.get_all_subject_identifiers";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Return a list of all the user subject-identifiers of all existing sessions
+     *
+     * @return The list of user subject-identifiers of all existing sessions
+     */
+    public static Set<String> getAllSubjectIdentifiers(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.get_all_subject_identifiers";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
+     *
+     * @param subjectIdentifier User subject-identifier of the sessions to be destroyed
+     * @return Task
+     */
+    public static Task logoutSubjectIdentifierAsync(Connection c, String subjectIdentifier) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.session.logout_subject_identifier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
+     *
+     * @param subjectIdentifier User subject-identifier of the sessions to be destroyed
+     */
+    public static void logoutSubjectIdentifier(Connection c, String subjectIdentifier) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "session.logout_subject_identifier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Subject.java b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
new file mode 100644
index 0000000..9a8fbfb
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A user or group that can log in xapi
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Subject extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Subject(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Subject, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Subject)
+        {
+            Subject other = (Subject) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Subject
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "subjectIdentifier", this.subjectIdentifier);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "roles", this.roles);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a subject.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("subject_identifier", this.subjectIdentifier == null ? "" : this.subjectIdentifier);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("roles", this.roles == null ? new LinkedHashSet<Role>() : this.roles);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the subject identifier, unique in the external directory service
+         */
+        public String subjectIdentifier;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * the roles associated with this subject
+         */
+        public Set<Role> roles;
+    }
+
+    /**
+     * Get a record containing the current state of the given subject.
+     *
+     * @return all fields from the object
+     */
+    public Subject.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSubjectRecord(result);
+    }
+
+    /**
+     * Get a reference to the subject instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Subject getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSubject(result);
+    }
+
+    /**
+     * Create a new subject instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Subject.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.subject.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new subject instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static Subject create(Connection c, Subject.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSubject(result);
+    }
+
+    /**
+     * Destroy the specified subject instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.subject.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified subject instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given subject.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the subject_identifier field of the given subject.
+     *
+     * @return value of the field
+     */
+    public String getSubjectIdentifier(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_subject_identifier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the other_config field of the given subject.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the roles field of the given subject.
+     *
+     * @return value of the field
+     */
+    public Set<Role> getRoles(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_roles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfRole(result);
+    }
+
+    /**
+     * This call adds a new role to a subject
+     *
+     * @param role The unique role reference
+     */
+    public void addToRoles(Connection c, Role role) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.add_to_roles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(role)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call removes a role from a subject
+     *
+     * @param role The unique role reference in the subject's roles field
+     */
+    public void removeFromRoles(Connection c, Role role) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.remove_from_roles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(role)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call returns a list of permission names given a subject
+     *
+     * @return a list of permission names
+     */
+    public Set<String> getPermissionsNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_permissions_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Return a list of all the subjects known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Subject> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfSubject(result);
+    }
+
+    /**
+     * Return a map of subject references to subject records for all subjects known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Subject, Subject.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "subject.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfSubjectSubjectRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Task.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Task.java b/deps/XenServerJava/src/com/xensource/xenapi/Task.java
new file mode 100644
index 0000000..4a85dfe
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Task.java
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A long-running asynchronous task
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Task extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Task(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Task, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Task)
+        {
+            Task other = (Task) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Task
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "created", this.created);
+            print.printf("%1$20s: %2$s\n", "finished", this.finished);
+            print.printf("%1$20s: %2$s\n", "status", this.status);
+            print.printf("%1$20s: %2$s\n", "residentOn", this.residentOn);
+            print.printf("%1$20s: %2$s\n", "progress", this.progress);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "result", this.result);
+            print.printf("%1$20s: %2$s\n", "errorInfo", this.errorInfo);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "subtaskOf", this.subtaskOf);
+            print.printf("%1$20s: %2$s\n", "subtasks", this.subtasks);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a task.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.TaskAllowedOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.TaskAllowedOperations>() : this.currentOperations);
+            map.put("created", this.created == null ? new Date(0) : this.created);
+            map.put("finished", this.finished == null ? new Date(0) : this.finished);
+            map.put("status", this.status == null ? Types.TaskStatusType.UNRECOGNIZED : this.status);
+            map.put("resident_on", this.residentOn == null ? new Host("OpaqueRef:NULL") : this.residentOn);
+            map.put("progress", this.progress == null ? 0.0 : this.progress);
+            map.put("type", this.type == null ? "" : this.type);
+            map.put("result", this.result == null ? "" : this.result);
+            map.put("error_info", this.errorInfo == null ? new LinkedHashSet<String>() : this.errorInfo);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("subtask_of", this.subtaskOf == null ? new Task("OpaqueRef:NULL") : this.subtaskOf);
+            map.put("subtasks", this.subtasks == null ? new LinkedHashSet<Task>() : this.subtasks);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.TaskAllowedOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.TaskAllowedOperations> currentOperations;
+        /**
+         * Time task was created
+         */
+        public Date created;
+        /**
+         * Time task finished (i.e. succeeded or failed). If task-status is pending, then the value of this field has no meaning
+         */
+        public Date finished;
+        /**
+         * current status of the task
+         */
+        public Types.TaskStatusType status;
+        /**
+         * the host on which the task is running
+         */
+        public Host residentOn;
+        /**
+         * This field contains the estimated fraction of the task which is complete. This field should not be used to determine whether the task is complete - for this the status field of the task should be used.
+         */
+        public Double progress;
+        /**
+         * if the task has completed successfully, this field contains the type of the encoded result (i.e. name of the class whose reference is in the result field). Undefined otherwise.
+         */
+        public String type;
+        /**
+         * if the task has completed successfully, this field contains the result value (either Void or an object reference). Undefined otherwise.
+         */
+        public String result;
+        /**
+         * if the task has failed, this field contains the set of associated error strings. Undefined otherwise.
+         */
+        public Set<String> errorInfo;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * Ref pointing to the task this is a substask of.
+         */
+        public Task subtaskOf;
+        /**
+         * List pointing to all the substasks.
+         */
+        public Set<Task> subtasks;
+    }
+
+    /**
+     * Get a record containing the current state of the given task.
+     *
+     * @return all fields from the object
+     */
+    public Task.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTaskRecord(result);
+    }
+
+    /**
+     * Get a reference to the task instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Task getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTask(result);
+    }
+
+    /**
+     * Get all the task instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<Task> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTask(result);
+    }
+
+    /**
+     * Get the uuid field of the given task.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given task.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given task.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given task.
+     *
+     * @return value of the field
+     */
+    public Set<Types.TaskAllowedOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTaskAllowedOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given task.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.TaskAllowedOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringTaskAllowedOperations(result);
+    }
+
+    /**
+     * Get the created field of the given task.
+     *
+     * @return value of the field
+     */
+    public Date getCreated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_created";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the finished field of the given task.
+     *
+     * @return value of the field
+     */
+    public Date getFinished(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_finished";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the status field of the given task.
+     *
+     * @return value of the field
+     */
+    public Types.TaskStatusType getStatus(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_status";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTaskStatusType(result);
+    }
+
+    /**
+     * Get the resident_on field of the given task.
+     *
+     * @return value of the field
+     */
+    public Host getResidentOn(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_resident_on";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the progress field of the given task.
+     *
+     * @return value of the field
+     */
+    public Double getProgress(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_progress";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the type field of the given task.
+     *
+     * @return value of the field
+     */
+    public String getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the result field of the given task.
+     *
+     * @return value of the field
+     */
+    public String getResult(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_result";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the error_info field of the given task.
+     *
+     * @return value of the field
+     */
+    public Set<String> getErrorInfo(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_error_info";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the other_config field of the given task.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the subtask_of field of the given task.
+     *
+     * @return value of the field
+     */
+    public Task getSubtaskOf(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_subtask_of";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTask(result);
+    }
+
+    /**
+     * Get the subtasks field of the given task.
+     *
+     * @return value of the field
+     */
+    public Set<Task> getSubtasks(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_subtasks";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTask(result);
+    }
+
+    /**
+     * Set the other_config field of the given task.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given task.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 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.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a new task object which must be manually destroyed.
+     *
+     * @param label short label for the new task
+     * @param description longer description for the new task
+     * @return The reference of the created task object
+     */
+    public static Task create(Connection c, String label, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the task object
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 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.
+     *
+     * @return Task
+     */
+    public Task cancelAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationNotAllowed {
+        String method_call = "Async.task.cancel";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * 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.
+     *
+     */
+    public void cancel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OperationNotAllowed {
+        String method_call = "task.cancel";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the tasks known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Task> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTask(result);
+    }
+
+    /**
+     * Return a map of task references to task records for all tasks known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Task, Task.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "task.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfTaskTaskRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
new file mode 100644
index 0000000..e30bd0a
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
@@ -0,0 +1,474 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A tunnel for network traffic
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Tunnel extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Tunnel(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Tunnel, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Tunnel)
+        {
+            Tunnel other = (Tunnel) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Tunnel
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "accessPIF", this.accessPIF);
+            print.printf("%1$20s: %2$s\n", "transportPIF", this.transportPIF);
+            print.printf("%1$20s: %2$s\n", "status", this.status);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a tunnel.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("access_PIF", this.accessPIF == null ? new PIF("OpaqueRef:NULL") : this.accessPIF);
+            map.put("transport_PIF", this.transportPIF == null ? new PIF("OpaqueRef:NULL") : this.transportPIF);
+            map.put("status", this.status == null ? new HashMap<String, String>() : this.status);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * The interface through which the tunnel is accessed
+         */
+        public PIF accessPIF;
+        /**
+         * The interface used by the tunnel
+         */
+        public PIF transportPIF;
+        /**
+         * Status information about the tunnel
+         */
+        public Map<String, String> status;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given tunnel.
+     *
+     * @return all fields from the object
+     */
+    public Tunnel.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTunnelRecord(result);
+    }
+
+    /**
+     * Get a reference to the tunnel instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Tunnel getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTunnel(result);
+    }
+
+    /**
+     * Get the uuid field of the given tunnel.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the access_PIF field of the given tunnel.
+     *
+     * @return value of the field
+     */
+    public PIF getAccessPIF(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_access_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the transport_PIF field of the given tunnel.
+     *
+     * @return value of the field
+     */
+    public PIF getTransportPIF(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_transport_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the status field of the given tunnel.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getStatus(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_status";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the other_config field of the given tunnel.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the status field of the given tunnel.
+     *
+     * @param status New value to set
+     */
+    public void setStatus(Connection c, Map<String, String> status) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.set_status";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(status)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the status field of the given tunnel.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToStatus(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.add_to_status";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the status field of the given tunnel.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromStatus(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.remove_from_status";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given tunnel.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given tunnel.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given tunnel.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a tunnel
+     *
+     * @param transportPIF PIF which receives the tagged traffic
+     * @param network Network to receive the tunnelled traffic
+     * @return Task
+     */
+    public static Task createAsync(Connection c, PIF transportPIF, Network network) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OpenvswitchNotActive,
+       Types.TransportPifNotConfigured,
+       Types.IsTunnelAccessPif {
+        String method_call = "Async.tunnel.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(transportPIF), Marshalling.toXMLRPC(network)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a tunnel
+     *
+     * @param transportPIF PIF which receives the tagged traffic
+     * @param network Network to receive the tunnelled traffic
+     * @return The reference of the created tunnel object
+     */
+    public static Tunnel create(Connection c, PIF transportPIF, Network network) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.OpenvswitchNotActive,
+       Types.TransportPifNotConfigured,
+       Types.IsTunnelAccessPif {
+        String method_call = "tunnel.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(transportPIF), Marshalling.toXMLRPC(network)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toTunnel(result);
+    }
+
+    /**
+     * Destroy a tunnel
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.tunnel.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy a tunnel
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the tunnels known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Tunnel> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfTunnel(result);
+    }
+
+    /**
+     * Return a map of tunnel references to tunnel records for all tunnels known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Tunnel, Tunnel.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "tunnel.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfTunnelTunnelRecord(result);
+    }
+
+}
\ No newline at end of file


[13/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java
new file mode 100644
index 0000000..7d15393
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics associated with a physical network interface
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PIFMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PIFMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PIFMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PIFMetrics)
+        {
+            PIFMetrics other = (PIFMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PIFMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "ioReadKbs", this.ioReadKbs);
+            print.printf("%1$20s: %2$s\n", "ioWriteKbs", this.ioWriteKbs);
+            print.printf("%1$20s: %2$s\n", "carrier", this.carrier);
+            print.printf("%1$20s: %2$s\n", "vendorId", this.vendorId);
+            print.printf("%1$20s: %2$s\n", "vendorName", this.vendorName);
+            print.printf("%1$20s: %2$s\n", "deviceId", this.deviceId);
+            print.printf("%1$20s: %2$s\n", "deviceName", this.deviceName);
+            print.printf("%1$20s: %2$s\n", "speed", this.speed);
+            print.printf("%1$20s: %2$s\n", "duplex", this.duplex);
+            print.printf("%1$20s: %2$s\n", "pciBusPath", this.pciBusPath);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a PIF_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("io_read_kbs", this.ioReadKbs == null ? 0.0 : this.ioReadKbs);
+            map.put("io_write_kbs", this.ioWriteKbs == null ? 0.0 : this.ioWriteKbs);
+            map.put("carrier", this.carrier == null ? false : this.carrier);
+            map.put("vendor_id", this.vendorId == null ? "" : this.vendorId);
+            map.put("vendor_name", this.vendorName == null ? "" : this.vendorName);
+            map.put("device_id", this.deviceId == null ? "" : this.deviceId);
+            map.put("device_name", this.deviceName == null ? "" : this.deviceName);
+            map.put("speed", this.speed == null ? 0 : this.speed);
+            map.put("duplex", this.duplex == null ? false : this.duplex);
+            map.put("pci_bus_path", this.pciBusPath == null ? "" : this.pciBusPath);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Read bandwidth (KiB/s)
+         */
+        public Double ioReadKbs;
+        /**
+         * Write bandwidth (KiB/s)
+         */
+        public Double ioWriteKbs;
+        /**
+         * Report if the PIF got a carrier or not
+         */
+        public Boolean carrier;
+        /**
+         * Report vendor ID
+         */
+        public String vendorId;
+        /**
+         * Report vendor name
+         */
+        public String vendorName;
+        /**
+         * Report device ID
+         */
+        public String deviceId;
+        /**
+         * Report device name
+         */
+        public String deviceName;
+        /**
+         * Speed of the link (if available)
+         */
+        public Long speed;
+        /**
+         * Full duplex capability of the link (if available)
+         */
+        public Boolean duplex;
+        /**
+         * PCI bus path of the pif (if available)
+         */
+        public String pciBusPath;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given PIF_metrics.
+     *
+     * @return all fields from the object
+     */
+    public PIFMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIFMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the PIF_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PIFMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIFMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the io/read_kbs field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoReadKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_io_read_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the io/write_kbs field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoWriteKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_io_write_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the carrier field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Boolean getCarrier(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_carrier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the vendor_id field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getVendorId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_vendor_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the vendor_name field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getVendorName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_vendor_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the device_id field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getDeviceId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_device_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the device_name field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getDeviceName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_device_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the speed field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Long getSpeed(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_speed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the duplex field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Boolean getDuplex(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_duplex";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the pci_bus_path field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getPciBusPath(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_pci_bus_path";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the last_updated field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given PIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given PIF_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given PIF_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given PIF_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the PIF_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PIFMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIFMetrics(result);
+    }
+
+    /**
+     * Return a map of PIF_metrics references to PIF_metrics records for all PIF_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PIFMetrics, PIFMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PIF_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPIFMetricsPIFMetricsRecord(result);
+    }
+
+}
\ No newline at end of file


[15/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Network.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Network.java b/deps/XenServerJava/src/com/xensource/xenapi/Network.java
new file mode 100644
index 0000000..9f8c929
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Network.java
@@ -0,0 +1,791 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual network
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Network extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Network(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Network, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Network)
+        {
+            Network other = (Network) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Network
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "VIFs", this.VIFs);
+            print.printf("%1$20s: %2$s\n", "PIFs", this.PIFs);
+            print.printf("%1$20s: %2$s\n", "MTU", this.MTU);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "bridge", this.bridge);
+            print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "defaultLockingMode", this.defaultLockingMode);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a network.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.NetworkOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.NetworkOperations>() : this.currentOperations);
+            map.put("VIFs", this.VIFs == null ? new LinkedHashSet<VIF>() : this.VIFs);
+            map.put("PIFs", this.PIFs == null ? new LinkedHashSet<PIF>() : this.PIFs);
+            map.put("MTU", this.MTU == null ? 0 : this.MTU);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("bridge", this.bridge == null ? "" : this.bridge);
+            map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("default_locking_mode", this.defaultLockingMode == null ? Types.NetworkDefaultLockingMode.UNRECOGNIZED : this.defaultLockingMode);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.NetworkOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.NetworkOperations> currentOperations;
+        /**
+         * list of connected vifs
+         */
+        public Set<VIF> VIFs;
+        /**
+         * list of connected pifs
+         */
+        public Set<PIF> PIFs;
+        /**
+         * MTU in octets
+         */
+        public Long MTU;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * name of the bridge corresponding to this network on the local host
+         */
+        public String bridge;
+        /**
+         * Binary blobs associated with this network
+         */
+        public Map<String, Blob> blobs;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * The network will use this value to determine the behaviour of all VIFs where locking_mode = default
+         */
+        public Types.NetworkDefaultLockingMode defaultLockingMode;
+    }
+
+    /**
+     * Get a record containing the current state of the given network.
+     *
+     * @return all fields from the object
+     */
+    public Network.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetworkRecord(result);
+    }
+
+    /**
+     * Get a reference to the network instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Network getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetwork(result);
+    }
+
+    /**
+     * Create a new network instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Network.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.network.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new network instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static Network create(Connection c, Network.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetwork(result);
+    }
+
+    /**
+     * Destroy the specified network instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.network.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified network instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get all the network instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<Network> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfNetwork(result);
+    }
+
+    /**
+     * Get the uuid field of the given network.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given network.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given network.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given network.
+     *
+     * @return value of the field
+     */
+    public Set<Types.NetworkOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfNetworkOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given network.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.NetworkOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringNetworkOperations(result);
+    }
+
+    /**
+     * Get the VIFs field of the given network.
+     *
+     * @return value of the field
+     */
+    public Set<VIF> getVIFs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_VIFs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVIF(result);
+    }
+
+    /**
+     * Get the PIFs field of the given network.
+     *
+     * @return value of the field
+     */
+    public Set<PIF> getPIFs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_PIFs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Get the MTU field of the given network.
+     *
+     * @return value of the field
+     */
+    public Long getMTU(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_MTU";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the other_config field of the given network.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the bridge field of the given network.
+     *
+     * @return value of the field
+     */
+    public String getBridge(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_bridge";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the blobs field of the given network.
+     *
+     * @return value of the field
+     */
+    public Map<String, Blob> getBlobs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_blobs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringBlob(result);
+    }
+
+    /**
+     * Get the tags field of the given network.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the default_locking_mode field of the given network.
+     *
+     * @return value of the field
+     */
+    public Types.NetworkDefaultLockingMode getDefaultLockingMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_default_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toNetworkDefaultLockingMode(result);
+    }
+
+    /**
+     * Set the name/label field of the given network.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given network.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the MTU field of the given network.
+     *
+     * @param MTU New value to set
+     */
+    public void setMTU(Connection c, Long MTU) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_MTU";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(MTU)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given network.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given network.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given network.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the tags field of the given network.
+     *
+     * @param tags New value to set
+     */
+    public void setTags(Connection c, Set<String> tags) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given value to the tags field of the given network.  If the value is already in that Set, then do nothing.
+     *
+     * @param value New value to add
+     */
+    public void addTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.add_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given value from the tags field of the given network.  If the value is not in that Set, then do nothing.
+     *
+     * @param value Value to remove
+     */
+    public void removeTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.remove_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this pool
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return Task
+     */
+    public Task createNewBlobAsync(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.network.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this pool
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return The reference of the blob, needed for populating its data
+     */
+    public Blob createNewBlob(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlob(result);
+    }
+
+    /**
+     * Set the default locking mode for VIFs attached to this network
+     *
+     * @param value The default locking mode for VIFs attached to this network.
+     * @return Task
+     */
+    public Task setDefaultLockingModeAsync(Connection c, Types.NetworkDefaultLockingMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.network.set_default_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the default locking mode for VIFs attached to this network
+     *
+     * @param value The default locking mode for VIFs attached to this network.
+     */
+    public void setDefaultLockingMode(Connection c, Types.NetworkDefaultLockingMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.set_default_locking_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the networks known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Network> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfNetwork(result);
+    }
+
+    /**
+     * Return a map of network references to network records for all networks known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Network, Network.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "network.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfNetworkNetworkRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PBD.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PBD.java b/deps/XenServerJava/src/com/xensource/xenapi/PBD.java
new file mode 100644
index 0000000..bae095f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PBD.java
@@ -0,0 +1,542 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The physical block devices through which hosts access SRs
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PBD extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PBD(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PBD, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PBD)
+        {
+            PBD other = (PBD) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PBD
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "SR", this.SR);
+            print.printf("%1$20s: %2$s\n", "deviceConfig", this.deviceConfig);
+            print.printf("%1$20s: %2$s\n", "currentlyAttached", this.currentlyAttached);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a PBD.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("SR", this.SR == null ? new SR("OpaqueRef:NULL") : this.SR);
+            map.put("device_config", this.deviceConfig == null ? new HashMap<String, String>() : this.deviceConfig);
+            map.put("currently_attached", this.currentlyAttached == null ? false : this.currentlyAttached);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * physical machine on which the pbd is available
+         */
+        public Host host;
+        /**
+         * the storage repository that the pbd realises
+         */
+        public SR SR;
+        /**
+         * a config string to string map that is provided to the host's SR-backend-driver
+         */
+        public Map<String, String> deviceConfig;
+        /**
+         * is the SR currently attached on this host?
+         */
+        public Boolean currentlyAttached;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given PBD.
+     *
+     * @return all fields from the object
+     */
+    public PBD.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPBDRecord(result);
+    }
+
+    /**
+     * Get a reference to the PBD instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PBD getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPBD(result);
+    }
+
+    /**
+     * Create a new PBD instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, PBD.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PBD.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new PBD instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static PBD create(Connection c, PBD.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPBD(result);
+    }
+
+    /**
+     * Destroy the specified PBD instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PBD.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified PBD instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the SR field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public SR getSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the device_config field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getDeviceConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_device_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the currently_attached field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getCurrentlyAttached(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_currently_attached";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given PBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given PBD.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given PBD.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given PBD.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Activate the specified PBD, causing the referenced SR to be attached and scanned
+     *
+     * @return Task
+     */
+    public Task plugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrUnknownDriver {
+        String method_call = "Async.PBD.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Activate the specified PBD, causing the referenced SR to be attached and scanned
+     *
+     */
+    public void plug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.SrUnknownDriver {
+        String method_call = "PBD.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Deactivate the specified PBD, causing the referenced SR to be detached and nolonger scanned
+     *
+     * @return Task
+     */
+    public Task unplugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PBD.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Deactivate the specified PBD, causing the referenced SR to be detached and nolonger scanned
+     *
+     */
+    public void unplug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the PBD's device_config field
+     *
+     * @param value The new value of the PBD's device_config
+     * @return Task
+     */
+    public Task setDeviceConfigAsync(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.PBD.set_device_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Sets the PBD's device_config field
+     *
+     * @param value The new value of the PBD's device_config
+     */
+    public void setDeviceConfig(Connection c, Map<String, String> value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.set_device_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the PBDs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PBD> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPBD(result);
+    }
+
+    /**
+     * Return a map of PBD references to PBD records for all PBDs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PBD, PBD.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PBD.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPBDPBDRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/PCI.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PCI.java b/deps/XenServerJava/src/com/xensource/xenapi/PCI.java
new file mode 100644
index 0000000..fbee50a
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/PCI.java
@@ -0,0 +1,418 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A PCI device
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class PCI extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    PCI(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a PCI, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof PCI)
+        {
+            PCI other = (PCI) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a PCI
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "clazzName", this.clazzName);
+            print.printf("%1$20s: %2$s\n", "vendorName", this.vendorName);
+            print.printf("%1$20s: %2$s\n", "deviceName", this.deviceName);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "pciId", this.pciId);
+            print.printf("%1$20s: %2$s\n", "dependencies", this.dependencies);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a PCI.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("class_name", this.clazzName == null ? "" : this.clazzName);
+            map.put("vendor_name", this.vendorName == null ? "" : this.vendorName);
+            map.put("device_name", this.deviceName == null ? "" : this.deviceName);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("pci_id", this.pciId == null ? "" : this.pciId);
+            map.put("dependencies", this.dependencies == null ? new LinkedHashSet<PCI>() : this.dependencies);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * PCI class name
+         */
+        public String clazzName;
+        /**
+         * Vendor name
+         */
+        public String vendorName;
+        /**
+         * Device name
+         */
+        public String deviceName;
+        /**
+         * Physical machine that owns the PCI device
+         */
+        public Host host;
+        /**
+         * PCI ID of the physical device
+         */
+        public String pciId;
+        /**
+         * List of dependent PCI devices
+         */
+        public Set<PCI> dependencies;
+        /**
+         * Additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given PCI.
+     *
+     * @return all fields from the object
+     */
+    public PCI.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPCIRecord(result);
+    }
+
+    /**
+     * Get a reference to the PCI instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static PCI getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPCI(result);
+    }
+
+    /**
+     * Get the uuid field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the class_name field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public String getClazzName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_class_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the vendor_name field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public String getVendorName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_vendor_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the device_name field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public String getDeviceName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_device_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the pci_id field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public String getPciId(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_pci_id";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the dependencies field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public Set<PCI> getDependencies(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_dependencies";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPCI(result);
+    }
+
+    /**
+     * Get the other_config field of the given PCI.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given PCI.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given PCI.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given PCI.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the PCIs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<PCI> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPCI(result);
+    }
+
+    /**
+     * Return a map of PCI references to PCI records for all PCIs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<PCI, PCI.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "PCI.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfPCIPCIRecord(result);
+    }
+
+}
\ No newline at end of file


[19/19] git commit: updated refs/heads/4.4 to ec102ec

Posted by ah...@apache.org.
Revert "Applied Tina's patches for removing the xapi jar"

This reverts commit 1439c69b7e4396d0b8b26076585c6465e44624f3.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ec102ec9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ec102ec9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ec102ec9

Branch: refs/heads/4.4
Commit: ec102ec9607480bc363bbd5a2dbfd5c0ebc3f985
Parents: 3661e67
Author: Alex Huang <al...@citrix.com>
Authored: Tue Apr 8 00:03:18 2014 -0700
Committer: Alex Huang <al...@citrix.com>
Committed: Tue Apr 8 00:03:18 2014 -0700

----------------------------------------------------------------------
 .gitignore                                      |     1 -
 deps/XenServerJava/pom.xml                      |    60 +
 deps/XenServerJava/src/LICENSE.Apache-2.0.txt   |   201 +
 deps/XenServerJava/src/LICENSE.txt              |    26 +
 deps/XenServerJava/src/README.txt               |    57 +
 .../src/com/xensource/xenapi/APIVersion.java    |   131 +
 .../src/com/xensource/xenapi/Auth.java          |   114 +
 .../src/com/xensource/xenapi/Blob.java          |   446 +
 .../src/com/xensource/xenapi/Bond.java          |   564 +
 .../src/com/xensource/xenapi/Connection.java    |   367 +
 .../src/com/xensource/xenapi/Console.java       |   419 +
 .../src/com/xensource/xenapi/Crashdump.java     |   358 +
 .../src/com/xensource/xenapi/DRTask.java        |   303 +
 .../src/com/xensource/xenapi/DataSource.java    |   164 +
 .../src/com/xensource/xenapi/Event.java         |   319 +
 .../src/com/xensource/xenapi/GPUGroup.java      |   638 +
 .../src/com/xensource/xenapi/Host.java          |  3024 ++++
 .../src/com/xensource/xenapi/HostCpu.java       |   536 +
 .../src/com/xensource/xenapi/HostCrashdump.java |   417 +
 .../src/com/xensource/xenapi/HostMetrics.java   |   373 +
 .../src/com/xensource/xenapi/HostPatch.java     |   552 +
 .../src/com/xensource/xenapi/Marshalling.java   |    77 +
 .../src/com/xensource/xenapi/Message.java       |   320 +
 .../src/com/xensource/xenapi/Network.java       |   791 +
 .../src/com/xensource/xenapi/PBD.java           |   542 +
 .../src/com/xensource/xenapi/PCI.java           |   418 +
 .../src/com/xensource/xenapi/PGPU.java          |   613 +
 .../src/com/xensource/xenapi/PIF.java           |  1401 ++
 .../src/com/xensource/xenapi/PIFMetrics.java    |   533 +
 .../src/com/xensource/xenapi/Pool.java          |  2392 +++
 .../src/com/xensource/xenapi/PoolPatch.java     |   693 +
 .../src/com/xensource/xenapi/Role.java          |   364 +
 .../src/com/xensource/xenapi/SM.java            |   552 +
 .../src/com/xensource/xenapi/SR.java            |  1449 ++
 .../src/com/xensource/xenapi/Secret.java        |   389 +
 .../src/com/xensource/xenapi/Session.java       |   675 +
 .../src/com/xensource/xenapi/Subject.java       |   396 +
 .../src/com/xensource/xenapi/Task.java          |   688 +
 .../src/com/xensource/xenapi/Tunnel.java        |   474 +
 .../src/com/xensource/xenapi/Types.java         | 13529 +++++++++++++++++
 .../src/com/xensource/xenapi/User.java          |   384 +
 .../src/com/xensource/xenapi/VBD.java           |  1161 ++
 .../src/com/xensource/xenapi/VBDMetrics.java    |   349 +
 .../src/com/xensource/xenapi/VDI.java           |  1997 +++
 .../src/com/xensource/xenapi/VGPU.java          |   494 +
 .../src/com/xensource/xenapi/VGPUType.java      |   461 +
 .../src/com/xensource/xenapi/VIF.java           |  1186 ++
 .../src/com/xensource/xenapi/VIFMetrics.java    |   349 +
 .../src/com/xensource/xenapi/VLAN.java          |   421 +
 .../src/com/xensource/xenapi/VM.java            |  4956 ++++++
 .../src/com/xensource/xenapi/VMAppliance.java   |   655 +
 .../com/xensource/xenapi/VMGuestMetrics.java    |   487 +
 .../src/com/xensource/xenapi/VMMetrics.java     |   510 +
 .../src/com/xensource/xenapi/VMPP.java          |  1158 ++
 .../src/com/xensource/xenapi/VTPM.java          |   290 +
 .../src/com/xensource/xenapi/XenAPIObject.java  |    36 +
 plugins/hypervisors/ovm/pom.xml                 |     4 +-
 plugins/hypervisors/xen/pom.xml                 |     4 +-
 .../xen/resource/XenServerConnectionPool.java   |    15 +-
 .../resource/Xenserver625StorageProcessor.java  |    16 +-
 .../xenserver/XenServerResourceNewBase.java     |    22 +-
 pom.xml                                         |    15 +-
 62 files changed, 50296 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index a0307a7..d6f5d1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,7 +64,6 @@ awsapi/modules/*
 .settings.xml
 .settings/
 db.properties.override
-replace.properties.override
 awsapi/overlays/
 tools/marvin/marvin/cloudstackAPI/*
 *.egg-info/

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/pom.xml
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/pom.xml b/deps/XenServerJava/pom.xml
new file mode 100644
index 0000000..c9a4e86
--- /dev/null
+++ b/deps/XenServerJava/pom.xml
@@ -0,0 +1,60 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack</artifactId>
+    <version>4.4.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <artifactId>xapi</artifactId>
+  <version>6.2.0-1-SNAPSHOT</version>
+  <name>Apache XenSource XAPI</name>
+  <description>XenSource XAPI Java Bindings</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.xmlrpc</groupId>
+      <artifactId>xmlrpc-client</artifactId>
+      <version>${cs.xmlrpc.version}</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <executions>
+          <execution>
+	    <id>cloudstack-checkstyle</id>
+            <phase>none</phase>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.cloudstack</groupId>
+            <artifactId>checkstyle</artifactId>
+            <!-- this project.version differs -->
+            <version>${project.parent.version}</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/LICENSE.Apache-2.0.txt
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/LICENSE.Apache-2.0.txt b/deps/XenServerJava/src/LICENSE.Apache-2.0.txt
new file mode 100755
index 0000000..261eeb9
--- /dev/null
+++ b/deps/XenServerJava/src/LICENSE.Apache-2.0.txt
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/LICENSE.txt
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/LICENSE.txt b/deps/XenServerJava/src/LICENSE.txt
new file mode 100755
index 0000000..76c4a22
--- /dev/null
+++ b/deps/XenServerJava/src/LICENSE.txt
@@ -0,0 +1,26 @@
+Copyright (c) Citrix Systems, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1) Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2) Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/README.txt
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/README.txt b/deps/XenServerJava/src/README.txt
new file mode 100755
index 0000000..2e6fa45
--- /dev/null
+++ b/deps/XenServerJava/src/README.txt
@@ -0,0 +1,57 @@
+XenServerJava
+=============
+
+NOTE: This is a modified version of Citrix XenServer's SDK. This version of 
+XenServerJava includes some customization which is required to make it work
+with CloudStack.
+
+
+Version 6.2.0-1.
+
+XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer
+API as Java classes.
+
+For XenServer documentation, see http://docs.xensource.com.
+XenServerJava includes a class for every XenServer class, and a method for
+each XenServer API call, so API documentation and examples written for
+for other languages will apply equally well to Java.
+In particular, the SDK Guide and API Documentation are ideal for developers
+wishing to use XenServerJava.
+
+For community content, blogs, and downloads, visit the XenServer Developer
+Network at http://community.citrix.com/cdn/xs.
+
+XenServerJava is free sofware.  You can redistribute and modify it under the
+terms of the BSD license.  See LICENSE.txt for details.
+
+This library may be accompanied by pedagogical examples. These do not form
+part of this library, and are licensed for redistribution and modification
+under the BSD license. Such examples are licensed clearly at the top
+of each file.
+
+
+Dependencies
+------------
+
+XenServerJava is dependent upon Apache XML-RPC and WS-Commons, both by The
+Apache Software Foundation.  We would like to thank the ASF and the
+Apache XML-RPC development team in particular.
+Both are licensed under the Apache Software License 2.0; see
+LICENSE.Apache-2.0.txt for details.
+
+We test with version 3.1 of Apache XML-RPC, and version 1.0.2 of WS-Commons.
+We recommend that you use these versions, though others may work.
+
+
+Downloads
+---------
+
+XenServerJava is available in the XenServer-6.2.0-SDK.zip in three separate
+folders, one for the compiled binaries, one for the source code,
+and one containing sample code.
+
+The XenServer-6.2.0-SDK.zip is available from
+http://www.citrix.com/downloads/xenserver/.
+
+Apache XML-RPC is available from http://ws.apache.org/xmlrpc/.
+WS-Commons is available from http://ws.apache.org/commons/.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java
new file mode 100755
index 0000000..9dcdd9f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+public enum APIVersion
+{
+    API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, API_1_8, API_1_9, API_1_10, API_2_0, API_2_1, UNKNOWN;
+
+    public static APIVersion latest()
+    {
+        return API_2_1;
+    }
+
+    public static APIVersion fromMajorMinor(long major, long minor)
+    {
+        if (major == 2 && minor == 1)
+        {
+            return API_2_1;
+        }
+        else if (major == 2 && minor == 0)
+        {
+            return API_2_0;
+        }        
+        else if (major == 1 && minor == 10)
+        {
+            return API_1_10;
+        }
+        else if (major == 1 && minor == 9)
+        {
+            return API_1_9;
+        }
+        else if (major == 1 && minor == 8)
+        {
+            return API_1_8;
+        }
+        else if (major == 1 && minor == 7)
+        {
+            return API_1_7;
+        }
+        else if (major == 1 && minor == 6)
+        {
+            return API_1_6;
+        }
+        else if (major == 1 && minor == 5)
+        {
+            return API_1_5;
+        }
+        else if (major == 1 && minor == 4)
+        {
+            return API_1_4;
+        }
+        else if (major == 1 && minor == 3)
+        {
+            return API_1_3;
+        }
+        else if (major == 1 && minor == 2)
+        {
+            return API_1_2;
+        }
+        else if (major == 1 && minor == 1)
+        {
+            return API_1_1;
+        }
+        else
+        {
+            return UNKNOWN;
+        }
+    }
+
+    @Override
+    public String toString()
+    {
+        switch (this)
+        {
+        case API_1_1:
+            return "1.1";
+        case API_1_2:
+            return "1.2";
+        case API_1_3:
+            return "1.3";
+        case API_1_4:
+            return "1.4";
+        case API_1_5:
+            return "1.5";
+        case API_1_6:
+            return "1.6";
+        case API_1_7:
+            return "1.7";
+        case API_1_8:
+            return "1.8";
+        case API_1_9:
+            return "1.9";
+        case API_1_10:
+            return "1.10";
+        case API_2_0:
+            return "2.0";
+        case API_2_1:
+            return "2.1";
+        default:
+            return "Unknown";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Auth.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Auth.java b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java
new file mode 100644
index 0000000..4778e6a
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Management of remote authentication services
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Auth extends XenAPIObject {
+
+
+    public String toWireString() {
+        return null;
+    }
+
+    /**
+     * This call queries the external directory service to obtain the subject_identifier as a string from the human-readable subject_name
+     *
+     * @param subjectName The human-readable subject_name, such as a username or a groupname
+     * @return the subject_identifier obtained from the external directory service
+     */
+    public static String getSubjectIdentifier(Connection c, String subjectName) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "auth.get_subject_identifier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectName)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * This call queries the external directory service to obtain the user information (e.g. username, organization etc) from the specified subject_identifier
+     *
+     * @param subjectIdentifier A string containing the subject_identifier, unique in the external directory service
+     * @return key-value pairs containing at least a key called subject_name
+     */
+    public static Map<String, String> getSubjectInformationFromIdentifier(Connection c, String subjectIdentifier) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "auth.get_subject_information_from_identifier";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * This calls queries the external directory service to obtain the transitively-closed set of groups that the the subject_identifier is member of.
+     *
+     * @param subjectIdentifier A string containing the subject_identifier, unique in the external directory service
+     * @return set of subject_identifiers that provides the group membership of subject_identifier passed as argument, it contains, recursively, all groups a subject_identifier is member of.
+     */
+    public static Set<String> getGroupMembership(Connection c, String subjectIdentifier) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "auth.get_group_membership";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Blob.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Blob.java b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java
new file mode 100644
index 0000000..ec91d87
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java
@@ -0,0 +1,446 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A placeholder for a binary blob
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Blob extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Blob(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Blob, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Blob)
+        {
+            Blob other = (Blob) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Blob
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "size", this.size);
+            print.printf("%1$20s: %2$s\n", "_public", this._public);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "mimeType", this.mimeType);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a blob.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("size", this.size == null ? 0 : this.size);
+            map.put("public", this._public == null ? false : this._public);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("mime_type", this.mimeType == null ? "" : this.mimeType);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * Size of the binary data, in bytes
+         */
+        public Long size;
+        /**
+         * True if the blob is publicly accessible
+         */
+        public Boolean _public;
+        /**
+         * Time at which the data in the blob was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * The mime type associated with this object. Defaults to 'application/octet-stream' if the empty string is supplied
+         */
+        public String mimeType;
+    }
+
+    /**
+     * Get a record containing the current state of the given blob.
+     *
+     * @return all fields from the object
+     */
+    public Blob.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlobRecord(result);
+    }
+
+    /**
+     * Get a reference to the blob instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Blob getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlob(result);
+    }
+
+    /**
+     * Get all the blob instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<Blob> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfBlob(result);
+    }
+
+    /**
+     * Get the uuid field of the given blob.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given blob.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given blob.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the size field of the given blob.
+     *
+     * @return value of the field
+     */
+    public Long getSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the public field of the given blob.
+     *
+     * @return value of the field
+     */
+    public Boolean getPublic(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_public";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the last_updated field of the given blob.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the mime_type field of the given blob.
+     *
+     * @return value of the field
+     */
+    public String getMimeType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_mime_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Set the name/label field of the given blob.
+     *
+     * @param label New value to set
+     */
+    public void setNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name/description field of the given blob.
+     *
+     * @param description New value to set
+     */
+    public void setNameDescription(Connection c, String description) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the public field of the given blob.
+     *
+     * @param _public New value to set
+     */
+    public void setPublic(Connection c, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.set_public";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a placeholder for a binary blob
+     *
+     * @param mimeType The mime-type of the blob. Defaults to 'application/octet-stream' if the empty string is supplied
+     * @param _public True if the blob should be publicly available
+     * @return The reference to the created blob
+     */
+    public static Blob create(Connection c, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlob(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the blobs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Blob> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfBlob(result);
+    }
+
+    /**
+     * Return a map of blob references to blob records for all blobs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Blob, Blob.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "blob.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfBlobBlobRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Bond.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Bond.java b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java
new file mode 100644
index 0000000..5a54ad2
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * 
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Bond extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Bond(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Bond, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Bond)
+        {
+            Bond other = (Bond) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Bond
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "master", this.master);
+            print.printf("%1$20s: %2$s\n", "slaves", this.slaves);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "primarySlave", this.primarySlave);
+            print.printf("%1$20s: %2$s\n", "mode", this.mode);
+            print.printf("%1$20s: %2$s\n", "properties", this.properties);
+            print.printf("%1$20s: %2$s\n", "linksUp", this.linksUp);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a Bond.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("master", this.master == null ? new PIF("OpaqueRef:NULL") : this.master);
+            map.put("slaves", this.slaves == null ? new LinkedHashSet<PIF>() : this.slaves);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("primary_slave", this.primarySlave == null ? new PIF("OpaqueRef:NULL") : this.primarySlave);
+            map.put("mode", this.mode == null ? Types.BondMode.UNRECOGNIZED : this.mode);
+            map.put("properties", this.properties == null ? new HashMap<String, String>() : this.properties);
+            map.put("links_up", this.linksUp == null ? 0 : this.linksUp);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * The bonded interface
+         */
+        public PIF master;
+        /**
+         * The interfaces which are part of this bond
+         */
+        public Set<PIF> slaves;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * The PIF of which the IP configuration and MAC were copied to the bond, and which will receive all configuration/VLANs/VIFs on the bond if the bond is destroyed
+         */
+        public PIF primarySlave;
+        /**
+         * The algorithm used to distribute traffic among the bonded NICs
+         */
+        public Types.BondMode mode;
+        /**
+         * Additional configuration properties specific to the bond mode.
+         */
+        public Map<String, String> properties;
+        /**
+         * Number of links up in this bond
+         */
+        public Long linksUp;
+    }
+
+    /**
+     * Get a record containing the current state of the given Bond.
+     *
+     * @return all fields from the object
+     */
+    public Bond.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBondRecord(result);
+    }
+
+    /**
+     * Get a reference to the Bond instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Bond getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBond(result);
+    }
+
+    /**
+     * Get the uuid field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the master field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public PIF getMaster(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the slaves field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public Set<PIF> getSlaves(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_slaves";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Get the other_config field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the primary_slave field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public PIF getPrimarySlave(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_primary_slave";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the mode field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public Types.BondMode getMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBondMode(result);
+    }
+
+    /**
+     * Get the properties field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getProperties(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_properties";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the links_up field of the given Bond.
+     *
+     * @return value of the field
+     */
+    public Long getLinksUp(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_links_up";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Set the other_config field of the given Bond.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given Bond.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given Bond.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create an interface bond
+     *
+     * @param network Network to add the bonded PIF to
+     * @param members PIFs to add to this bond
+     * @param MAC The MAC address to use on the bond itself. If this parameter is the empty string then the bond will inherit its MAC address from the primary slave.
+     * @param mode Bonding mode to use for the new bond
+     * @param properties Additional configuration parameters specific to the bond mode
+     * @return Task
+     */
+    public static Task createAsync(Connection c, Network network, Set<PIF> members, String MAC, Types.BondMode mode, Map<String, String> properties) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.Bond.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(members), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(properties)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create an interface bond
+     *
+     * @param network Network to add the bonded PIF to
+     * @param members PIFs to add to this bond
+     * @param MAC The MAC address to use on the bond itself. If this parameter is the empty string then the bond will inherit its MAC address from the primary slave.
+     * @param mode Bonding mode to use for the new bond
+     * @param properties Additional configuration parameters specific to the bond mode
+     * @return The reference of the created Bond object
+     */
+    public static Bond create(Connection c, Network network, Set<PIF> members, String MAC, Types.BondMode mode, Map<String, String> properties) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(members), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(properties)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBond(result);
+    }
+
+    /**
+     * Destroy an interface bond
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.Bond.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy an interface bond
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Change the bond mode
+     *
+     * @param value The new bond mode
+     * @return Task
+     */
+    public Task setModeAsync(Connection c, Types.BondMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.Bond.set_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Change the bond mode
+     *
+     * @param value The new bond mode
+     */
+    public void setMode(Connection c, Types.BondMode value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.set_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the value of a property of the bond
+     *
+     * @param name The property name
+     * @param value The property value
+     * @return Task
+     */
+    public Task setPropertyAsync(Connection c, String name, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.Bond.set_property";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the value of a property of the bond
+     *
+     * @param name The property name
+     * @param value The property value
+     */
+    public void setProperty(Connection c, String name, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.set_property";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the Bonds known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<Bond> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfBond(result);
+    }
+
+    /**
+     * Return a map of Bond references to Bond records for all Bonds known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<Bond, Bond.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Bond.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfBondBondRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
new file mode 100755
index 0000000..661724f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.apache.xmlrpc.XmlRpcException;
+import org.apache.xmlrpc.client.XmlRpcClient;
+import org.apache.xmlrpc.client.XmlRpcClientConfig;
+import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
+import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.SessionAuthenticationFailed;
+import com.xensource.xenapi.Types.XenAPIException;
+
+/**
+ * Represents a connection to a XenServer. Creating a new instance of this class initialises a new XmlRpcClient that is
+ * then used by all method calls: each method call in xenapi takes a Connection as a parameter, composes an XMLRPC
+ * method call, and dispatches it on the Connection's client via the dispatch method.
+ */
+public class Connection
+{
+    /**
+     * The version of the bindings that this class belongs to.
+     */
+    public static final String BINDINGS_VERSION = "6.2.0-1";
+    
+    private APIVersion apiVersion;
+
+    protected int _wait = 600;
+
+    /**
+     * Updated when Session.login_with_password() is called.
+     */
+    public APIVersion getAPIVersion()
+    {
+        return apiVersion;
+    }
+
+    /**
+     * The opaque reference to the session used by this connection
+     */
+    private String sessionReference;
+
+    /**
+     * As seen by the xmlrpc library. From our point of view it's a server.
+     */
+    private final XmlRpcClient client;
+
+    private final boolean deprecatedConstructorUsed;
+
+    /**
+     * Creates a connection to a particular server using a given username and password. This object can then be passed
+     * in to any other API calls.
+     * 
+     * This constructor calls Session.loginWithPassword, passing itself as the first parameter.
+     * 
+     * When this constructor is used, a call to dispose() (also called in the Connection's finalizer) will attempt a
+     * Session.logout on this connection.
+     * 
+     * @deprecated Use a constructor that takes a URL as the first parameter instead.
+     */
+    @Deprecated
+    public Connection(String client, String username, String password) throws java.net.MalformedURLException,
+        XmlRpcException, BadServerResponse, SessionAuthenticationFailed, XenAPIException
+    {
+        deprecatedConstructorUsed = true;
+
+        final String ApiVersion = APIVersion.latest().toString();
+        this.client = getClientFromURL(new URL(client));
+        try
+        {
+            this.sessionReference = loginWithPassword(this.client, username, password, ApiVersion);
+        } catch (BadServerResponse e)
+        {
+            String[] errDesc = e.errorDescription;
+
+            if (0 == errDesc[0].compareTo("MESSAGE_PARAMETER_COUNT_MISMATCH")
+                    && 0 == errDesc[1].compareTo("session.login_with_password")
+                    && 0 == errDesc[2].compareTo("2")
+                    && 0 == errDesc[3].compareTo("3"))
+            {
+                this.sessionReference = loginWithPassword(this.client, username, password);
+            } else
+            {
+                throw e;
+            }
+        }
+
+        try
+        {
+            setAPIVersion(new Session(sessionReference));
+        }
+        catch (XenAPIException exn)
+        {
+            dispose();
+            throw exn;
+        }
+        catch (XmlRpcException exn)
+        {
+            dispose();
+            throw exn;
+        }
+    }
+
+    /**
+     * Creates a connection to a particular server using a given username and password. This object can then be passed
+     * in to any other API calls.
+     * 
+     * Note this constructor does NOT call Session.loginWithPassword; the programmer is responsible for calling it,
+     * passing the Connection as a parameter. No attempt to connect to the server is made until login is called.
+     * 
+     * When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually
+     * logging out the Session.
+     */
+    public Connection(URL url, int wait)
+    {
+        deprecatedConstructorUsed = false;
+        _wait = wait;
+        this.client = getClientFromURL(url);
+    }
+
+    /**
+     * Creates a connection to a particular server using a given username and password. This object can then be passed
+     * in to any other API calls.
+     * 
+     * The additional sessionReference parameter must be a reference to a logged-in Session. Any method calls on this
+     * Connection will use it. This constructor does not call Session.loginWithPassword, and dispose() on the resulting
+     * Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged
+     * in and out correctly.
+     */
+    public Connection(URL url, String sessionReference)
+    {
+        deprecatedConstructorUsed = false;
+
+        this.client = getClientFromURL(url);
+        this.sessionReference = sessionReference;
+    }
+
+    protected void finalize() throws Throwable
+    {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Nothrow guarantee.
+     */
+    public void dispose()
+    {
+        if (!deprecatedConstructorUsed)
+        {
+            // We only need to do the Session.logout if they used the old deprecated constructor.
+            return;
+        }
+
+        try
+        {
+            if (sessionReference != null)
+            {
+                String method_call = "session.logout";
+                Object[] method_params = { Marshalling.toXMLRPC(this.sessionReference) };
+                client.execute(method_call, method_params);
+                sessionReference = null;
+            }
+        }
+        catch (XmlRpcException exn)
+        {
+        }
+    }
+
+    /**
+     * @deprecated The programmer is now responsible for calling login/logout themselves.
+     */
+    @Deprecated
+    private static String loginWithPassword(XmlRpcClient client, String username, String password)
+            throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
+    {
+        String method_call = "session.login_with_password";
+        Object[] method_params = { Marshalling.toXMLRPC(username), Marshalling.toXMLRPC(password) };
+        Map response = (Map) client.execute(method_call, method_params);
+        if (response.get("Status").equals("Success"))
+        {
+            return (String) response.get("Value");
+        } else if (response.get("Status").equals("Failure"))
+        {
+            Object[] error = (Object[]) response.get("ErrorDescription");
+            if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
+            {
+                throw new SessionAuthenticationFailed();
+            }
+        }
+        throw new BadServerResponse(response);
+    }
+
+    /**
+     * @deprecated The programmer is now responsible for calling login/logout themselves.
+     */
+    @Deprecated
+    private static String loginWithPassword(XmlRpcClient client, String username, String password, String ApiVersion)
+            throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
+    {
+        String method_call = "session.login_with_password";
+        Object[] method_params = { Marshalling.toXMLRPC(username), Marshalling.toXMLRPC(password),
+                Marshalling.toXMLRPC(ApiVersion) };
+        Map response = (Map) client.execute(method_call, method_params);
+        if (response.get("Status").equals("Success"))
+        {
+            return (String) response.get("Value");
+        } else if (response.get("Status").equals("Failure"))
+        {
+            Object[] error = (Object[]) response.get("ErrorDescription");
+            if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
+            {
+                throw new SessionAuthenticationFailed();
+            }
+        }
+        throw new BadServerResponse(response);
+    }
+
+    private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
+
+    public XmlRpcClientConfigImpl getConfig()
+    {
+	return config;
+    }
+    private XmlRpcClient getClientFromURL(URL url)
+    {
+        config.setTimeZone(TimeZone.getTimeZone("UTC"));
+        config.setServerURL(url);
+        config.setReplyTimeout(_wait * 1000);
+        config.setConnectionTimeout(5000);
+        XmlRpcClient client = new XmlRpcClient();
+        client.setConfig(config);
+        return client;
+    }
+
+    /*
+     * Because the binding calls are constructing their own parameter lists, they need to be able to get to 
+     * the session reference directly. This is all rather ugly and needs redone
+     * Changed to public to allow easier integration with HTTP-level streaming interface,
+     * see CA-15447
+     */
+    public String getSessionReference()
+    {
+        return this.sessionReference;
+    }
+
+    /**
+     * The (auto-generated parts of) the bindings dispatch XMLRPC calls on this Connection's client through this method.
+     */
+    protected Map dispatch(String method_call, Object[] method_params) throws XmlRpcException, XenAPIException
+    {
+        Map response = (Map) client.execute(method_call, method_params);
+
+        if (!deprecatedConstructorUsed)
+        {
+            // We are using the new-style constructor which doesn't perform login.
+            // Set this Connection's Session reference from the value returned on the wire.
+            if (method_call.equals("session.login_with_password") &&
+                response.get("Status").equals("Success"))
+            {
+                // Store the Session reference and ask the server what the
+                // API version it's using is.
+                Session session = Types.toSession(response.get("Value"));
+                sessionReference = session.ref;
+                setAPIVersion(session);
+            }
+            else if (method_call.equals("session.slave_local_login_with_password") &&
+                     response.get("Status").equals("Success"))
+            {
+                // Store the Session reference and assume the latest API version.
+                sessionReference = Types.toSession(response.get("Value")).ref;
+                apiVersion = APIVersion.latest();
+            }
+            else if (method_call.equals("session.logout"))
+            {
+                // Work around a bug in XenServer 5.0 and below.
+                // session.login_with_password should have rejected us with
+                // HOST_IS_SLAVE, but instead we don't find out until later.
+                // We don't want to leak the session, so we need to log out
+                // this session from the master instead.
+                if (response.get("Status").equals("Failure"))
+                {
+                    Object[] error = (Object[]) response.get("ErrorDescription");
+                    if (error.length == 2 && error[0].equals("HOST_IS_SLAVE"))
+                    {
+                        try
+                        {
+                            URL client_url =
+                                ((XmlRpcHttpClientConfig)client.getClientConfig()).getServerURL();
+                            Connection tmp_conn =
+                                new Connection(new URL(client_url.getProtocol(),
+                                                       (String)error[1],
+                                                       client_url.getPort(),
+                                                       client_url.getFile()), _wait);
+                            tmp_conn.sessionReference = sessionReference;
+                            try
+                            {
+                                Session.logout(tmp_conn);
+                            }
+                            finally
+                            {
+                                tmp_conn.dispose();
+                            }
+                        }
+                        catch (Exception exn2)
+                        {
+                            // Ignore -- we're going to throw HostIsSlave anyway.
+                        }
+                    }
+                }
+
+                // Clear the stored Session reference.
+                this.sessionReference = null;
+            }
+        }
+
+        return Types.checkResponse(response);
+    }
+
+
+    private void setAPIVersion(Session session) throws XenAPIException, XmlRpcException
+    {
+        try
+        {
+            long major = session.getThisHost(this).getAPIVersionMajor(this);
+            long minor = session.getThisHost(this).getAPIVersionMinor(this);
+            apiVersion = APIVersion.fromMajorMinor(major, minor);
+        }
+        catch (BadServerResponse exn)
+        {
+            apiVersion = APIVersion.UNKNOWN;
+        }
+    }
+}


[12/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Pool.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Pool.java b/deps/XenServerJava/src/com/xensource/xenapi/Pool.java
new file mode 100644
index 0000000..8b5c94d
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Pool.java
@@ -0,0 +1,2392 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Pool-wide information
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Pool extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Pool(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Pool, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Pool)
+        {
+            Pool other = (Pool) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Pool
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "master", this.master);
+            print.printf("%1$20s: %2$s\n", "defaultSR", this.defaultSR);
+            print.printf("%1$20s: %2$s\n", "suspendImageSR", this.suspendImageSR);
+            print.printf("%1$20s: %2$s\n", "crashDumpSR", this.crashDumpSR);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "haEnabled", this.haEnabled);
+            print.printf("%1$20s: %2$s\n", "haConfiguration", this.haConfiguration);
+            print.printf("%1$20s: %2$s\n", "haStatefiles", this.haStatefiles);
+            print.printf("%1$20s: %2$s\n", "haHostFailuresToTolerate", this.haHostFailuresToTolerate);
+            print.printf("%1$20s: %2$s\n", "haPlanExistsFor", this.haPlanExistsFor);
+            print.printf("%1$20s: %2$s\n", "haAllowOvercommit", this.haAllowOvercommit);
+            print.printf("%1$20s: %2$s\n", "haOvercommitted", this.haOvercommitted);
+            print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+            print.printf("%1$20s: %2$s\n", "tags", this.tags);
+            print.printf("%1$20s: %2$s\n", "guiConfig", this.guiConfig);
+            print.printf("%1$20s: %2$s\n", "wlbUrl", this.wlbUrl);
+            print.printf("%1$20s: %2$s\n", "wlbUsername", this.wlbUsername);
+            print.printf("%1$20s: %2$s\n", "wlbEnabled", this.wlbEnabled);
+            print.printf("%1$20s: %2$s\n", "wlbVerifyCert", this.wlbVerifyCert);
+            print.printf("%1$20s: %2$s\n", "redoLogEnabled", this.redoLogEnabled);
+            print.printf("%1$20s: %2$s\n", "redoLogVdi", this.redoLogVdi);
+            print.printf("%1$20s: %2$s\n", "vswitchController", this.vswitchController);
+            print.printf("%1$20s: %2$s\n", "restrictions", this.restrictions);
+            print.printf("%1$20s: %2$s\n", "metadataVDIs", this.metadataVDIs);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a pool.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("master", this.master == null ? new Host("OpaqueRef:NULL") : this.master);
+            map.put("default_SR", this.defaultSR == null ? new SR("OpaqueRef:NULL") : this.defaultSR);
+            map.put("suspend_image_SR", this.suspendImageSR == null ? new SR("OpaqueRef:NULL") : this.suspendImageSR);
+            map.put("crash_dump_SR", this.crashDumpSR == null ? new SR("OpaqueRef:NULL") : this.crashDumpSR);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("ha_enabled", this.haEnabled == null ? false : this.haEnabled);
+            map.put("ha_configuration", this.haConfiguration == null ? new HashMap<String, String>() : this.haConfiguration);
+            map.put("ha_statefiles", this.haStatefiles == null ? new LinkedHashSet<String>() : this.haStatefiles);
+            map.put("ha_host_failures_to_tolerate", this.haHostFailuresToTolerate == null ? 0 : this.haHostFailuresToTolerate);
+            map.put("ha_plan_exists_for", this.haPlanExistsFor == null ? 0 : this.haPlanExistsFor);
+            map.put("ha_allow_overcommit", this.haAllowOvercommit == null ? false : this.haAllowOvercommit);
+            map.put("ha_overcommitted", this.haOvercommitted == null ? false : this.haOvercommitted);
+            map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
+            map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
+            map.put("gui_config", this.guiConfig == null ? new HashMap<String, String>() : this.guiConfig);
+            map.put("wlb_url", this.wlbUrl == null ? "" : this.wlbUrl);
+            map.put("wlb_username", this.wlbUsername == null ? "" : this.wlbUsername);
+            map.put("wlb_enabled", this.wlbEnabled == null ? false : this.wlbEnabled);
+            map.put("wlb_verify_cert", this.wlbVerifyCert == null ? false : this.wlbVerifyCert);
+            map.put("redo_log_enabled", this.redoLogEnabled == null ? false : this.redoLogEnabled);
+            map.put("redo_log_vdi", this.redoLogVdi == null ? new VDI("OpaqueRef:NULL") : this.redoLogVdi);
+            map.put("vswitch_controller", this.vswitchController == null ? "" : this.vswitchController);
+            map.put("restrictions", this.restrictions == null ? new HashMap<String, String>() : this.restrictions);
+            map.put("metadata_VDIs", this.metadataVDIs == null ? new LinkedHashSet<VDI>() : this.metadataVDIs);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Short name
+         */
+        public String nameLabel;
+        /**
+         * Description
+         */
+        public String nameDescription;
+        /**
+         * The host that is pool master
+         */
+        public Host master;
+        /**
+         * Default SR for VDIs
+         */
+        public SR defaultSR;
+        /**
+         * The SR in which VDIs for suspend images are created
+         */
+        public SR suspendImageSR;
+        /**
+         * The SR in which VDIs for crash dumps are created
+         */
+        public SR crashDumpSR;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * true if HA is enabled on the pool, false otherwise
+         */
+        public Boolean haEnabled;
+        /**
+         * The current HA configuration
+         */
+        public Map<String, String> haConfiguration;
+        /**
+         * HA statefile VDIs in use
+         */
+        public Set<String> haStatefiles;
+        /**
+         * Number of host failures to tolerate before the Pool is declared to be overcommitted
+         */
+        public Long haHostFailuresToTolerate;
+        /**
+         * Number of future host failures we have managed to find a plan for. Once this reaches zero any future host failures will cause the failure of protected VMs.
+         */
+        public Long haPlanExistsFor;
+        /**
+         * If set to false then operations which would cause the Pool to become overcommitted will be blocked.
+         */
+        public Boolean haAllowOvercommit;
+        /**
+         * True if the Pool is considered to be overcommitted i.e. if there exist insufficient physical resources to tolerate the configured number of host failures
+         */
+        public Boolean haOvercommitted;
+        /**
+         * Binary blobs associated with this pool
+         */
+        public Map<String, Blob> blobs;
+        /**
+         * user-specified tags for categorization purposes
+         */
+        public Set<String> tags;
+        /**
+         * gui-specific configuration for pool
+         */
+        public Map<String, String> guiConfig;
+        /**
+         * Url for the configured workload balancing host
+         */
+        public String wlbUrl;
+        /**
+         * Username for accessing the workload balancing host
+         */
+        public String wlbUsername;
+        /**
+         * true if workload balancing is enabled on the pool, false otherwise
+         */
+        public Boolean wlbEnabled;
+        /**
+         * true if communication with the WLB server should enforce SSL certificate verification.
+         */
+        public Boolean wlbVerifyCert;
+        /**
+         * true a redo-log is to be used other than when HA is enabled, false otherwise
+         */
+        public Boolean redoLogEnabled;
+        /**
+         * indicates the VDI to use for the redo-log other than when HA is enabled
+         */
+        public VDI redoLogVdi;
+        /**
+         * address of the vswitch controller
+         */
+        public String vswitchController;
+        /**
+         * Pool-wide restrictions currently in effect
+         */
+        public Map<String, String> restrictions;
+        /**
+         * The set of currently known metadata VDIs for this pool
+         */
+        public Set<VDI> metadataVDIs;
+    }
+
+    /**
+     * Get a record containing the current state of the given pool.
+     *
+     * @return all fields from the object
+     */
+    public Pool.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPoolRecord(result);
+    }
+
+    /**
+     * Get a reference to the pool instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static Pool getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPool(result);
+    }
+
+    /**
+     * Get the uuid field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name_label field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name_description field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the master field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Host getMaster(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the default_SR field of the given pool.
+     *
+     * @return value of the field
+     */
+    public SR getDefaultSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_default_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the suspend_image_SR field of the given pool.
+     *
+     * @return value of the field
+     */
+    public SR getSuspendImageSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_suspend_image_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the crash_dump_SR field of the given pool.
+     *
+     * @return value of the field
+     */
+    public SR getCrashDumpSR(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_crash_dump_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSR(result);
+    }
+
+    /**
+     * Get the other_config field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the ha_enabled field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getHaEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the ha_configuration field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getHaConfiguration(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the ha_statefiles field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Set<String> getHaStatefiles(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_statefiles";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the ha_host_failures_to_tolerate field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Long getHaHostFailuresToTolerate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_host_failures_to_tolerate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the ha_plan_exists_for field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Long getHaPlanExistsFor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_plan_exists_for";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the ha_allow_overcommit field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getHaAllowOvercommit(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_allow_overcommit";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the ha_overcommitted field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getHaOvercommitted(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_ha_overcommitted";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the blobs field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Map<String, Blob> getBlobs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_blobs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringBlob(result);
+    }
+
+    /**
+     * Get the tags field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Set<String> getTags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the gui_config field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getGuiConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_gui_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the wlb_url field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getWlbUrl(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_wlb_url";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the wlb_username field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getWlbUsername(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_wlb_username";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the wlb_enabled field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getWlbEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_wlb_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the wlb_verify_cert field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getWlbVerifyCert(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_wlb_verify_cert";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the redo_log_enabled field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Boolean getRedoLogEnabled(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_redo_log_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the redo_log_vdi field of the given pool.
+     *
+     * @return value of the field
+     */
+    public VDI getRedoLogVdi(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_redo_log_vdi";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the vswitch_controller field of the given pool.
+     *
+     * @return value of the field
+     */
+    public String getVswitchController(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_vswitch_controller";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the restrictions field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getRestrictions(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_restrictions";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the metadata_VDIs field of the given pool.
+     *
+     * @return value of the field
+     */
+    public Set<VDI> getMetadataVDIs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.get_metadata_VDIs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVDI(result);
+    }
+
+    /**
+     * Set the name_label field of the given pool.
+     *
+     * @param nameLabel New value to set
+     */
+    public void setNameLabel(Connection c, String nameLabel) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(nameLabel)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the name_description field of the given pool.
+     *
+     * @param nameDescription New value to set
+     */
+    public void setNameDescription(Connection c, String nameDescription) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(nameDescription)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the default_SR field of the given pool.
+     *
+     * @param defaultSR New value to set
+     */
+    public void setDefaultSR(Connection c, SR defaultSR) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_default_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(defaultSR)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the suspend_image_SR field of the given pool.
+     *
+     * @param suspendImageSR New value to set
+     */
+    public void setSuspendImageSR(Connection c, SR suspendImageSR) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_suspend_image_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(suspendImageSR)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the crash_dump_SR field of the given pool.
+     *
+     * @param crashDumpSR New value to set
+     */
+    public void setCrashDumpSR(Connection c, SR crashDumpSR) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_crash_dump_SR";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(crashDumpSR)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given pool.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given pool.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given pool.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the ha_allow_overcommit field of the given pool.
+     *
+     * @param haAllowOvercommit New value to set
+     */
+    public void setHaAllowOvercommit(Connection c, Boolean haAllowOvercommit) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_ha_allow_overcommit";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(haAllowOvercommit)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the tags field of the given pool.
+     *
+     * @param tags New value to set
+     */
+    public void setTags(Connection c, Set<String> tags) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given value to the tags field of the given pool.  If the value is already in that Set, then do nothing.
+     *
+     * @param value New value to add
+     */
+    public void addTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.add_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given value from the tags field of the given pool.  If the value is not in that Set, then do nothing.
+     *
+     * @param value Value to remove
+     */
+    public void removeTags(Connection c, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.remove_tags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the gui_config field of the given pool.
+     *
+     * @param guiConfig New value to set
+     */
+    public void setGuiConfig(Connection c, Map<String, String> guiConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_gui_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(guiConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the gui_config field of the given pool.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToGuiConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.add_to_gui_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the gui_config field of the given pool.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromGuiConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.remove_from_gui_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the wlb_enabled field of the given pool.
+     *
+     * @param wlbEnabled New value to set
+     */
+    public void setWlbEnabled(Connection c, Boolean wlbEnabled) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_wlb_enabled";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(wlbEnabled)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the wlb_verify_cert field of the given pool.
+     *
+     * @param wlbVerifyCert New value to set
+     */
+    public void setWlbVerifyCert(Connection c, Boolean wlbVerifyCert) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_wlb_verify_cert";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(wlbVerifyCert)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct host to join a new pool
+     *
+     * @param masterAddress The hostname of the master of the pool to join
+     * @param masterUsername The username of the master (for initial authentication)
+     * @param masterPassword The password for the master (for initial authentication)
+     * @return Task
+     */
+    public static Task joinAsync(Connection c, String masterAddress, String masterUsername, String masterPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.JoiningHostCannotContainSharedSrs {
+        String method_call = "Async.pool.join";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(masterAddress), Marshalling.toXMLRPC(masterUsername), Marshalling.toXMLRPC(masterPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Instruct host to join a new pool
+     *
+     * @param masterAddress The hostname of the master of the pool to join
+     * @param masterUsername The username of the master (for initial authentication)
+     * @param masterPassword The password for the master (for initial authentication)
+     */
+    public static void join(Connection c, String masterAddress, String masterUsername, String masterPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.JoiningHostCannotContainSharedSrs {
+        String method_call = "pool.join";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(masterAddress), Marshalling.toXMLRPC(masterUsername), Marshalling.toXMLRPC(masterPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct host to join a new pool
+     *
+     * @param masterAddress The hostname of the master of the pool to join
+     * @param masterUsername The username of the master (for initial authentication)
+     * @param masterPassword The password for the master (for initial authentication)
+     * @return Task
+     */
+    public static Task joinForceAsync(Connection c, String masterAddress, String masterUsername, String masterPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.join_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(masterAddress), Marshalling.toXMLRPC(masterUsername), Marshalling.toXMLRPC(masterPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Instruct host to join a new pool
+     *
+     * @param masterAddress The hostname of the master of the pool to join
+     * @param masterUsername The username of the master (for initial authentication)
+     * @param masterPassword The password for the master (for initial authentication)
+     */
+    public static void joinForce(Connection c, String masterAddress, String masterUsername, String masterPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.join_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(masterAddress), Marshalling.toXMLRPC(masterUsername), Marshalling.toXMLRPC(masterPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct a pool master to eject a host from the pool
+     *
+     * @param host The host to eject
+     * @return Task
+     */
+    public static Task ejectAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.eject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Instruct a pool master to eject a host from the pool
+     *
+     * @param host The host to eject
+     */
+    public static void eject(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.eject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct host that's currently a slave to transition to being master
+     *
+     */
+    public static void emergencyTransitionToMaster(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.emergency_transition_to_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct a slave already in a pool that the master has changed
+     *
+     * @param masterAddress The hostname of the master
+     */
+    public static void emergencyResetMaster(Connection c, String masterAddress) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.emergency_reset_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(masterAddress)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Instruct a pool master, M, to try and contact its slaves and, if slaves are in emergency mode, reset their master address to M.
+     *
+     * @return Task
+     */
+    public static Task recoverSlavesAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.recover_slaves";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Instruct a pool master, M, to try and contact its slaves and, if slaves are in emergency mode, reset their master address to M.
+     *
+     * @return list of hosts whose master address were succesfully reset
+     */
+    public static Set<Host> recoverSlaves(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.recover_slaves";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHost(result);
+    }
+
+    /**
+     * Create PIFs, mapping a network to the same physical interface/VLAN on each host. This call is deprecated: use Pool.create_VLAN_from_PIF instead.
+     *
+     * @param device physical interface on which to create the VLAN interface
+     * @param network network to which this interface should be connected
+     * @param VLAN VLAN tag for the new interface
+     * @return Task
+     */
+    public static Task createVLANAsync(Connection c, String device, Network network, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "Async.pool.create_VLAN";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create PIFs, mapping a network to the same physical interface/VLAN on each host. This call is deprecated: use Pool.create_VLAN_from_PIF instead.
+     *
+     * @param device physical interface on which to create the VLAN interface
+     * @param network network to which this interface should be connected
+     * @param VLAN VLAN tag for the new interface
+     * @return The references of the created PIF objects
+     */
+    public static Set<PIF> createVLAN(Connection c, String device, Network network, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "pool.create_VLAN";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(device), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Create a pool-wide VLAN by taking the PIF.
+     *
+     * @param pif physical interface on any particular host, that identifies the PIF on which to create the (pool-wide) VLAN interface
+     * @param network network to which this interface should be connected
+     * @param VLAN VLAN tag for the new interface
+     * @return Task
+     */
+    public static Task createVLANFromPIFAsync(Connection c, PIF pif, Network network, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "Async.pool.create_VLAN_from_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(pif), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a pool-wide VLAN by taking the PIF.
+     *
+     * @param pif physical interface on any particular host, that identifies the PIF on which to create the (pool-wide) VLAN interface
+     * @param network network to which this interface should be connected
+     * @param VLAN VLAN tag for the new interface
+     * @return The references of the created PIF objects
+     */
+    public static Set<PIF> createVLANFromPIF(Connection c, PIF pif, Network network, Long VLAN) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VlanTagInvalid {
+        String method_call = "pool.create_VLAN_from_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(pif), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(VLAN)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfPIF(result);
+    }
+
+    /**
+     * Turn on High Availability mode
+     *
+     * @param heartbeatSrs Set of SRs to use for storage heartbeating.
+     * @param configuration Detailed HA configuration to apply
+     * @return Task
+     */
+    public static Task enableHaAsync(Connection c, Set<SR> heartbeatSrs, Map<String, String> configuration) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.enable_ha";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(heartbeatSrs), Marshalling.toXMLRPC(configuration)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Turn on High Availability mode
+     *
+     * @param heartbeatSrs Set of SRs to use for storage heartbeating.
+     * @param configuration Detailed HA configuration to apply
+     */
+    public static void enableHa(Connection c, Set<SR> heartbeatSrs, Map<String, String> configuration) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.enable_ha";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(heartbeatSrs), Marshalling.toXMLRPC(configuration)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Turn off High Availability mode
+     *
+     * @return Task
+     */
+    public static Task disableHaAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.disable_ha";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Turn off High Availability mode
+     *
+     */
+    public static void disableHa(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.disable_ha";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Forcibly synchronise the database now
+     *
+     * @return Task
+     */
+    public static Task syncDatabaseAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.sync_database";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Forcibly synchronise the database now
+     *
+     */
+    public static void syncDatabase(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.sync_database";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Perform an orderly handover of the role of master to the referenced host.
+     *
+     * @param host The host who should become the new master
+     * @return Task
+     */
+    public static Task designateNewMasterAsync(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.designate_new_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Perform an orderly handover of the role of master to the referenced host.
+     *
+     * @param host The host who should become the new master
+     */
+    public static void designateNewMaster(Connection c, Host host) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.designate_new_master";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * When this call returns the VM restart logic will not run for the requested number of seconds. If the argument is zero then the restart thread is immediately unblocked
+     *
+     * @param seconds The number of seconds to block the restart thread for
+     */
+    public static void haPreventRestartsFor(Connection c, Long seconds) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.ha_prevent_restarts_for";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(seconds)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Returns true if a VM failover plan exists for up to 'n' host failures
+     *
+     * @param n The number of host failures to plan for
+     * @return true if a failover plan exists for the supplied number of host failures
+     */
+    public static Boolean haFailoverPlanExists(Connection c, Long n) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.ha_failover_plan_exists";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(n)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Returns the maximum number of host failures we could tolerate before we would be unable to restart configured VMs
+     *
+     * @return maximum value for ha_host_failures_to_tolerate given current configuration
+     */
+    public static Long haComputeMaxHostFailuresToTolerate(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.ha_compute_max_host_failures_to_tolerate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Returns the maximum number of host failures we could tolerate before we would be unable to restart the provided VMs
+     *
+     * @param configuration Map of protected VM reference to restart priority
+     * @return maximum value for ha_host_failures_to_tolerate given provided configuration
+     */
+    public static Long haComputeHypotheticalMaxHostFailuresToTolerate(Connection c, Map<VM, String> configuration) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.ha_compute_hypothetical_max_host_failures_to_tolerate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(configuration)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Return a VM failover plan assuming a given subset of hosts fail
+     *
+     * @param failedHosts The set of hosts to assume have failed
+     * @param failedVms The set of VMs to restart
+     * @return VM failover plan: a map of VM to host to restart the host on
+     */
+    public static Map<VM, Map<String, String>> haComputeVmFailoverPlan(Connection c, Set<Host> failedHosts, Set<VM> failedVms) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.ha_compute_vm_failover_plan";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(failedHosts), Marshalling.toXMLRPC(failedVms)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMMapOfStringString(result);
+    }
+
+    /**
+     * Set the maximum number of host failures to consider in the HA VM restart planner
+     *
+     * @param value New number of host failures to consider
+     * @return Task
+     */
+    public Task setHaHostFailuresToTolerateAsync(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.set_ha_host_failures_to_tolerate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the maximum number of host failures to consider in the HA VM restart planner
+     *
+     * @param value New number of host failures to consider
+     */
+    public void setHaHostFailuresToTolerate(Connection c, Long value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_ha_host_failures_to_tolerate";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this pool
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return Task
+     */
+    public Task createNewBlobAsync(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a placeholder for a named binary blob of data that is associated with this pool
+     *
+     * @param name The name associated with the blob
+     * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+     * @param _public True if the blob should be publicly available
+     * @return The reference of the blob, needed for populating its data
+     */
+    public Blob createNewBlob(Connection c, String name, String mimeType, Boolean _public) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.create_new_blob";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBlob(result);
+    }
+
+    /**
+     * This call enables external authentication on all the hosts of the pool
+     *
+     * @param config A list of key-values containing the configuration data
+     * @param serviceName The name of the service
+     * @param authType The type of authentication (e.g. AD for Active Directory)
+     */
+    public void enableExternalAuth(Connection c, Map<String, String> config, String serviceName, String authType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.enable_external_auth";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(config), Marshalling.toXMLRPC(serviceName), Marshalling.toXMLRPC(authType)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call disables external authentication on all the hosts of the pool
+     *
+     * @param config Optional parameters as a list of key-values containing the configuration data
+     */
+    public void disableExternalAuth(Connection c, Map<String, String> config) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.disable_external_auth";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(config)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call asynchronously detects if the external authentication configuration in any slave is different from that in the master and raises appropriate alerts
+     *
+     */
+    public void detectNonhomogeneousExternalAuth(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.detect_nonhomogeneous_external_auth";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Initializes workload balancing monitoring on this pool with the specified wlb server
+     *
+     * @param wlbUrl The ip address and port to use when accessing the wlb server
+     * @param wlbUsername The username used to authenticate with the wlb server
+     * @param wlbPassword The password used to authenticate with the wlb server
+     * @param xenserverUsername The usernamed used by the wlb server to authenticate with the xenserver
+     * @param xenserverPassword The password used by the wlb server to authenticate with the xenserver
+     * @return Task
+     */
+    public static Task initializeWlbAsync(Connection c, String wlbUrl, String wlbUsername, String wlbPassword, String xenserverUsername, String xenserverPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.initialize_wlb";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(wlbUrl), Marshalling.toXMLRPC(wlbUsername), Marshalling.toXMLRPC(wlbPassword), Marshalling.toXMLRPC(xenserverUsername), Marshalling.toXMLRPC(xenserverPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Initializes workload balancing monitoring on this pool with the specified wlb server
+     *
+     * @param wlbUrl The ip address and port to use when accessing the wlb server
+     * @param wlbUsername The username used to authenticate with the wlb server
+     * @param wlbPassword The password used to authenticate with the wlb server
+     * @param xenserverUsername The usernamed used by the wlb server to authenticate with the xenserver
+     * @param xenserverPassword The password used by the wlb server to authenticate with the xenserver
+     */
+    public static void initializeWlb(Connection c, String wlbUrl, String wlbUsername, String wlbPassword, String xenserverUsername, String xenserverPassword) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.initialize_wlb";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(wlbUrl), Marshalling.toXMLRPC(wlbUsername), Marshalling.toXMLRPC(wlbPassword), Marshalling.toXMLRPC(xenserverUsername), Marshalling.toXMLRPC(xenserverPassword)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Permanently deconfigures workload balancing monitoring on this pool
+     *
+     * @return Task
+     */
+    public static Task deconfigureWlbAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.deconfigure_wlb";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Permanently deconfigures workload balancing monitoring on this pool
+     *
+     */
+    public static void deconfigureWlb(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.deconfigure_wlb";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Sets the pool optimization criteria for the workload balancing server
+     *
+     * @param config The configuration to use in optimizing this pool
+     * @return Task
+     */
+    public static Task sendWlbConfigurationAsync(Connection c, Map<String, String> config) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.send_wlb_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(config)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Sets the pool optimization criteria for the workload balancing server
+     *
+     * @param config The configuration to use in optimizing this pool
+     */
+    public static void sendWlbConfiguration(Connection c, Map<String, String> config) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.send_wlb_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(config)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Retrieves the pool optimization criteria from the workload balancing server
+     *
+     * @return Task
+     */
+    public static Task retrieveWlbConfigurationAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.retrieve_wlb_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Retrieves the pool optimization criteria from the workload balancing server
+     *
+     * @return The configuration used in optimizing this pool
+     */
+    public static Map<String, String> retrieveWlbConfiguration(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.retrieve_wlb_configuration";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Retrieves vm migrate recommendations for the pool from the workload balancing server
+     *
+     * @return Task
+     */
+    public static Task retrieveWlbRecommendationsAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.retrieve_wlb_recommendations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Retrieves vm migrate recommendations for the pool from the workload balancing server
+     *
+     * @return The list of vm migration recommendations
+     */
+    public static Map<VM, Set<String>> retrieveWlbRecommendations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.retrieve_wlb_recommendations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVMSetOfString(result);
+    }
+
+    /**
+     * Send the given body to the given host and port, using HTTPS, and print the response.  This is used for debugging the SSL layer.
+     *
+     * @param host 
+     * @param port 
+     * @param body 
+     * @return Task
+     */
+    public static Task sendTestPostAsync(Connection c, String host, Long port, String body) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.send_test_post";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(port), Marshalling.toXMLRPC(body)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Send the given body to the given host and port, using HTTPS, and print the response.  This is used for debugging the SSL layer.
+     *
+     * @param host 
+     * @param port 
+     * @param body 
+     * @return The response
+     */
+    public static String sendTestPost(Connection c, String host, Long port, String body) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.send_test_post";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host), Marshalling.toXMLRPC(port), Marshalling.toXMLRPC(body)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Install an SSL certificate pool-wide.
+     *
+     * @param name A name to give the certificate
+     * @param cert The certificate
+     * @return Task
+     */
+    public static Task certificateInstallAsync(Connection c, String name, String cert) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.certificate_install";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(cert)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Install an SSL certificate pool-wide.
+     *
+     * @param name A name to give the certificate
+     * @param cert The certificate
+     */
+    public static void certificateInstall(Connection c, String name, String cert) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.certificate_install";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(cert)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove an SSL certificate.
+     *
+     * @param name The certificate name
+     * @return Task
+     */
+    public static Task certificateUninstallAsync(Connection c, String name) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.certificate_uninstall";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Remove an SSL certificate.
+     *
+     * @param name The certificate name
+     */
+    public static void certificateUninstall(Connection c, String name) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.certificate_uninstall";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * List all installed SSL certificates.
+     *
+     * @return Task
+     */
+    public static Task certificateListAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.certificate_list";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * List all installed SSL certificates.
+     *
+     * @return All installed certificates
+     */
+    public static Set<String> certificateList(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.certificate_list";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Install an SSL certificate revocation list, pool-wide.
+     *
+     * @param name A name to give the CRL
+     * @param cert The CRL
+     * @return Task
+     */
+    public static Task crlInstallAsync(Connection c, String name, String cert) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.crl_install";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(cert)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Install an SSL certificate revocation list, pool-wide.
+     *
+     * @param name A name to give the CRL
+     * @param cert The CRL
+     */
+    public static void crlInstall(Connection c, String name, String cert) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.crl_install";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(cert)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove an SSL certificate revocation list.
+     *
+     * @param name The CRL name
+     * @return Task
+     */
+    public static Task crlUninstallAsync(Connection c, String name) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.crl_uninstall";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Remove an SSL certificate revocation list.
+     *
+     * @param name The CRL name
+     */
+    public static void crlUninstall(Connection c, String name) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.crl_uninstall";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * List all installed SSL certificate revocation lists.
+     *
+     * @return Task
+     */
+    public static Task crlListAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.crl_list";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * List all installed SSL certificate revocation lists.
+     *
+     * @return All installed CRLs
+     */
+    public static Set<String> crlList(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.crl_list";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Sync SSL certificates from master to slaves.
+     *
+     * @return Task
+     */
+    public static Task certificateSyncAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.certificate_sync";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Sync SSL certificates from master to slaves.
+     *
+     */
+    public static void certificateSync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.certificate_sync";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Enable the redo log on the given SR and start using it, unless HA is enabled.
+     *
+     * @param sr SR to hold the redo log.
+     * @return Task
+     */
+    public static Task enableRedoLogAsync(Connection c, SR sr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.enable_redo_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(sr)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Enable the redo log on the given SR and start using it, unless HA is enabled.
+     *
+     * @param sr SR to hold the redo log.
+     */
+    public static void enableRedoLog(Connection c, SR sr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.enable_redo_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(sr)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Disable the redo log if in use, unless HA is enabled.
+     *
+     * @return Task
+     */
+    public static Task disableRedoLogAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.disable_redo_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Disable the redo log if in use, unless HA is enabled.
+     *
+     */
+    public static void disableRedoLog(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.disable_redo_log";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the IP address of the vswitch controller.
+     *
+     * @param address IP address of the vswitch controller.
+     * @return Task
+     */
+    public static Task setVswitchControllerAsync(Connection c, String address) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.pool.set_vswitch_controller";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(address)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Set the IP address of the vswitch controller.
+     *
+     * @param address IP address of the vswitch controller.
+     */
+    public static void setVswitchController(Connection c, String address) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "pool.set_vswitch_controller";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(address)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * This call tests if a location is valid
+     *
+     * @par

<TRUNCATED>

[04/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java
new file mode 100644
index 0000000..c051e53
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics associated with a virtual network device
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VIFMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VIFMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VIFMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VIFMetrics)
+        {
+            VIFMetrics other = (VIFMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VIFMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "ioReadKbs", this.ioReadKbs);
+            print.printf("%1$20s: %2$s\n", "ioWriteKbs", this.ioWriteKbs);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VIF_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("io_read_kbs", this.ioReadKbs == null ? 0.0 : this.ioReadKbs);
+            map.put("io_write_kbs", this.ioWriteKbs == null ? 0.0 : this.ioWriteKbs);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Read bandwidth (KiB/s)
+         */
+        public Double ioReadKbs;
+        /**
+         * Write bandwidth (KiB/s)
+         */
+        public Double ioWriteKbs;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given VIF_metrics.
+     *
+     * @return all fields from the object
+     */
+    public VIFMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIFMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the VIF_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VIFMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVIFMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given VIF_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the io/read_kbs field of the given VIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoReadKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_io_read_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the io/write_kbs field of the given VIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoWriteKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_io_write_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the last_updated field of the given VIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given VIF_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given VIF_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VIF_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VIF_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VIF_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VIFMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVIFMetrics(result);
+    }
+
+    /**
+     * Return a map of VIF_metrics references to VIF_metrics records for all VIF_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VIFMetrics, VIFMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VIF_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVIFMetricsVIFMetricsRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java b/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java
new file mode 100644
index 0000000..f0abe29
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A VLAN mux/demux
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VLAN extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VLAN(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VLAN, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VLAN)
+        {
+            VLAN other = (VLAN) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VLAN
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "taggedPIF", this.taggedPIF);
+            print.printf("%1$20s: %2$s\n", "untaggedPIF", this.untaggedPIF);
+            print.printf("%1$20s: %2$s\n", "tag", this.tag);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VLAN.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("tagged_PIF", this.taggedPIF == null ? new PIF("OpaqueRef:NULL") : this.taggedPIF);
+            map.put("untagged_PIF", this.untaggedPIF == null ? new PIF("OpaqueRef:NULL") : this.untaggedPIF);
+            map.put("tag", this.tag == null ? 0 : this.tag);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * interface on which traffic is tagged
+         */
+        public PIF taggedPIF;
+        /**
+         * interface on which traffic is untagged
+         */
+        public PIF untaggedPIF;
+        /**
+         * VLAN tag in use
+         */
+        public Long tag;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given VLAN.
+     *
+     * @return all fields from the object
+     */
+    public VLAN.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVLANRecord(result);
+    }
+
+    /**
+     * Get a reference to the VLAN instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VLAN getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVLAN(result);
+    }
+
+    /**
+     * Get the uuid field of the given VLAN.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the tagged_PIF field of the given VLAN.
+     *
+     * @return value of the field
+     */
+    public PIF getTaggedPIF(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_tagged_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the untagged_PIF field of the given VLAN.
+     *
+     * @return value of the field
+     */
+    public PIF getUntaggedPIF(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_untagged_PIF";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPIF(result);
+    }
+
+    /**
+     * Get the tag field of the given VLAN.
+     *
+     * @return value of the field
+     */
+    public Long getTag(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_tag";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the other_config field of the given VLAN.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given VLAN.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VLAN.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VLAN.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Create a VLAN mux/demuxer
+     *
+     * @param taggedPIF PIF which receives the tagged traffic
+     * @param tag VLAN tag to use
+     * @param network Network to receive the untagged traffic
+     * @return Task
+     */
+    public static Task createAsync(Connection c, PIF taggedPIF, Long tag, Network network) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VLAN.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(taggedPIF), Marshalling.toXMLRPC(tag), Marshalling.toXMLRPC(network)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a VLAN mux/demuxer
+     *
+     * @param taggedPIF PIF which receives the tagged traffic
+     * @param tag VLAN tag to use
+     * @param network Network to receive the untagged traffic
+     * @return The reference of the created VLAN object
+     */
+    public static VLAN create(Connection c, PIF taggedPIF, Long tag, Network network) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(taggedPIF), Marshalling.toXMLRPC(tag), Marshalling.toXMLRPC(network)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVLAN(result);
+    }
+
+    /**
+     * Destroy a VLAN mux/demuxer
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VLAN.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy a VLAN mux/demuxer
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VLANs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VLAN> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVLAN(result);
+    }
+
+    /**
+     * Return a map of VLAN references to VLAN records for all VLANs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VLAN, VLAN.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VLAN.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVLANVLANRecord(result);
+    }
+
+}
\ No newline at end of file


[07/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/User.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/User.java b/deps/XenServerJava/src/com/xensource/xenapi/User.java
new file mode 100644
index 0000000..4a01d60
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/User.java
@@ -0,0 +1,384 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A user of the system
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class User extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    User(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a User, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof User)
+        {
+            User other = (User) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a User
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "shortName", this.shortName);
+            print.printf("%1$20s: %2$s\n", "fullname", this.fullname);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a user.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("short_name", this.shortName == null ? "" : this.shortName);
+            map.put("fullname", this.fullname == null ? "" : this.fullname);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * short name (e.g. userid)
+         */
+        public String shortName;
+        /**
+         * full name
+         */
+        public String fullname;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given user.
+     * @deprecated
+     *
+     * @return all fields from the object
+     */
+   @Deprecated public User.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toUserRecord(result);
+    }
+
+    /**
+     * Get a reference to the user instance with the specified UUID.
+     * @deprecated
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+   @Deprecated public static User getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toUser(result);
+    }
+
+    /**
+     * Create a new user instance, and return its handle.
+     * @deprecated
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+   @Deprecated public static Task createAsync(Connection c, User.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.user.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new user instance, and return its handle.
+     * @deprecated
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+   @Deprecated public static User create(Connection c, User.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toUser(result);
+    }
+
+    /**
+     * Destroy the specified user instance.
+     * @deprecated
+     *
+     * @return Task
+     */
+   @Deprecated public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.user.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified user instance.
+     * @deprecated
+     *
+     */
+   @Deprecated public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given user.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the short_name field of the given user.
+     *
+     * @return value of the field
+     */
+    public String getShortName(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_short_name";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the fullname field of the given user.
+     *
+     * @return value of the field
+     */
+    public String getFullname(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_fullname";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the other_config field of the given user.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the fullname field of the given user.
+     *
+     * @param fullname New value to set
+     */
+    public void setFullname(Connection c, String fullname) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.set_fullname";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(fullname)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given user.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given user.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given user.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "user.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VBD.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VBD.java b/deps/XenServerJava/src/com/xensource/xenapi/VBD.java
new file mode 100644
index 0000000..72edf38
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VBD.java
@@ -0,0 +1,1161 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A virtual block device
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VBD extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VBD(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VBD, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VBD)
+        {
+            VBD other = (VBD) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VBD
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+            print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+            print.printf("%1$20s: %2$s\n", "VM", this.VM);
+            print.printf("%1$20s: %2$s\n", "VDI", this.VDI);
+            print.printf("%1$20s: %2$s\n", "device", this.device);
+            print.printf("%1$20s: %2$s\n", "userdevice", this.userdevice);
+            print.printf("%1$20s: %2$s\n", "bootable", this.bootable);
+            print.printf("%1$20s: %2$s\n", "mode", this.mode);
+            print.printf("%1$20s: %2$s\n", "type", this.type);
+            print.printf("%1$20s: %2$s\n", "unpluggable", this.unpluggable);
+            print.printf("%1$20s: %2$s\n", "storageLock", this.storageLock);
+            print.printf("%1$20s: %2$s\n", "empty", this.empty);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            print.printf("%1$20s: %2$s\n", "currentlyAttached", this.currentlyAttached);
+            print.printf("%1$20s: %2$s\n", "statusCode", this.statusCode);
+            print.printf("%1$20s: %2$s\n", "statusDetail", this.statusDetail);
+            print.printf("%1$20s: %2$s\n", "runtimeProperties", this.runtimeProperties);
+            print.printf("%1$20s: %2$s\n", "qosAlgorithmType", this.qosAlgorithmType);
+            print.printf("%1$20s: %2$s\n", "qosAlgorithmParams", this.qosAlgorithmParams);
+            print.printf("%1$20s: %2$s\n", "qosSupportedAlgorithms", this.qosSupportedAlgorithms);
+            print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VBD.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet<Types.VbdOperations>() : this.allowedOperations);
+            map.put("current_operations", this.currentOperations == null ? new HashMap<String, Types.VbdOperations>() : this.currentOperations);
+            map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+            map.put("VDI", this.VDI == null ? new VDI("OpaqueRef:NULL") : this.VDI);
+            map.put("device", this.device == null ? "" : this.device);
+            map.put("userdevice", this.userdevice == null ? "" : this.userdevice);
+            map.put("bootable", this.bootable == null ? false : this.bootable);
+            map.put("mode", this.mode == null ? Types.VbdMode.UNRECOGNIZED : this.mode);
+            map.put("type", this.type == null ? Types.VbdType.UNRECOGNIZED : this.type);
+            map.put("unpluggable", this.unpluggable == null ? false : this.unpluggable);
+            map.put("storage_lock", this.storageLock == null ? false : this.storageLock);
+            map.put("empty", this.empty == null ? false : this.empty);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            map.put("currently_attached", this.currentlyAttached == null ? false : this.currentlyAttached);
+            map.put("status_code", this.statusCode == null ? 0 : this.statusCode);
+            map.put("status_detail", this.statusDetail == null ? "" : this.statusDetail);
+            map.put("runtime_properties", this.runtimeProperties == null ? new HashMap<String, String>() : this.runtimeProperties);
+            map.put("qos_algorithm_type", this.qosAlgorithmType == null ? "" : this.qosAlgorithmType);
+            map.put("qos_algorithm_params", this.qosAlgorithmParams == null ? new HashMap<String, String>() : this.qosAlgorithmParams);
+            map.put("qos_supported_algorithms", this.qosSupportedAlgorithms == null ? new LinkedHashSet<String>() : this.qosSupportedAlgorithms);
+            map.put("metrics", this.metrics == null ? new VBDMetrics("OpaqueRef:NULL") : this.metrics);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+         */
+        public Set<Types.VbdOperations> allowedOperations;
+        /**
+         * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+         */
+        public Map<String, Types.VbdOperations> currentOperations;
+        /**
+         * the virtual machine
+         */
+        public VM VM;
+        /**
+         * the virtual disk
+         */
+        public VDI VDI;
+        /**
+         * device seen by the guest e.g. hda1
+         */
+        public String device;
+        /**
+         * user-friendly device name e.g. 0,1,2,etc.
+         */
+        public String userdevice;
+        /**
+         * true if this VBD is bootable
+         */
+        public Boolean bootable;
+        /**
+         * the mode the VBD should be mounted with
+         */
+        public Types.VbdMode mode;
+        /**
+         * how the VBD will appear to the guest (e.g. disk or CD)
+         */
+        public Types.VbdType type;
+        /**
+         * true if this VBD will support hot-unplug
+         */
+        public Boolean unpluggable;
+        /**
+         * true if a storage level lock was acquired
+         */
+        public Boolean storageLock;
+        /**
+         * if true this represents an empty drive
+         */
+        public Boolean empty;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+        /**
+         * is the device currently attached (erased on reboot)
+         */
+        public Boolean currentlyAttached;
+        /**
+         * error/success code associated with last attach-operation (erased on reboot)
+         */
+        public Long statusCode;
+        /**
+         * error/success information associated with last attach-operation status (erased on reboot)
+         */
+        public String statusDetail;
+        /**
+         * Device runtime properties
+         */
+        public Map<String, String> runtimeProperties;
+        /**
+         * QoS algorithm to use
+         */
+        public String qosAlgorithmType;
+        /**
+         * parameters for chosen QoS algorithm
+         */
+        public Map<String, String> qosAlgorithmParams;
+        /**
+         * supported QoS algorithms for this VBD
+         */
+        public Set<String> qosSupportedAlgorithms;
+        /**
+         * metrics associated with this VBD
+         */
+        public VBDMetrics metrics;
+    }
+
+    /**
+     * Get a record containing the current state of the given VBD.
+     *
+     * @return all fields from the object
+     */
+    public VBD.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBDRecord(result);
+    }
+
+    /**
+     * Get a reference to the VBD instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VBD getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBD(result);
+    }
+
+    /**
+     * Create a new VBD instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return Task
+     */
+    public static Task createAsync(Connection c, VBD.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VBD.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Create a new VBD instance, and return its handle.
+     *
+     * @param record All constructor arguments
+     * @return reference to the newly created object
+     */
+    public static VBD create(Connection c, VBD.Record record) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.create";
+        String session = c.getSessionReference();
+        Map<String, Object> record_map = record.toMap();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBD(result);
+    }
+
+    /**
+     * Destroy the specified VBD instance.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VBD.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified VBD instance.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Get the uuid field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the allowed_operations field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Set<Types.VbdOperations> getAllowedOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_allowed_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVbdOperations(result);
+    }
+
+    /**
+     * Get the current_operations field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, Types.VbdOperations> getCurrentOperations(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_current_operations";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringVbdOperations(result);
+    }
+
+    /**
+     * Get the VM field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public VM getVM(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_VM";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVM(result);
+    }
+
+    /**
+     * Get the VDI field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public VDI getVDI(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_VDI";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVDI(result);
+    }
+
+    /**
+     * Get the device field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public String getDevice(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_device";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the userdevice field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public String getUserdevice(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_userdevice";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the bootable field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getBootable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_bootable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the mode field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Types.VbdMode getMode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVbdMode(result);
+    }
+
+    /**
+     * Get the type field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Types.VbdType getType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVbdType(result);
+    }
+
+    /**
+     * Get the unpluggable field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getUnpluggable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_unpluggable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the storage_lock field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getStorageLock(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_storage_lock";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the empty field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getEmpty(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_empty";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the other_config field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the currently_attached field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Boolean getCurrentlyAttached(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_currently_attached";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the status_code field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Long getStatusCode(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_status_code";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the status_detail field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public String getStatusDetail(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_status_detail";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the runtime_properties field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getRuntimeProperties(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_runtime_properties";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the qos/algorithm_type field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public String getQosAlgorithmType(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_qos_algorithm_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the qos/algorithm_params field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getQosAlgorithmParams(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Get the qos/supported_algorithms field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public Set<String> getQosSupportedAlgorithms(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_qos_supported_algorithms";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfString(result);
+    }
+
+    /**
+     * Get the metrics field of the given VBD.
+     *
+     * @return value of the field
+     */
+    public VBDMetrics getMetrics(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_metrics";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBDMetrics(result);
+    }
+
+    /**
+     * Set the userdevice field of the given VBD.
+     *
+     * @param userdevice New value to set
+     */
+    public void setUserdevice(Connection c, String userdevice) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_userdevice";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(userdevice)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the bootable field of the given VBD.
+     *
+     * @param bootable New value to set
+     */
+    public void setBootable(Connection c, Boolean bootable) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_bootable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(bootable)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the mode field of the given VBD.
+     *
+     * @param mode New value to set
+     */
+    public void setMode(Connection c, Types.VbdMode mode) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_mode";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(mode)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the type field of the given VBD.
+     *
+     * @param type New value to set
+     */
+    public void setType(Connection c, Types.VbdType type) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(type)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the unpluggable field of the given VBD.
+     *
+     * @param unpluggable New value to set
+     */
+    public void setUnpluggable(Connection c, Boolean unpluggable) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_unpluggable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(unpluggable)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the other_config field of the given VBD.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VBD.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VBD.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the qos/algorithm_type field of the given VBD.
+     *
+     * @param algorithmType New value to set
+     */
+    public void setQosAlgorithmType(Connection c, String algorithmType) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_qos_algorithm_type";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(algorithmType)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Set the qos/algorithm_params field of the given VBD.
+     *
+     * @param algorithmParams New value to set
+     */
+    public void setQosAlgorithmParams(Connection c, Map<String, String> algorithmParams) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.set_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(algorithmParams)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the qos/algorithm_params field of the given VBD.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToQosAlgorithmParams(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.add_to_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the qos/algorithm_params field of the given VBD.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromQosAlgorithmParams(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.remove_from_qos_algorithm_params";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the media from the device and leave it empty
+     *
+     * @return Task
+     */
+    public Task ejectAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VbdNotRemovableMedia,
+       Types.VbdIsEmpty {
+        String method_call = "Async.VBD.eject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Remove the media from the device and leave it empty
+     *
+     */
+    public void eject(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VbdNotRemovableMedia,
+       Types.VbdIsEmpty {
+        String method_call = "VBD.eject";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Insert new media into the device
+     *
+     * @param vdi The new VDI to 'insert'
+     * @return Task
+     */
+    public Task insertAsync(Connection c, VDI vdi) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VbdNotRemovableMedia,
+       Types.VbdNotEmpty {
+        String method_call = "Async.VBD.insert";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vdi)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Insert new media into the device
+     *
+     * @param vdi The new VDI to 'insert'
+     */
+    public void insert(Connection c, VDI vdi) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.VbdNotRemovableMedia,
+       Types.VbdNotEmpty {
+        String method_call = "VBD.insert";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vdi)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Hotplug the specified VBD, dynamically attaching it to the running VM
+     *
+     * @return Task
+     */
+    public Task plugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VBD.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Hotplug the specified VBD, dynamically attaching it to the running VM
+     *
+     */
+    public void plug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.plug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Hot-unplug the specified VBD, dynamically unattaching it from the running VM
+     *
+     * @return Task
+     */
+    public Task unplugAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.DeviceDetachRejected,
+       Types.DeviceAlreadyDetached {
+        String method_call = "Async.VBD.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Hot-unplug the specified VBD, dynamically unattaching it from the running VM
+     *
+     */
+    public void unplug(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException,
+       Types.DeviceDetachRejected,
+       Types.DeviceAlreadyDetached {
+        String method_call = "VBD.unplug";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Forcibly unplug the specified VBD
+     *
+     * @return Task
+     */
+    public Task unplugForceAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VBD.unplug_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Forcibly unplug the specified VBD
+     *
+     */
+    public void unplugForce(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.unplug_force";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Throws an error if this VBD could not be attached to this VM if the VM were running. Intended for debugging.
+     *
+     * @return Task
+     */
+    public Task assertAttachableAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.VBD.assert_attachable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Throws an error if this VBD could not be attached to this VM if the VM were running. Intended for debugging.
+     *
+     */
+    public void assertAttachable(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.assert_attachable";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VBDs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VBD> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVBD(result);
+    }
+
+    /**
+     * Return a map of VBD references to VBD records for all VBDs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VBD, VBD.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVBDVBDRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java
new file mode 100644
index 0000000..a58e5e0
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics associated with a virtual block device
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class VBDMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    VBDMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a VBDMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof VBDMetrics)
+        {
+            VBDMetrics other = (VBDMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a VBDMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "ioReadKbs", this.ioReadKbs);
+            print.printf("%1$20s: %2$s\n", "ioWriteKbs", this.ioWriteKbs);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a VBD_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("io_read_kbs", this.ioReadKbs == null ? 0.0 : this.ioReadKbs);
+            map.put("io_write_kbs", this.ioWriteKbs == null ? 0.0 : this.ioWriteKbs);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Read bandwidth (KiB/s)
+         */
+        public Double ioReadKbs;
+        /**
+         * Write bandwidth (KiB/s)
+         */
+        public Double ioWriteKbs;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given VBD_metrics.
+     *
+     * @return all fields from the object
+     */
+    public VBDMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBDMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the VBD_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static VBDMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toVBDMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given VBD_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the io/read_kbs field of the given VBD_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoReadKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_io_read_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the io/write_kbs field of the given VBD_metrics.
+     *
+     * @return value of the field
+     */
+    public Double getIoWriteKbs(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_io_write_kbs";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the last_updated field of the given VBD_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given VBD_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given VBD_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given VBD_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given VBD_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the VBD_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<VBDMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfVBDMetrics(result);
+    }
+
+    /**
+     * Return a map of VBD_metrics references to VBD_metrics records for all VBD_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<VBDMetrics, VBDMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "VBD_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfVBDMetricsVBDMetricsRecord(result);
+    }
+
+}
\ No newline at end of file


[16/19] Revert "Applied Tina's patches for removing the xapi jar"

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java
new file mode 100644
index 0000000..0f802f8
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java
@@ -0,0 +1,536 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * A physical CPU
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostCpu extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    HostCpu(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a HostCpu, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof HostCpu)
+        {
+            HostCpu other = (HostCpu) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a HostCpu
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "number", this.number);
+            print.printf("%1$20s: %2$s\n", "vendor", this.vendor);
+            print.printf("%1$20s: %2$s\n", "speed", this.speed);
+            print.printf("%1$20s: %2$s\n", "modelname", this.modelname);
+            print.printf("%1$20s: %2$s\n", "family", this.family);
+            print.printf("%1$20s: %2$s\n", "model", this.model);
+            print.printf("%1$20s: %2$s\n", "stepping", this.stepping);
+            print.printf("%1$20s: %2$s\n", "flags", this.flags);
+            print.printf("%1$20s: %2$s\n", "features", this.features);
+            print.printf("%1$20s: %2$s\n", "utilisation", this.utilisation);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a host_cpu.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("number", this.number == null ? 0 : this.number);
+            map.put("vendor", this.vendor == null ? "" : this.vendor);
+            map.put("speed", this.speed == null ? 0 : this.speed);
+            map.put("modelname", this.modelname == null ? "" : this.modelname);
+            map.put("family", this.family == null ? 0 : this.family);
+            map.put("model", this.model == null ? 0 : this.model);
+            map.put("stepping", this.stepping == null ? "" : this.stepping);
+            map.put("flags", this.flags == null ? "" : this.flags);
+            map.put("features", this.features == null ? "" : this.features);
+            map.put("utilisation", this.utilisation == null ? 0.0 : this.utilisation);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * the host the CPU is in
+         */
+        public Host host;
+        /**
+         * the number of the physical CPU within the host
+         */
+        public Long number;
+        /**
+         * the vendor of the physical CPU
+         */
+        public String vendor;
+        /**
+         * the speed of the physical CPU
+         */
+        public Long speed;
+        /**
+         * the model name of the physical CPU
+         */
+        public String modelname;
+        /**
+         * the family (number) of the physical CPU
+         */
+        public Long family;
+        /**
+         * the model number of the physical CPU
+         */
+        public Long model;
+        /**
+         * the stepping of the physical CPU
+         */
+        public String stepping;
+        /**
+         * the flags of the physical CPU (a decoded version of the features field)
+         */
+        public String flags;
+        /**
+         * the physical CPU feature bitmap
+         */
+        public String features;
+        /**
+         * the current CPU utilisation
+         */
+        public Double utilisation;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given host_cpu.
+     * @deprecated
+     *
+     * @return all fields from the object
+     */
+   @Deprecated public HostCpu.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostCpuRecord(result);
+    }
+
+    /**
+     * Get a reference to the host_cpu instance with the specified UUID.
+     * @deprecated
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+   @Deprecated public static HostCpu getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostCpu(result);
+    }
+
+    /**
+     * Get the uuid field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the number field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Long getNumber(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_number";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the vendor field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getVendor(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_vendor";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the speed field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Long getSpeed(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_speed";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the modelname field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getModelname(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_modelname";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the family field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Long getFamily(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_family";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the model field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Long getModel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_model";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the stepping field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getStepping(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_stepping";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the flags field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getFlags(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_flags";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the features field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public String getFeatures(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_features";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the utilisation field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Double getUtilisation(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_utilisation";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDouble(result);
+    }
+
+    /**
+     * Get the other_config field of the given host_cpu.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given host_cpu.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given host_cpu.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given host_cpu.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the host_cpus known to the system.
+     * @deprecated
+     *
+     * @return references to all objects
+     */
+   @Deprecated public static Set<HostCpu> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostCpu(result);
+    }
+
+    /**
+     * Return a map of host_cpu references to host_cpu records for all host_cpus known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<HostCpu, HostCpu.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_cpu.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfHostCpuHostCpuRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java
new file mode 100644
index 0000000..e93240e
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Represents a host crash dump
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostCrashdump extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    HostCrashdump(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a HostCrashdump, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof HostCrashdump)
+        {
+            HostCrashdump other = (HostCrashdump) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a HostCrashdump
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "timestamp", this.timestamp);
+            print.printf("%1$20s: %2$s\n", "size", this.size);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a host_crashdump.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("timestamp", this.timestamp == null ? new Date(0) : this.timestamp);
+            map.put("size", this.size == null ? 0 : this.size);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Host the crashdump relates to
+         */
+        public Host host;
+        /**
+         * Time the crash happened
+         */
+        public Date timestamp;
+        /**
+         * Size of the crashdump
+         */
+        public Long size;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given host_crashdump.
+     *
+     * @return all fields from the object
+     */
+    public HostCrashdump.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostCrashdumpRecord(result);
+    }
+
+    /**
+     * Get a reference to the host_crashdump instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static HostCrashdump getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostCrashdump(result);
+    }
+
+    /**
+     * Get the uuid field of the given host_crashdump.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host field of the given host_crashdump.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the timestamp field of the given host_crashdump.
+     *
+     * @return value of the field
+     */
+    public Date getTimestamp(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_timestamp";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the size field of the given host_crashdump.
+     *
+     * @return value of the field
+     */
+    public Long getSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the other_config field of the given host_crashdump.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given host_crashdump.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given host_crashdump.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given host_crashdump.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Destroy specified host crash dump, removing it from the disk.
+     *
+     * @return Task
+     */
+    public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host_crashdump.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy specified host crash dump, removing it from the disk.
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Upload the specified host crash dump to a specified URL
+     *
+     * @param url The URL to upload to
+     * @param options Extra configuration operations
+     * @return Task
+     */
+    public Task uploadAsync(Connection c, String url, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host_crashdump.upload";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Upload the specified host crash dump to a specified URL
+     *
+     * @param url The URL to upload to
+     * @param options Extra configuration operations
+     */
+    public void upload(Connection c, String url, Map<String, String> options) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.upload";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the host_crashdumps known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<HostCrashdump> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostCrashdump(result);
+    }
+
+    /**
+     * Return a map of host_crashdump references to host_crashdump records for all host_crashdumps known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<HostCrashdump, HostCrashdump.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_crashdump.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfHostCrashdumpHostCrashdumpRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java
new file mode 100644
index 0000000..261933f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * The metrics associated with a host
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostMetrics extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    HostMetrics(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a HostMetrics, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof HostMetrics)
+        {
+            HostMetrics other = (HostMetrics) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a HostMetrics
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "memoryTotal", this.memoryTotal);
+            print.printf("%1$20s: %2$s\n", "memoryFree", this.memoryFree);
+            print.printf("%1$20s: %2$s\n", "live", this.live);
+            print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a host_metrics.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("memory_total", this.memoryTotal == null ? 0 : this.memoryTotal);
+            map.put("memory_free", this.memoryFree == null ? 0 : this.memoryFree);
+            map.put("live", this.live == null ? false : this.live);
+            map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * Total host memory (bytes)
+         */
+        public Long memoryTotal;
+        /**
+         * Free host memory (bytes)
+         */
+        public Long memoryFree;
+        /**
+         * Pool master thinks this host is live
+         */
+        public Boolean live;
+        /**
+         * Time at which this information was last updated
+         */
+        public Date lastUpdated;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given host_metrics.
+     *
+     * @return all fields from the object
+     */
+    public HostMetrics.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostMetricsRecord(result);
+    }
+
+    /**
+     * Get a reference to the host_metrics instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static HostMetrics getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostMetrics(result);
+    }
+
+    /**
+     * Get the uuid field of the given host_metrics.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the memory/total field of the given host_metrics.
+     *
+     * @return value of the field
+     */
+    public Long getMemoryTotal(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_memory_total";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the memory/free field of the given host_metrics.
+     * @deprecated
+     *
+     * @return value of the field
+     */
+   @Deprecated public Long getMemoryFree(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_memory_free";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the live field of the given host_metrics.
+     *
+     * @return value of the field
+     */
+    public Boolean getLive(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_live";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the last_updated field of the given host_metrics.
+     *
+     * @return value of the field
+     */
+    public Date getLastUpdated(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_last_updated";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the other_config field of the given host_metrics.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given host_metrics.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given host_metrics.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given host_metrics.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Return a list of all the host_metrics instances known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<HostMetrics> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostMetrics(result);
+    }
+
+    /**
+     * Return a map of host_metrics references to host_metrics records for all host_metrics instances known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<HostMetrics, HostMetrics.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_metrics.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfHostMetricsHostMetricsRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java
new file mode 100644
index 0000000..0f229dc
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * Represents a patch stored on a server
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostPatch extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    HostPatch(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a HostPatch, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof HostPatch)
+        {
+            HostPatch other = (HostPatch) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a HostPatch
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "nameLabel", this.nameLabel);
+            print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+            print.printf("%1$20s: %2$s\n", "version", this.version);
+            print.printf("%1$20s: %2$s\n", "host", this.host);
+            print.printf("%1$20s: %2$s\n", "applied", this.applied);
+            print.printf("%1$20s: %2$s\n", "timestampApplied", this.timestampApplied);
+            print.printf("%1$20s: %2$s\n", "size", this.size);
+            print.printf("%1$20s: %2$s\n", "poolPatch", this.poolPatch);
+            print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a host_patch.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+            map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+            map.put("version", this.version == null ? "" : this.version);
+            map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+            map.put("applied", this.applied == null ? false : this.applied);
+            map.put("timestamp_applied", this.timestampApplied == null ? new Date(0) : this.timestampApplied);
+            map.put("size", this.size == null ? 0 : this.size);
+            map.put("pool_patch", this.poolPatch == null ? new PoolPatch("OpaqueRef:NULL") : this.poolPatch);
+            map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * a human-readable name
+         */
+        public String nameLabel;
+        /**
+         * a notes field containing human-readable description
+         */
+        public String nameDescription;
+        /**
+         * Patch version number
+         */
+        public String version;
+        /**
+         * Host the patch relates to
+         */
+        public Host host;
+        /**
+         * True if the patch has been applied
+         */
+        public Boolean applied;
+        /**
+         * Time the patch was applied
+         */
+        public Date timestampApplied;
+        /**
+         * Size of the patch
+         */
+        public Long size;
+        /**
+         * The patch applied
+         */
+        public PoolPatch poolPatch;
+        /**
+         * additional configuration
+         */
+        public Map<String, String> otherConfig;
+    }
+
+    /**
+     * Get a record containing the current state of the given host_patch.
+     *
+     * @return all fields from the object
+     */
+    public HostPatch.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostPatchRecord(result);
+    }
+
+    /**
+     * Get a reference to the host_patch instance with the specified UUID.
+     *
+     * @param uuid UUID of object to return
+     * @return reference to the object
+     */
+    public static HostPatch getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHostPatch(result);
+    }
+
+    /**
+     * Get all the host_patch instances with the given label.
+     *
+     * @param label label of object to return
+     * @return references to objects with matching names
+     */
+    public static Set<HostPatch> getByNameLabel(Connection c, String label) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_by_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostPatch(result);
+    }
+
+    /**
+     * Get the uuid field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public String getUuid(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/label field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public String getNameLabel(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_name_label";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the name/description field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public String getNameDescription(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_name_description";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the version field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public String getVersion(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_version";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Get the host field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public Host getHost(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_host";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toHost(result);
+    }
+
+    /**
+     * Get the applied field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public Boolean getApplied(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_applied";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toBoolean(result);
+    }
+
+    /**
+     * Get the timestamp_applied field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public Date getTimestampApplied(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_timestamp_applied";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toDate(result);
+    }
+
+    /**
+     * Get the size field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public Long getSize(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_size";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toLong(result);
+    }
+
+    /**
+     * Get the pool_patch field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public PoolPatch getPoolPatch(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_pool_patch";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toPoolPatch(result);
+    }
+
+    /**
+     * Get the other_config field of the given host_patch.
+     *
+     * @return value of the field
+     */
+    public Map<String, String> getOtherConfig(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfStringString(result);
+    }
+
+    /**
+     * Set the other_config field of the given host_patch.
+     *
+     * @param otherConfig New value to set
+     */
+    public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.set_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Add the given key-value pair to the other_config field of the given host_patch.
+     *
+     * @param key Key to add
+     * @param value Value to add
+     */
+    public void addToOtherConfig(Connection c, String key, String value) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.add_to_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Remove the given key and its corresponding value from the other_config field of the given host_patch.  If the key is not in that Map, then do nothing.
+     *
+     * @param key Key to remove
+     */
+    public void removeFromOtherConfig(Connection c, String key) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.remove_from_other_config";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Destroy the specified host patch, removing it from the disk. This does NOT reverse the patch
+     * @deprecated
+     *
+     * @return Task
+     */
+   @Deprecated public Task destroyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host_patch.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Destroy the specified host patch, removing it from the disk. This does NOT reverse the patch
+     * @deprecated
+     *
+     */
+   @Deprecated public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * Apply the selected patch and return its output
+     * @deprecated
+     *
+     * @return Task
+     */
+   @Deprecated public Task applyAsync(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "Async.host_patch.apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+        return Types.toTask(result);
+    }
+
+    /**
+     * Apply the selected patch and return its output
+     * @deprecated
+     *
+     * @return the output of the patch application process
+     */
+   @Deprecated public String apply(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.apply";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toString(result);
+    }
+
+    /**
+     * Return a list of all the host_patchs known to the system.
+     *
+     * @return references to all objects
+     */
+    public static Set<HostPatch> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfHostPatch(result);
+    }
+
+    /**
+     * Return a map of host_patch references to host_patch records for all host_patchs known to the system.
+     *
+     * @return records of all objects
+     */
+    public static Map<HostPatch, HostPatch.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "host_patch.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfHostPatchHostPatchRecord(result);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Marshalling.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Marshalling.java b/deps/XenServerJava/src/com/xensource/xenapi/Marshalling.java
new file mode 100755
index 0000000..b7483c1
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Marshalling.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+import java.util.*;
+
+/**
+ * Marshalls Java types onto the wire.
+ * Does not cope with records.  Use individual record.toMap()
+ */
+public final class Marshalling {
+    /**
+     * Converts Integers to Strings
+     * and Sets to Lists recursively.
+     */
+    public static Object toXMLRPC(Object o) {
+        if (o instanceof String ||
+            o instanceof Boolean ||
+            o instanceof Double ||
+            o instanceof Date) {
+            return o;
+	} else if (o instanceof Long) {
+	    return o.toString();
+        } else if (o instanceof Map) {
+            Map<Object, Object> result = new HashMap<Object, Object>();
+            Map m = (Map)o;
+            for (Object k : m.keySet())
+            {
+                result.put(toXMLRPC(k), toXMLRPC(m.get(k)));
+            }
+            return result;
+        } else if (o instanceof Set) {
+            List<Object> result = new ArrayList<Object>();
+            for (Object e : ((Set)o))
+            {
+                result.add(toXMLRPC(e));
+            }
+            return result;
+	} else if (o instanceof XenAPIObject) {
+	    return ((XenAPIObject) o).toWireString();
+	} else if (o instanceof Enum) {
+	    return o.toString();
+	}else if (o == null){
+	    return "";
+        } else {
+		throw new RuntimeException ("=============don't know how to marshall:({[" + o + "]})");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec102ec9/deps/XenServerJava/src/com/xensource/xenapi/Message.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Message.java b/deps/XenServerJava/src/com/xensource/xenapi/Message.java
new file mode 100644
index 0000000..8cb4127
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Message.java
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   1) Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ * 
+ *   2) Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+package com.xensource.xenapi;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VersionException;
+import com.xensource.xenapi.Types.XenAPIException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xmlrpc.XmlRpcException;
+
+/**
+ * An message for the attention of the administrator
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Message extends XenAPIObject {
+
+    /**
+     * The XenAPI reference (OpaqueRef) to this object.
+     */
+    protected final String ref;
+
+    /**
+     * For internal use only.
+     */
+    Message(String ref) {
+       this.ref = ref;
+    }
+
+    /**
+     * @return The XenAPI reference (OpaqueRef) to this object.
+     */
+    public String toWireString() {
+       return this.ref;
+    }
+
+    /**
+     * If obj is a Message, compares XenAPI references for equality.
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj != null && obj instanceof Message)
+        {
+            Message other = (Message) obj;
+            return other.ref.equals(this.ref);
+        } else
+        {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return ref.hashCode();
+    }
+
+    /**
+     * Represents all the fields in a Message
+     */
+    public static class Record implements Types.Record {
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            PrintWriter print = new PrintWriter(writer);
+            print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
+            print.printf("%1$20s: %2$s\n", "name", this.name);
+            print.printf("%1$20s: %2$s\n", "priority", this.priority);
+            print.printf("%1$20s: %2$s\n", "cls", this.cls);
+            print.printf("%1$20s: %2$s\n", "objUuid", this.objUuid);
+            print.printf("%1$20s: %2$s\n", "timestamp", this.timestamp);
+            print.printf("%1$20s: %2$s\n", "body", this.body);
+            return writer.toString();
+        }
+
+        /**
+         * Convert a message.Record to a Map
+         */
+        public Map<String,Object> toMap() {
+            Map<String,Object> map = new HashMap<String,Object>();
+            map.put("uuid", this.uuid == null ? "" : this.uuid);
+            map.put("name", this.name == null ? "" : this.name);
+            map.put("priority", this.priority == null ? 0 : this.priority);
+            map.put("cls", this.cls == null ? Types.Cls.UNRECOGNIZED : this.cls);
+            map.put("obj_uuid", this.objUuid == null ? "" : this.objUuid);
+            map.put("timestamp", this.timestamp == null ? new Date(0) : this.timestamp);
+            map.put("body", this.body == null ? "" : this.body);
+            return map;
+        }
+
+        /**
+         * Unique identifier/object reference
+         */
+        public String uuid;
+        /**
+         * The name of the message
+         */
+        public String name;
+        /**
+         * The message priority, 0 being low priority
+         */
+        public Long priority;
+        /**
+         * The class of the object this message is associated with
+         */
+        public Types.Cls cls;
+        /**
+         * The uuid of the object this message is associated with
+         */
+        public String objUuid;
+        /**
+         * The time at which the message was created
+         */
+        public Date timestamp;
+        /**
+         * The body of the message
+         */
+        public String body;
+    }
+
+    /**
+     * 
+     *
+     * @param name The name of the message
+     * @param priority The priority of the message
+     * @param cls The class of object this message is associated with
+     * @param objUuid The uuid of the object this message is associated with
+     * @param body The body of the message
+     * @return The reference of the created message
+     */
+    public static Message create(Connection c, String name, Long priority, Types.Cls cls, String objUuid, String body) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.create";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(priority), Marshalling.toXMLRPC(cls), Marshalling.toXMLRPC(objUuid), Marshalling.toXMLRPC(body)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMessage(result);
+    }
+
+    /**
+     * 
+     *
+     */
+    public void destroy(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.destroy";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        return;
+    }
+
+    /**
+     * 
+     *
+     * @param cls The class of object
+     * @param objUuid The uuid of the object
+     * @param since The cutoff time
+     * @return The relevant messages
+     */
+    public static Map<Message, Message.Record> get(Connection c, Types.Cls cls, String objUuid, Date since) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(cls), Marshalling.toXMLRPC(objUuid), Marshalling.toXMLRPC(since)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfMessageMessageRecord(result);
+    }
+
+    /**
+     * 
+     *
+     * @return The references to the messages
+     */
+    public static Set<Message> getAll(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_all";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toSetOfMessage(result);
+    }
+
+    /**
+     * 
+     *
+     * @param since The cutoff time
+     * @return The relevant messages
+     */
+    public static Map<Message, Message.Record> getSince(Connection c, Date since) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_since";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(since)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfMessageMessageRecord(result);
+    }
+
+    /**
+     * 
+     *
+     * @return The message record
+     */
+    public Message.Record getRecord(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_record";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMessageRecord(result);
+    }
+
+    /**
+     * 
+     *
+     * @param uuid The uuid of the message
+     * @return The message reference
+     */
+    public static Message getByUuid(Connection c, String uuid) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_by_uuid";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMessage(result);
+    }
+
+    /**
+     * 
+     *
+     * @return The messages
+     */
+    public static Map<Message, Message.Record> getAllRecords(Connection c) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_all_records";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfMessageMessageRecord(result);
+    }
+
+    /**
+     * 
+     *
+     * @param expr The expression to match (not currently used)
+     * @return The messages
+     */
+    public static Map<Message, Message.Record> getAllRecordsWhere(Connection c, String expr) throws
+       BadServerResponse,
+       XenAPIException,
+       XmlRpcException {
+        String method_call = "message.get_all_records_where";
+        String session = c.getSessionReference();
+        Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(expr)};
+        Map response = c.dispatch(method_call, method_params);
+        Object result = response.get("Value");
+            return Types.toMapOfMessageMessageRecord(result);
+    }
+
+}
\ No newline at end of file