CLOUDSTACK-6058: New XenServer 6.2sp1 SDKs

This commit replaces old XenServer SDKs with lastet XenServer release
i.e. 6.2sp1 SDKs. This SDK also includes new class "VGPU" to support
vGPU functionality in XenServer.

Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
This commit is contained in:
Sanjay Tripathi 2014-01-22 16:15:52 +05:30 committed by Hugo Trippaers
parent d1efdca506
commit 2ff9abadf6
54 changed files with 16366 additions and 15149 deletions

201
deps/XenServerJava/src/LICENSE.Apache-2.0.txt vendored Executable file
View File

@ -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.

26
deps/XenServerJava/src/LICENSE.txt vendored Executable file
View File

@ -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.

57
deps/XenServerJava/src/README.txt vendored Executable file
View File

@ -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/.

73
deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java vendored Normal file → Executable file
View File

@ -1,18 +1,19 @@
/* Copyright (c) Citrix Systems, Inc.
/*
* 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
@ -31,16 +32,24 @@ 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, UNKNOWN;
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_1_10;
return API_2_1;
}
public static APIVersion fromMajorMinor(long major, long minor)
{
if (major == 1 && minor == 10)
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;
}
@ -91,28 +100,32 @@ public enum APIVersion
{
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";
default:
return "Unknown";
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";
}
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -51,6 +52,7 @@ import org.apache.xmlrpc.XmlRpcException;
*/
public class Auth extends XenAPIObject {
public String toWireString() {
return null;
}
@ -62,15 +64,15 @@ public class Auth extends XenAPIObject {
* @return the subject_identifier obtained from the external directory service
*/
public static String getSubjectIdentifier(Connection c, String subjectName) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -80,15 +82,15 @@ public class Auth extends XenAPIObject {
* @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 {
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);
return Types.toMapOfStringString(result);
}
/**
@ -98,15 +100,15 @@ public class Auth extends XenAPIObject {
* @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 {
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);
return Types.toSetOfString(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Blob extends XenAPIObject {
* For internal use only.
*/
Blob(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Blob extends XenAPIObject {
{
if (obj != null && obj instanceof Blob)
{
Blob other = (Blob)obj;
Blob other = (Blob) obj;
return other.ref.equals(this.ref);
} else
{
@ -112,8 +113,8 @@ public class Blob extends XenAPIObject {
/**
* Convert a blob.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -160,15 +161,15 @@ public class Blob extends XenAPIObject {
* @return all fields from the object
*/
public Blob.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBlobRecord(result);
}
/**
@ -178,15 +179,15 @@ public class Blob extends XenAPIObject {
* @return reference to the object
*/
public static Blob getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBlob(result);
}
/**
@ -196,15 +197,15 @@ public class Blob extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<Blob> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfBlob(result);
}
/**
@ -213,15 +214,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -230,15 +231,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -247,15 +248,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -264,15 +265,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public Long getSize(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -281,15 +282,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public Boolean getPublic(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -298,15 +299,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -315,15 +316,15 @@ public class Blob extends XenAPIObject {
* @return value of the field
*/
public String getMimeType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -332,9 +333,9 @@ public class Blob extends XenAPIObject {
* @param label New value to set
*/
public void setNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -348,9 +349,9 @@ public class Blob extends XenAPIObject {
* @param description New value to set
*/
public void setNameDescription(Connection c, String description) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -364,9 +365,9 @@ public class Blob extends XenAPIObject {
* @param _public New value to set
*/
public void setPublic(Connection c, Boolean _public) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -382,25 +383,25 @@ public class Blob extends XenAPIObject {
* @return The reference to the created blob
*/
public static Blob create(Connection c, String mimeType, Boolean _public) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBlob(result);
}
/**
*
*
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "blob.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -414,15 +415,15 @@ public class Blob extends XenAPIObject {
* @return references to all objects
*/
public static Set<Blob> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfBlob(result);
}
/**
@ -431,15 +432,15 @@ public class Blob extends XenAPIObject {
* @return records of all objects
*/
public static Map<Blob, Blob.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfBlobBlobRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -45,7 +46,7 @@ import java.util.Set;
import org.apache.xmlrpc.XmlRpcException;
/**
*
*
*
* @author Citrix Systems, Inc.
*/
@ -60,14 +61,14 @@ public class Bond extends XenAPIObject {
* For internal use only.
*/
Bond(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Bond extends XenAPIObject {
{
if (obj != null && obj instanceof Bond)
{
Bond other = (Bond)obj;
Bond other = (Bond) obj;
return other.ref.equals(this.ref);
} else
{
@ -113,8 +114,8 @@ public class Bond extends XenAPIObject {
/**
* Convert a Bond.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -166,15 +167,15 @@ public class Bond extends XenAPIObject {
* @return all fields from the object
*/
public Bond.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBondRecord(result);
}
/**
@ -184,15 +185,15 @@ public class Bond extends XenAPIObject {
* @return reference to the object
*/
public static Bond getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBond(result);
}
/**
@ -201,15 +202,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -218,15 +219,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public PIF getMaster(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -235,15 +236,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public Set<PIF> getSlaves(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfPIF(result);
}
/**
@ -252,15 +253,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -269,15 +270,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public PIF getPrimarySlave(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -286,15 +287,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public Types.BondMode getMode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBondMode(result);
}
/**
@ -303,15 +304,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getProperties(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -320,15 +321,15 @@ public class Bond extends XenAPIObject {
* @return value of the field
*/
public Long getLinksUp(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -337,9 +338,9 @@ public class Bond extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -354,9 +355,9 @@ public class Bond extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -370,9 +371,9 @@ public class Bond extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -391,13 +392,12 @@ public class Bond extends XenAPIObject {
* @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 {
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)};
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);
@ -414,16 +414,15 @@ public class Bond extends XenAPIObject {
* @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 {
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)};
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);
return Types.toBond(result);
}
/**
@ -432,9 +431,9 @@ public class Bond extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.Bond.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -448,9 +447,9 @@ public class Bond extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Bond.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -465,9 +464,9 @@ public class Bond extends XenAPIObject {
* @return Task
*/
public Task setModeAsync(Connection c, Types.BondMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -482,9 +481,9 @@ public class Bond extends XenAPIObject {
* @param value The new bond mode
*/
public void setMode(Connection c, Types.BondMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -500,9 +499,9 @@ public class Bond extends XenAPIObject {
* @return Task
*/
public Task setPropertyAsync(Connection c, String name, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -518,9 +517,9 @@ public class Bond extends XenAPIObject {
* @param value The property value
*/
public void setProperty(Connection c, String name, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -534,15 +533,15 @@ public class Bond extends XenAPIObject {
* @return references to all objects
*/
public static Set<Bond> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfBond(result);
}
/**
@ -551,15 +550,15 @@ public class Bond extends XenAPIObject {
* @return records of all objects
*/
public static Map<Bond, Bond.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfBondBondRecord(result);
}
}

128
deps/XenServerJava/src/com/xensource/xenapi/Connection.java vendored Normal file → Executable file
View File

@ -1,18 +1,19 @@
/* Copyright (c) Citrix Systems, Inc.
/*
* 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
@ -38,7 +39,6 @@ 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 org.apache.xmlrpc.client.XmlRpcSun15HttpTransportFactory;
import com.xensource.xenapi.Types.BadServerResponse;
import com.xensource.xenapi.Types.SessionAuthenticationFailed;
@ -54,20 +54,10 @@ public class Connection
/**
* The version of the bindings that this class belongs to.
*/
public static final String BINDINGS_VERSION = "6.1.0-1";
/**
* true if the connection is to the Rio edition of XenServer. Certain function calls are not allowed.
*
* @deprecated Use getAPIVersion() instead.
*/
@Deprecated
public Boolean rioConnection = false;
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.
*/
@ -91,47 +81,37 @@ public class Connection
/**
* 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
XmlRpcException, BadServerResponse, SessionAuthenticationFailed, XenAPIException
{
deprecatedConstructorUsed = true;
// To login normally we call login_with_password(username, password, "1.X"). On rio this call fails and we
// should use login_with_password(username,password) instead, and note that we are talking to a rio host so that we
// can refuse to make certain miami-specific calls
final String ApiVersion = APIVersion.latest().toString();
this.client = getClientFromURL(new URL(client));
try
{
//first try to login the modern way
this.sessionReference = loginWithPassword(this.client, username, password, ApiVersion);
} catch (BadServerResponse e)
{
//oops, something went wrong
String[] errDesc = e.errorDescription;
//was the problem that the host was running rio? If so it will have complained that it got three parameters
//instead of two. Let us carefully verify the details of this complaint
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"))
&& 0 == errDesc[1].compareTo("session.login_with_password")
&& 0 == errDesc[2].compareTo("2")
&& 0 == errDesc[3].compareTo("3"))
{
//and if so, we can have another go, using the older login method, and see how that goes.
this.sessionReference = loginWithPassword(this.client, username, password);
//success!. Note that we are talking to an old host on this connection
this.rioConnection = true;
} else
{
//Hmm... Can't solve this here. Let upstairs know about the problem.
throw e;
}
}
@ -139,11 +119,13 @@ public class Connection
try
{
setAPIVersion(new Session(sessionReference));
} catch (XenAPIException exn)
}
catch (XenAPIException exn)
{
dispose();
throw exn;
} catch (XmlRpcException exn)
}
catch (XmlRpcException exn)
{
dispose();
throw exn;
@ -153,24 +135,24 @@ public class Connection
/**
* 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)
public Connection(URL url)
{
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
@ -206,11 +188,12 @@ public class Connection
if (sessionReference != null)
{
String method_call = "session.logout";
Object[] method_params = {Marshalling.toXMLRPC(this.sessionReference)};
Object[] method_params = { Marshalling.toXMLRPC(this.sessionReference) };
client.execute(method_call, method_params);
sessionReference = null;
}
} catch (XmlRpcException exn)
}
catch (XmlRpcException exn)
{
}
}
@ -220,17 +203,17 @@ public class Connection
*/
@Deprecated
private static String loginWithPassword(XmlRpcClient client, String username, String password)
throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
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);
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");
return (String) response.get("Value");
} else if (response.get("Status").equals("Failure"))
{
Object[] error = (Object[])response.get("ErrorDescription");
Object[] error = (Object[]) response.get("ErrorDescription");
if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
{
throw new SessionAuthenticationFailed();
@ -244,18 +227,18 @@ public class Connection
*/
@Deprecated
private static String loginWithPassword(XmlRpcClient client, String username, String password, String ApiVersion)
throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
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);
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");
return (String) response.get("Value");
} else if (response.get("Status").equals("Failure"))
{
Object[] error = (Object[])response.get("ErrorDescription");
Object[] error = (Object[]) response.get("ErrorDescription");
if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
{
throw new SessionAuthenticationFailed();
@ -268,22 +251,19 @@ public class Connection
public XmlRpcClientConfigImpl getConfig()
{
return config;
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
* 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
@ -296,9 +276,9 @@ public class Connection
/**
* 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 dispatch(String method_call, Object[] method_params) throws XmlRpcException, XenAPIException
{
Map response = (Map)client.execute(method_call, method_params);
Map response = (Map) client.execute(method_call, method_params);
if (!deprecatedConstructorUsed)
{
@ -314,7 +294,7 @@ public class Connection
setAPIVersion(session);
}
else if (method_call.equals("session.slave_local_login_with_password") &&
response.get("Status").equals("Success"))
response.get("Status").equals("Success"))
{
// Store the Session reference and assume the latest API version.
sessionReference = Types.toSession(response.get("Value")).ref;
@ -329,7 +309,7 @@ public class Connection
// this session from the master instead.
if (response.get("Status").equals("Failure"))
{
Object[] error = (Object[])response.get("ErrorDescription");
Object[] error = (Object[]) response.get("ErrorDescription");
if (error.length == 2 && error[0].equals("HOST_IS_SLAVE"))
{
try
@ -338,18 +318,20 @@ public class Connection
((XmlRpcHttpClientConfig)client.getClientConfig()).getServerURL();
Connection tmp_conn =
new Connection(new URL(client_url.getProtocol(),
(String)error[1],
client_url.getPort(),
client_url.getFile()), _wait);
(String)error[1],
client_url.getPort(),
client_url.getFile()));
tmp_conn.sessionReference = sessionReference;
try
{
Session.logout(tmp_conn);
} finally
}
finally
{
tmp_conn.dispose();
}
} catch (Exception exn2)
}
catch (Exception exn2)
{
// Ignore -- we're going to throw HostIsSlave anyway.
}
@ -364,6 +346,7 @@ public class Connection
return Types.checkResponse(response);
}
private void setAPIVersion(Session session) throws XenAPIException, XmlRpcException
{
try
@ -371,9 +354,10 @@ public class Connection
long major = session.getThisHost(this).getAPIVersionMajor(this);
long minor = session.getThisHost(this).getAPIVersionMinor(this);
apiVersion = APIVersion.fromMajorMinor(major, minor);
} catch (BadServerResponse exn)
}
catch (BadServerResponse exn)
{
apiVersion = APIVersion.API_1_1;
apiVersion = APIVersion.UNKNOWN;
}
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Console extends XenAPIObject {
* For internal use only.
*/
Console(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Console extends XenAPIObject {
{
if (obj != null && obj instanceof Console)
{
Console other = (Console)obj;
Console other = (Console) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class Console extends XenAPIObject {
/**
* Convert a console.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class Console extends XenAPIObject {
* @return all fields from the object
*/
public Console.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toConsoleRecord(result);
}
/**
@ -166,15 +167,15 @@ public class Console extends XenAPIObject {
* @return reference to the object
*/
public static Console getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toConsole(result);
}
/**
@ -184,9 +185,9 @@ public class Console extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, Console.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.console.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -203,16 +204,16 @@ public class Console extends XenAPIObject {
* @return reference to the newly created object
*/
public static Console create(Connection c, Console.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toConsole(result);
}
/**
@ -221,9 +222,9 @@ public class Console extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.console.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -237,9 +238,9 @@ public class Console extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "console.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -253,15 +254,15 @@ public class Console extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -270,15 +271,15 @@ public class Console extends XenAPIObject {
* @return value of the field
*/
public Types.ConsoleProtocol getProtocol(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toConsoleProtocol(result);
}
/**
@ -287,15 +288,15 @@ public class Console extends XenAPIObject {
* @return value of the field
*/
public String getLocation(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -304,15 +305,15 @@ public class Console extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -321,15 +322,15 @@ public class Console extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -338,9 +339,9 @@ public class Console extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -355,9 +356,9 @@ public class Console extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -371,9 +372,9 @@ public class Console extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -387,15 +388,15 @@ public class Console extends XenAPIObject {
* @return references to all objects
*/
public static Set<Console> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfConsole(result);
}
/**
@ -404,15 +405,15 @@ public class Console extends XenAPIObject {
* @return records of all objects
*/
public static Map<Console, Console.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfConsoleConsoleRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Crashdump extends XenAPIObject {
* For internal use only.
*/
Crashdump(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Crashdump extends XenAPIObject {
{
if (obj != null && obj instanceof Crashdump)
{
Crashdump other = (Crashdump)obj;
Crashdump other = (Crashdump) obj;
return other.ref.equals(this.ref);
} else
{
@ -109,8 +110,8 @@ public class Crashdump extends XenAPIObject {
/**
* Convert a crashdump.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -142,15 +143,15 @@ public class Crashdump extends XenAPIObject {
* @return all fields from the object
*/
public Crashdump.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toCrashdumpRecord(result);
}
/**
@ -160,15 +161,15 @@ public class Crashdump extends XenAPIObject {
* @return reference to the object
*/
public static Crashdump getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toCrashdump(result);
}
/**
@ -177,15 +178,15 @@ public class Crashdump extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -194,15 +195,15 @@ public class Crashdump extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -211,15 +212,15 @@ public class Crashdump extends XenAPIObject {
* @return value of the field
*/
public VDI getVDI(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVDI(result);
}
/**
@ -228,15 +229,15 @@ public class Crashdump extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -245,9 +246,9 @@ public class Crashdump extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -262,9 +263,9 @@ public class Crashdump extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -278,9 +279,9 @@ public class Crashdump extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -294,9 +295,9 @@ public class Crashdump extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.crashdump.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -310,9 +311,9 @@ public class Crashdump extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "crashdump.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -326,15 +327,15 @@ public class Crashdump extends XenAPIObject {
* @return references to all objects
*/
public static Set<Crashdump> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfCrashdump(result);
}
/**
@ -343,15 +344,15 @@ public class Crashdump extends XenAPIObject {
* @return records of all objects
*/
public static Map<Crashdump, Crashdump.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfCrashdumpCrashdumpRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class DRTask extends XenAPIObject {
* For internal use only.
*/
DRTask(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class DRTask extends XenAPIObject {
{
if (obj != null && obj instanceof DRTask)
{
DRTask other = (DRTask)obj;
DRTask other = (DRTask) obj;
return other.ref.equals(this.ref);
} else
{
@ -107,8 +108,8 @@ public class DRTask extends XenAPIObject {
/**
* Convert a DR_task.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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;
@ -130,15 +131,15 @@ public class DRTask extends XenAPIObject {
* @return all fields from the object
*/
public DRTask.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDRTaskRecord(result);
}
/**
@ -148,15 +149,15 @@ public class DRTask extends XenAPIObject {
* @return reference to the object
*/
public static DRTask getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDRTask(result);
}
/**
@ -165,15 +166,15 @@ public class DRTask extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -182,15 +183,15 @@ public class DRTask extends XenAPIObject {
* @return value of the field
*/
public Set<SR> getIntroducedSRs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfSR(result);
}
/**
@ -202,9 +203,9 @@ public class DRTask extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, String type, Map<String, String> deviceConfig, Set<String> whitelist) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -222,15 +223,15 @@ public class DRTask extends XenAPIObject {
* @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 {
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);
return Types.toDRTask(result);
}
/**
@ -239,9 +240,9 @@ public class DRTask extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.DR_task.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -255,9 +256,9 @@ public class DRTask extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "DR_task.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -271,15 +272,15 @@ public class DRTask extends XenAPIObject {
* @return references to all objects
*/
public static Set<DRTask> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfDRTask(result);
}
/**
@ -288,15 +289,15 @@ public class DRTask extends XenAPIObject {
* @return records of all objects
*/
public static Map<DRTask, DRTask.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfDRTaskDRTaskRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class DataSource extends XenAPIObject {
* For internal use only.
*/
DataSource(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class DataSource extends XenAPIObject {
{
if (obj != null && obj instanceof DataSource)
{
DataSource other = (DataSource)obj;
DataSource other = (DataSource) obj;
return other.ref.equals(this.ref);
} else
{
@ -113,8 +114,8 @@ public class DataSource extends XenAPIObject {
/**
* Convert a data_source.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Event extends XenAPIObject {
* For internal use only.
*/
Event(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Event extends XenAPIObject {
{
if (obj != null && obj instanceof Event)
{
Event other = (Event)obj;
Event other = (Event) obj;
return other.ref.equals(this.ref);
} else
{
@ -112,8 +113,8 @@ public class Event extends XenAPIObject {
/**
* Convert a event.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -162,9 +163,9 @@ public class Event extends XenAPIObject {
* @return Task
*/
public static Task registerAsync(Connection c, Set<String> classes) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.event.register";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
@ -179,9 +180,9 @@ public class Event extends XenAPIObject {
* @param classes register for events for the indicated classes
*/
public static void register(Connection c, Set<String> classes) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "event.register";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
@ -196,9 +197,9 @@ public class Event extends XenAPIObject {
* @return Task
*/
public static Task unregisterAsync(Connection c, Set<String> classes) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.event.unregister";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
@ -213,9 +214,9 @@ public class Event extends XenAPIObject {
* @param classes remove this session's registration for the indicated classes
*/
public static void unregister(Connection c, Set<String> classes) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "event.unregister";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
@ -229,17 +230,17 @@ public class Event extends XenAPIObject {
* @return the batch of events
*/
public static Set<Event.Record> next(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SessionNotRegistered,
Types.EventsLost {
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);
return Types.toSetOfEventRecord(result);
}
/**
@ -251,17 +252,17 @@ public class Event extends XenAPIObject {
* @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 {
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 Types.toSetOfEventRecord(result);
}
/**
@ -270,15 +271,15 @@ public class Event extends XenAPIObject {
* @return the event ID
*/
public static Long getCurrentId(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -289,30 +290,15 @@ public class Event extends XenAPIObject {
* @return the event ID
*/
public static String inject(Connection c, String clazz, String ref) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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;
return Types.toString(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class GPUGroup extends XenAPIObject {
* For internal use only.
*/
GPUGroup(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class GPUGroup extends XenAPIObject {
{
if (obj != null && obj instanceof GPUGroup)
{
GPUGroup other = (GPUGroup)obj;
GPUGroup other = (GPUGroup) obj;
return other.ref.equals(this.ref);
} else
{
@ -106,14 +107,17 @@ public class GPUGroup extends XenAPIObject {
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>();
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);
@ -121,6 +125,9 @@ public class GPUGroup extends XenAPIObject {
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;
}
@ -152,6 +159,18 @@ public class GPUGroup extends XenAPIObject {
* 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;
}
/**
@ -160,15 +179,15 @@ public class GPUGroup extends XenAPIObject {
* @return all fields from the object
*/
public GPUGroup.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toGPUGroupRecord(result);
}
/**
@ -178,15 +197,15 @@ public class GPUGroup extends XenAPIObject {
* @return reference to the object
*/
public static GPUGroup getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toGPUGroup(result);
}
/**
@ -196,15 +215,15 @@ public class GPUGroup extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<GPUGroup> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfGPUGroup(result);
}
/**
@ -213,15 +232,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -230,15 +249,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -247,15 +266,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -264,15 +283,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public Set<PGPU> getPGPUs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfPGPU(result);
}
/**
@ -281,15 +300,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public Set<VGPU> getVGPUs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVGPU(result);
}
/**
@ -298,15 +317,15 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public Set<String> getGPUTypes(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -315,15 +334,66 @@ public class GPUGroup extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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);
}
/**
@ -332,9 +402,9 @@ public class GPUGroup extends XenAPIObject {
* @param label New value to set
*/
public void setNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -348,9 +418,9 @@ public class GPUGroup extends XenAPIObject {
* @param description New value to set
*/
public void setNameDescription(Connection c, String description) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -364,9 +434,9 @@ public class GPUGroup extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -381,9 +451,9 @@ public class GPUGroup extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -397,9 +467,9 @@ public class GPUGroup extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -407,21 +477,145 @@ public class GPUGroup extends XenAPIObject {
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 {
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 Types.toSetOfGPUGroup(result);
}
/**
@ -430,15 +624,15 @@ public class GPUGroup extends XenAPIObject {
* @return records of all objects
*/
public static Map<GPUGroup, GPUGroup.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfGPUGroupGPUGroupRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class HostCpu extends XenAPIObject {
* For internal use only.
*/
HostCpu(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class HostCpu extends XenAPIObject {
{
if (obj != null && obj instanceof HostCpu)
{
HostCpu other = (HostCpu)obj;
HostCpu other = (HostCpu) obj;
return other.ref.equals(this.ref);
} else
{
@ -118,8 +119,8 @@ public class HostCpu extends XenAPIObject {
/**
* Convert a host_cpu.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -196,17 +197,16 @@ public class HostCpu extends XenAPIObject {
*
* @return all fields from the object
*/
@Deprecated
public HostCpu.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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);
return Types.toHostCpuRecord(result);
}
/**
@ -216,17 +216,16 @@ public class HostCpu extends XenAPIObject {
* @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 {
@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);
return Types.toHostCpu(result);
}
/**
@ -235,15 +234,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -252,15 +251,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -269,15 +268,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Long getNumber(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -286,15 +285,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getVendor(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -303,15 +302,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Long getSpeed(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -320,15 +319,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getModelname(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -337,15 +336,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Long getFamily(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -354,15 +353,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Long getModel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -371,15 +370,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getStepping(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -388,15 +387,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getFlags(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -405,15 +404,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public String getFeatures(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -422,15 +421,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Double getUtilisation(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -439,15 +438,15 @@ public class HostCpu extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -456,9 +455,9 @@ public class HostCpu extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -473,9 +472,9 @@ public class HostCpu extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -489,9 +488,9 @@ public class HostCpu extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -505,17 +504,16 @@ public class HostCpu extends XenAPIObject {
*
* @return references to all objects
*/
@Deprecated
public static Set<HostCpu> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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 Types.toSetOfHostCpu(result);
}
/**
@ -524,15 +522,15 @@ public class HostCpu extends XenAPIObject {
* @return records of all objects
*/
public static Map<HostCpu, HostCpu.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfHostCpuHostCpuRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class HostCrashdump extends XenAPIObject {
* For internal use only.
*/
HostCrashdump(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class HostCrashdump extends XenAPIObject {
{
if (obj != null && obj instanceof HostCrashdump)
{
HostCrashdump other = (HostCrashdump)obj;
HostCrashdump other = (HostCrashdump) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class HostCrashdump extends XenAPIObject {
/**
* Convert a host_crashdump.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class HostCrashdump extends XenAPIObject {
* @return all fields from the object
*/
public HostCrashdump.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostCrashdumpRecord(result);
}
/**
@ -166,15 +167,15 @@ public class HostCrashdump extends XenAPIObject {
* @return reference to the object
*/
public static HostCrashdump getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostCrashdump(result);
}
/**
@ -183,15 +184,15 @@ public class HostCrashdump extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +201,15 @@ public class HostCrashdump extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -217,15 +218,15 @@ public class HostCrashdump extends XenAPIObject {
* @return value of the field
*/
public Date getTimestamp(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -234,15 +235,15 @@ public class HostCrashdump extends XenAPIObject {
* @return value of the field
*/
public Long getSize(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -251,15 +252,15 @@ public class HostCrashdump extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -268,9 +269,9 @@ public class HostCrashdump extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +286,9 @@ public class HostCrashdump extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +302,9 @@ public class HostCrashdump extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -317,9 +318,9 @@ public class HostCrashdump extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.host_crashdump.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -333,9 +334,9 @@ public class HostCrashdump extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "host_crashdump.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -351,9 +352,9 @@ public class HostCrashdump extends XenAPIObject {
* @return Task
*/
public Task uploadAsync(Connection c, String url, Map<String, String> options) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -369,9 +370,9 @@ public class HostCrashdump extends XenAPIObject {
* @param options Extra configuration operations
*/
public void upload(Connection c, String url, Map<String, String> options) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -385,15 +386,15 @@ public class HostCrashdump extends XenAPIObject {
* @return references to all objects
*/
public static Set<HostCrashdump> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfHostCrashdump(result);
}
/**
@ -402,15 +403,15 @@ public class HostCrashdump extends XenAPIObject {
* @return records of all objects
*/
public static Map<HostCrashdump, HostCrashdump.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfHostCrashdumpHostCrashdumpRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class HostMetrics extends XenAPIObject {
* For internal use only.
*/
HostMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class HostMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof HostMetrics)
{
HostMetrics other = (HostMetrics)obj;
HostMetrics other = (HostMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -111,8 +112,8 @@ public class HostMetrics extends XenAPIObject {
/**
* Convert a host_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -154,15 +155,15 @@ public class HostMetrics extends XenAPIObject {
* @return all fields from the object
*/
public HostMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostMetricsRecord(result);
}
/**
@ -172,15 +173,15 @@ public class HostMetrics extends XenAPIObject {
* @return reference to the object
*/
public static HostMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostMetrics(result);
}
/**
@ -189,15 +190,15 @@ public class HostMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -206,15 +207,15 @@ public class HostMetrics extends XenAPIObject {
* @return value of the field
*/
public Long getMemoryTotal(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -223,17 +224,16 @@ public class HostMetrics extends XenAPIObject {
*
* @return value of the field
*/
@Deprecated
public Long getMemoryFree(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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);
return Types.toLong(result);
}
/**
@ -242,15 +242,15 @@ public class HostMetrics extends XenAPIObject {
* @return value of the field
*/
public Boolean getLive(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -259,15 +259,15 @@ public class HostMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -276,15 +276,15 @@ public class HostMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -293,9 +293,9 @@ public class HostMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -310,9 +310,9 @@ public class HostMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -326,9 +326,9 @@ public class HostMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -342,15 +342,15 @@ public class HostMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<HostMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfHostMetrics(result);
}
/**
@ -359,15 +359,15 @@ public class HostMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<HostMetrics, HostMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfHostMetricsHostMetricsRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class HostPatch extends XenAPIObject {
* For internal use only.
*/
HostPatch(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class HostPatch extends XenAPIObject {
{
if (obj != null && obj instanceof HostPatch)
{
HostPatch other = (HostPatch)obj;
HostPatch other = (HostPatch) obj;
return other.ref.equals(this.ref);
} else
{
@ -115,8 +116,8 @@ public class HostPatch extends XenAPIObject {
/**
* Convert a host_patch.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -178,15 +179,15 @@ public class HostPatch extends XenAPIObject {
* @return all fields from the object
*/
public HostPatch.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostPatchRecord(result);
}
/**
@ -196,15 +197,15 @@ public class HostPatch extends XenAPIObject {
* @return reference to the object
*/
public static HostPatch getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHostPatch(result);
}
/**
@ -214,15 +215,15 @@ public class HostPatch extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<HostPatch> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfHostPatch(result);
}
/**
@ -231,15 +232,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -248,15 +249,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -265,15 +266,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -282,15 +283,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public String getVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -299,15 +300,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -316,15 +317,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public Boolean getApplied(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -333,15 +334,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public Date getTimestampApplied(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -350,15 +351,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public Long getSize(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -367,15 +368,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public PoolPatch getPoolPatch(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPoolPatch(result);
}
/**
@ -384,15 +385,15 @@ public class HostPatch extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -401,9 +402,9 @@ public class HostPatch extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -418,9 +419,9 @@ public class HostPatch extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -434,9 +435,9 @@ public class HostPatch extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -450,11 +451,10 @@ public class HostPatch extends XenAPIObject {
*
* @return Task
*/
@Deprecated
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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)};
@ -468,11 +468,10 @@ public class HostPatch extends XenAPIObject {
* @deprecated
*
*/
@Deprecated
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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)};
@ -486,11 +485,10 @@ public class HostPatch extends XenAPIObject {
*
* @return Task
*/
@Deprecated
public Task applyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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)};
@ -505,17 +503,16 @@ public class HostPatch extends XenAPIObject {
*
* @return the output of the patch application process
*/
@Deprecated
public String apply(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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 Types.toString(result);
}
/**
@ -524,15 +521,15 @@ public class HostPatch extends XenAPIObject {
* @return references to all objects
*/
public static Set<HostPatch> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfHostPatch(result);
}
/**
@ -541,15 +538,15 @@ public class HostPatch extends XenAPIObject {
* @return records of all objects
*/
public static Map<HostPatch, HostPatch.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfHostPatchHostPatchRecord(result);
}
}

60
deps/XenServerJava/src/com/xensource/xenapi/Marshalling.java vendored Normal file → Executable file
View File

@ -1,15 +1,33 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
/*
* 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.*;
@ -29,8 +47,8 @@ public final class Marshalling {
o instanceof Double ||
o instanceof Date) {
return o;
} else if (o instanceof Long) {
return o.toString();
} 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;
@ -46,14 +64,14 @@ public final class Marshalling {
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 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 + "]})");
throw new RuntimeException ("=============don't know how to marshall:({[" + o + "]})");
}
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Message extends XenAPIObject {
* For internal use only.
*/
Message(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Message extends XenAPIObject {
{
if (obj != null && obj instanceof Message)
{
Message other = (Message)obj;
Message other = (Message) obj;
return other.ref.equals(this.ref);
} else
{
@ -112,8 +113,8 @@ public class Message extends XenAPIObject {
/**
* Convert a message.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -155,7 +156,7 @@ public class Message extends XenAPIObject {
}
/**
*
*
*
* @param name The name of the message
* @param priority The priority of the message
@ -165,26 +166,25 @@ public class Message extends XenAPIObject {
* @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 {
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)};
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);
return Types.toMessage(result);
}
/**
*
*
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "message.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -193,7 +193,7 @@ public class Message extends XenAPIObject {
}
/**
*
*
*
* @param cls The class of object
* @param objUuid The uuid of the object
@ -201,120 +201,120 @@ public class Message extends XenAPIObject {
* @return The relevant messages
*/
public static Map<Message, Message.Record> get(Connection c, Types.Cls cls, String objUuid, Date since) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toMapOfMessageMessageRecord(result);
}
/**
*
*
*
* @return The references to the messages
*/
public static Set<Message> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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 {
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 Types.toMapOfMessageMessageRecord(result);
}
/**
*
*
*
* @return The message record
*/
public Message.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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 {
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 Types.toMessage(result);
}
/**
*
*
*
* @return The messages
*/
public static Map<Message, Message.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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 {
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);
return Types.toMapOfMessageMessageRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Network extends XenAPIObject {
* For internal use only.
*/
Network(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Network extends XenAPIObject {
{
if (obj != null && obj instanceof Network)
{
Network other = (Network)obj;
Network other = (Network) obj;
return other.ref.equals(this.ref);
} else
{
@ -118,8 +119,8 @@ public class Network extends XenAPIObject {
/**
* Convert a network.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -196,15 +197,15 @@ public class Network extends XenAPIObject {
* @return all fields from the object
*/
public Network.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toNetworkRecord(result);
}
/**
@ -214,15 +215,15 @@ public class Network extends XenAPIObject {
* @return reference to the object
*/
public static Network getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toNetwork(result);
}
/**
@ -232,9 +233,9 @@ public class Network extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, Network.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.network.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -251,16 +252,16 @@ public class Network extends XenAPIObject {
* @return reference to the newly created object
*/
public static Network create(Connection c, Network.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toNetwork(result);
}
/**
@ -269,9 +270,9 @@ public class Network extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.network.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -285,9 +286,9 @@ public class Network extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "network.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -302,15 +303,15 @@ public class Network extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<Network> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfNetwork(result);
}
/**
@ -319,15 +320,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -336,15 +337,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -353,15 +354,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -370,15 +371,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Set<Types.NetworkOperations> getAllowedOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfNetworkOperations(result);
}
/**
@ -387,15 +388,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Map<String, Types.NetworkOperations> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringNetworkOperations(result);
}
/**
@ -404,15 +405,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Set<VIF> getVIFs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVIF(result);
}
/**
@ -421,15 +422,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Set<PIF> getPIFs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfPIF(result);
}
/**
@ -438,15 +439,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Long getMTU(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -455,15 +456,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -472,15 +473,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public String getBridge(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -489,15 +490,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Map<String, Blob> getBlobs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringBlob(result);
}
/**
@ -506,15 +507,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Set<String> getTags(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -523,15 +524,15 @@ public class Network extends XenAPIObject {
* @return value of the field
*/
public Types.NetworkDefaultLockingMode getDefaultLockingMode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toNetworkDefaultLockingMode(result);
}
/**
@ -540,9 +541,9 @@ public class Network extends XenAPIObject {
* @param label New value to set
*/
public void setNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -556,9 +557,9 @@ public class Network extends XenAPIObject {
* @param description New value to set
*/
public void setNameDescription(Connection c, String description) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -572,9 +573,9 @@ public class Network extends XenAPIObject {
* @param MTU New value to set
*/
public void setMTU(Connection c, Long MTU) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -588,9 +589,9 @@ public class Network extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -605,9 +606,9 @@ public class Network extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -621,9 +622,9 @@ public class Network extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -637,9 +638,9 @@ public class Network extends XenAPIObject {
* @param tags New value to set
*/
public void setTags(Connection c, Set<String> tags) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -653,9 +654,9 @@ public class Network extends XenAPIObject {
* @param value New value to add
*/
public void addTags(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -669,9 +670,9 @@ public class Network extends XenAPIObject {
* @param value Value to remove
*/
public void removeTags(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -688,13 +689,12 @@ public class Network extends XenAPIObject {
* @return Task
*/
public Task createNewBlobAsync(Connection c, String name, String mimeType, Boolean _public) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
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);
@ -709,16 +709,15 @@ public class Network extends XenAPIObject {
* @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 {
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)};
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);
return Types.toBlob(result);
}
/**
@ -728,9 +727,9 @@ public class Network extends XenAPIObject {
* @return Task
*/
public Task setDefaultLockingModeAsync(Connection c, Types.NetworkDefaultLockingMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -745,9 +744,9 @@ public class Network extends XenAPIObject {
* @param value The default locking mode for VIFs attached to this network.
*/
public void setDefaultLockingMode(Connection c, Types.NetworkDefaultLockingMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -761,15 +760,15 @@ public class Network extends XenAPIObject {
* @return references to all objects
*/
public static Set<Network> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfNetwork(result);
}
/**
@ -778,15 +777,15 @@ public class Network extends XenAPIObject {
* @return records of all objects
*/
public static Map<Network, Network.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfNetworkNetworkRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class PBD extends XenAPIObject {
* For internal use only.
*/
PBD(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class PBD extends XenAPIObject {
{
if (obj != null && obj instanceof PBD)
{
PBD other = (PBD)obj;
PBD other = (PBD) obj;
return other.ref.equals(this.ref);
} else
{
@ -111,8 +112,8 @@ public class PBD extends XenAPIObject {
/**
* Convert a PBD.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -154,15 +155,15 @@ public class PBD extends XenAPIObject {
* @return all fields from the object
*/
public PBD.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPBDRecord(result);
}
/**
@ -172,15 +173,15 @@ public class PBD extends XenAPIObject {
* @return reference to the object
*/
public static PBD getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPBD(result);
}
/**
@ -190,9 +191,9 @@ public class PBD extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, PBD.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.PBD.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -209,16 +210,16 @@ public class PBD extends XenAPIObject {
* @return reference to the newly created object
*/
public static PBD create(Connection c, PBD.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPBD(result);
}
/**
@ -227,9 +228,9 @@ public class PBD extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.PBD.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -243,9 +244,9 @@ public class PBD extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "PBD.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -259,15 +260,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -276,15 +277,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -293,15 +294,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public SR getSR(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSR(result);
}
/**
@ -310,15 +311,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getDeviceConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -327,15 +328,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getCurrentlyAttached(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -344,15 +345,15 @@ public class PBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -361,9 +362,9 @@ public class PBD extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -378,9 +379,9 @@ public class PBD extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -394,9 +395,9 @@ public class PBD extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -410,10 +411,10 @@ public class PBD extends XenAPIObject {
* @return Task
*/
public Task plugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SrUnknownDriver {
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)};
@ -427,10 +428,10 @@ public class PBD extends XenAPIObject {
*
*/
public void plug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SrUnknownDriver {
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SrUnknownDriver {
String method_call = "PBD.plug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -444,9 +445,9 @@ public class PBD extends XenAPIObject {
* @return Task
*/
public Task unplugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.PBD.unplug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -460,9 +461,9 @@ public class PBD extends XenAPIObject {
*
*/
public void unplug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "PBD.unplug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -477,9 +478,9 @@ public class PBD extends XenAPIObject {
* @return Task
*/
public Task setDeviceConfigAsync(Connection c, Map<String, String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -494,9 +495,9 @@ public class PBD extends XenAPIObject {
* @param value The new value of the PBD's device_config
*/
public void setDeviceConfig(Connection c, Map<String, String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -510,15 +511,15 @@ public class PBD extends XenAPIObject {
* @return references to all objects
*/
public static Set<PBD> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfPBD(result);
}
/**
@ -527,15 +528,15 @@ public class PBD extends XenAPIObject {
* @return records of all objects
*/
public static Map<PBD, PBD.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfPBDPBDRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class PCI extends XenAPIObject {
* For internal use only.
*/
PCI(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class PCI extends XenAPIObject {
{
if (obj != null && obj instanceof PCI)
{
PCI other = (PCI)obj;
PCI other = (PCI) obj;
return other.ref.equals(this.ref);
} else
{
@ -113,8 +114,8 @@ public class PCI extends XenAPIObject {
/**
* Convert a PCI.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -166,15 +167,15 @@ public class PCI extends XenAPIObject {
* @return all fields from the object
*/
public PCI.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPCIRecord(result);
}
/**
@ -184,15 +185,15 @@ public class PCI extends XenAPIObject {
* @return reference to the object
*/
public static PCI getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPCI(result);
}
/**
@ -201,15 +202,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -218,15 +219,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public String getClazzName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -235,15 +236,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public String getVendorName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -252,15 +253,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public String getDeviceName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -269,15 +270,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -286,15 +287,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public String getPciId(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -303,15 +304,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public Set<PCI> getDependencies(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfPCI(result);
}
/**
@ -320,15 +321,15 @@ public class PCI extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -337,9 +338,9 @@ public class PCI extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -354,9 +355,9 @@ public class PCI extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -370,9 +371,9 @@ public class PCI extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -386,15 +387,15 @@ public class PCI extends XenAPIObject {
* @return references to all objects
*/
public static Set<PCI> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfPCI(result);
}
/**
@ -403,15 +404,15 @@ public class PCI extends XenAPIObject {
* @return records of all objects
*/
public static Map<PCI, PCI.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfPCIPCIRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class PGPU extends XenAPIObject {
* For internal use only.
*/
PGPU(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class PGPU extends XenAPIObject {
{
if (obj != null && obj instanceof PGPU)
{
PGPU other = (PGPU)obj;
PGPU other = (PGPU) obj;
return other.ref.equals(this.ref);
} else
{
@ -104,19 +105,27 @@ public class PGPU extends XenAPIObject {
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>();
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;
}
@ -140,6 +149,22 @@ public class PGPU extends XenAPIObject {
* 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;
}
/**
@ -148,15 +173,15 @@ public class PGPU extends XenAPIObject {
* @return all fields from the object
*/
public PGPU.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPGPURecord(result);
}
/**
@ -166,15 +191,15 @@ public class PGPU extends XenAPIObject {
* @return reference to the object
*/
public static PGPU getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPGPU(result);
}
/**
@ -183,15 +208,15 @@ public class PGPU extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +225,15 @@ public class PGPU extends XenAPIObject {
* @return value of the field
*/
public PCI getPCI(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPCI(result);
}
/**
@ -217,15 +242,15 @@ public class PGPU extends XenAPIObject {
* @return value of the field
*/
public GPUGroup getGPUGroup(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toGPUGroup(result);
}
/**
@ -234,15 +259,15 @@ public class PGPU extends XenAPIObject {
* @return value of the field
*/
public Host getHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -251,15 +276,83 @@ public class PGPU extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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);
}
/**
@ -268,9 +361,9 @@ public class PGPU extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +378,9 @@ public class PGPU extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +394,9 @@ public class PGPU extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -311,21 +404,193 @@ public class PGPU extends XenAPIObject {
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 {
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 Types.toSetOfPGPU(result);
}
/**
@ -334,15 +599,15 @@ public class PGPU extends XenAPIObject {
* @return records of all objects
*/
public static Map<PGPU, PGPU.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfPGPUPGPURecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class PIFMetrics extends XenAPIObject {
* For internal use only.
*/
PIFMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class PIFMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof PIFMetrics)
{
PIFMetrics other = (PIFMetrics)obj;
PIFMetrics other = (PIFMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -118,8 +119,8 @@ public class PIFMetrics extends XenAPIObject {
/**
* Convert a PIF_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -196,15 +197,15 @@ public class PIFMetrics extends XenAPIObject {
* @return all fields from the object
*/
public PIFMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIFMetricsRecord(result);
}
/**
@ -214,15 +215,15 @@ public class PIFMetrics extends XenAPIObject {
* @return reference to the object
*/
public static PIFMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIFMetrics(result);
}
/**
@ -231,15 +232,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -248,15 +249,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoReadKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -265,15 +266,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoWriteKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -282,15 +283,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Boolean getCarrier(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -299,15 +300,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getVendorId(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -316,15 +317,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getVendorName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -333,15 +334,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getDeviceId(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -350,15 +351,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getDeviceName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -367,15 +368,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Long getSpeed(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -384,15 +385,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Boolean getDuplex(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -401,15 +402,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getPciBusPath(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -418,15 +419,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -435,15 +436,15 @@ public class PIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -452,9 +453,9 @@ public class PIFMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -469,9 +470,9 @@ public class PIFMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -485,9 +486,9 @@ public class PIFMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -501,15 +502,15 @@ public class PIFMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<PIFMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfPIFMetrics(result);
}
/**
@ -518,15 +519,15 @@ public class PIFMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<PIFMetrics, PIFMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfPIFMetricsPIFMetricsRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class PoolPatch extends XenAPIObject {
* For internal use only.
*/
PoolPatch(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class PoolPatch extends XenAPIObject {
{
if (obj != null && obj instanceof PoolPatch)
{
PoolPatch other = (PoolPatch)obj;
PoolPatch other = (PoolPatch) obj;
return other.ref.equals(this.ref);
} else
{
@ -114,8 +115,8 @@ public class PoolPatch extends XenAPIObject {
/**
* Convert a pool_patch.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -172,15 +173,15 @@ public class PoolPatch extends XenAPIObject {
* @return all fields from the object
*/
public PoolPatch.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPoolPatchRecord(result);
}
/**
@ -190,15 +191,15 @@ public class PoolPatch extends XenAPIObject {
* @return reference to the object
*/
public static PoolPatch getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPoolPatch(result);
}
/**
@ -208,15 +209,15 @@ public class PoolPatch extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<PoolPatch> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfPoolPatch(result);
}
/**
@ -225,15 +226,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -242,15 +243,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -259,15 +260,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -276,15 +277,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public String getVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -293,15 +294,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public Long getSize(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -310,15 +311,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public Boolean getPoolApplied(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -327,15 +328,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public Set<HostPatch> getHostPatches(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfHostPatch(result);
}
/**
@ -344,15 +345,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public Set<Types.AfterApplyGuidance> getAfterApplyGuidance(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfAfterApplyGuidance(result);
}
/**
@ -361,15 +362,15 @@ public class PoolPatch extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -378,9 +379,9 @@ public class PoolPatch extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -395,9 +396,9 @@ public class PoolPatch extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -411,9 +412,9 @@ public class PoolPatch extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -428,9 +429,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task applyAsync(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -446,15 +447,15 @@ public class PoolPatch extends XenAPIObject {
* @return the output of the patch application process
*/
public String apply(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -463,9 +464,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task poolApplyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -479,9 +480,9 @@ public class PoolPatch extends XenAPIObject {
*
*/
public void poolApply(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "pool_patch.pool_apply";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -496,9 +497,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task precheckAsync(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -514,15 +515,15 @@ public class PoolPatch extends XenAPIObject {
* @return the output of the patch prechecks
*/
public String precheck(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -531,9 +532,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task cleanAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.pool_patch.clean";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -547,9 +548,9 @@ public class PoolPatch extends XenAPIObject {
*
*/
public void clean(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "pool_patch.clean";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -563,9 +564,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task poolCleanAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -579,9 +580,9 @@ public class PoolPatch extends XenAPIObject {
*
*/
public void poolClean(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "pool_patch.pool_clean";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -595,9 +596,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.pool_patch.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -611,9 +612,9 @@ public class PoolPatch extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "pool_patch.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -628,9 +629,9 @@ public class PoolPatch extends XenAPIObject {
* @return Task
*/
public Task cleanOnHostAsync(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -645,9 +646,9 @@ public class PoolPatch extends XenAPIObject {
* @param host The host on which to clean the patch
*/
public void cleanOnHost(Connection c, Host host) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -661,15 +662,15 @@ public class PoolPatch extends XenAPIObject {
* @return references to all objects
*/
public static Set<PoolPatch> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfPoolPatch(result);
}
/**
@ -678,15 +679,15 @@ public class PoolPatch extends XenAPIObject {
* @return records of all objects
*/
public static Map<PoolPatch, PoolPatch.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfPoolPatchPoolPatchRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Role extends XenAPIObject {
* For internal use only.
*/
Role(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Role extends XenAPIObject {
{
if (obj != null && obj instanceof Role)
{
Role other = (Role)obj;
Role other = (Role) obj;
return other.ref.equals(this.ref);
} else
{
@ -109,8 +110,8 @@ public class Role extends XenAPIObject {
/**
* Convert a role.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -142,15 +143,15 @@ public class Role extends XenAPIObject {
* @return all fields from the object
*/
public Role.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toRoleRecord(result);
}
/**
@ -160,15 +161,15 @@ public class Role extends XenAPIObject {
* @return reference to the object
*/
public static Role getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toRole(result);
}
/**
@ -178,15 +179,15 @@ public class Role extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<Role> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfRole(result);
}
/**
@ -195,15 +196,15 @@ public class Role extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -212,15 +213,15 @@ public class Role extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -229,15 +230,15 @@ public class Role extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -246,15 +247,15 @@ public class Role extends XenAPIObject {
* @return value of the field
*/
public Set<Role> getSubroles(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfRole(result);
}
/**
@ -263,15 +264,15 @@ public class Role extends XenAPIObject {
* @return a list of permissions
*/
public Set<Role> getPermissions(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfRole(result);
}
/**
@ -280,15 +281,15 @@ public class Role extends XenAPIObject {
* @return a list of permission names
*/
public Set<String> getPermissionsNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -297,15 +298,15 @@ public class Role extends XenAPIObject {
* @return a list of references to roles
*/
public Set<Role> getByPermission(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfRole(result);
}
/**
@ -315,15 +316,15 @@ public class Role extends XenAPIObject {
* @return a list of references to roles
*/
public static Set<Role> getByPermissionNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfRole(result);
}
/**
@ -332,15 +333,15 @@ public class Role extends XenAPIObject {
* @return references to all objects
*/
public static Set<Role> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfRole(result);
}
/**
@ -349,15 +350,15 @@ public class Role extends XenAPIObject {
* @return records of all objects
*/
public static Map<Role, Role.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfRoleRoleRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class SM extends XenAPIObject {
* For internal use only.
*/
SM(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class SM extends XenAPIObject {
{
if (obj != null && obj instanceof SM)
{
SM other = (SM)obj;
SM other = (SM) obj;
return other.ref.equals(this.ref);
} else
{
@ -109,6 +110,7 @@ public class SM extends XenAPIObject {
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();
@ -117,8 +119,8 @@ public class SM extends XenAPIObject {
/**
* Convert a SM.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -129,6 +131,7 @@ public class SM extends XenAPIObject {
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;
@ -174,6 +177,10 @@ public class SM extends XenAPIObject {
* 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
*/
@ -190,15 +197,15 @@ public class SM extends XenAPIObject {
* @return all fields from the object
*/
public SM.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSMRecord(result);
}
/**
@ -208,15 +215,15 @@ public class SM extends XenAPIObject {
* @return reference to the object
*/
public static SM getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSM(result);
}
/**
@ -226,15 +233,15 @@ public class SM extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<SM> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfSM(result);
}
/**
@ -243,15 +250,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -260,15 +267,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -277,15 +284,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -294,15 +301,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -311,15 +318,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getVendor(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -328,15 +335,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getCopyright(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -345,15 +352,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -362,15 +369,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getRequiredApiVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -379,32 +386,50 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getConfiguration(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
* Get the capabilities field of the given SM.
* @deprecated
*
* @return value of the field
*/
public Set<String> getCapabilities(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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);
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);
}
/**
@ -413,15 +438,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -430,15 +455,15 @@ public class SM extends XenAPIObject {
* @return value of the field
*/
public String getDriverFilename(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -447,9 +472,9 @@ public class SM extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -464,9 +489,9 @@ public class SM extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -480,9 +505,9 @@ public class SM extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -496,15 +521,15 @@ public class SM extends XenAPIObject {
* @return references to all objects
*/
public static Set<SM> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfSM(result);
}
/**
@ -513,15 +538,15 @@ public class SM extends XenAPIObject {
* @return records of all objects
*/
public static Map<SM, SM.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfSMSMRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Secret extends XenAPIObject {
* For internal use only.
*/
Secret(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Secret extends XenAPIObject {
{
if (obj != null && obj instanceof Secret)
{
Secret other = (Secret)obj;
Secret other = (Secret) obj;
return other.ref.equals(this.ref);
} else
{
@ -108,8 +109,8 @@ public class Secret extends XenAPIObject {
/**
* Convert a secret.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -136,15 +137,15 @@ public class Secret extends XenAPIObject {
* @return all fields from the object
*/
public Secret.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSecretRecord(result);
}
/**
@ -154,15 +155,15 @@ public class Secret extends XenAPIObject {
* @return reference to the object
*/
public static Secret getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSecret(result);
}
/**
@ -172,9 +173,9 @@ public class Secret extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, Secret.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.secret.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -191,16 +192,16 @@ public class Secret extends XenAPIObject {
* @return reference to the newly created object
*/
public static Secret create(Connection c, Secret.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSecret(result);
}
/**
@ -209,9 +210,9 @@ public class Secret extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.secret.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -225,9 +226,9 @@ public class Secret extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "secret.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -241,15 +242,15 @@ public class Secret extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -258,15 +259,15 @@ public class Secret extends XenAPIObject {
* @return value of the field
*/
public String getValue(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -275,15 +276,15 @@ public class Secret extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -292,9 +293,9 @@ public class Secret extends XenAPIObject {
* @param value New value to set
*/
public void setValue(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -308,9 +309,9 @@ public class Secret extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -325,9 +326,9 @@ public class Secret extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -341,9 +342,9 @@ public class Secret extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -357,15 +358,15 @@ public class Secret extends XenAPIObject {
* @return references to all objects
*/
public static Set<Secret> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfSecret(result);
}
/**
@ -374,15 +375,15 @@ public class Secret extends XenAPIObject {
* @return records of all objects
*/
public static Map<Secret, Secret.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfSecretSecretRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Session extends XenAPIObject {
* For internal use only.
*/
Session(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Session extends XenAPIObject {
{
if (obj != null && obj instanceof Session)
{
Session other = (Session)obj;
Session other = (Session) obj;
return other.ref.equals(this.ref);
} else
{
@ -119,8 +120,8 @@ public class Session extends XenAPIObject {
/**
* Convert a session.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -202,15 +203,15 @@ public class Session extends XenAPIObject {
* @return all fields from the object
*/
public Session.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSessionRecord(result);
}
/**
@ -220,15 +221,15 @@ public class Session extends XenAPIObject {
* @return reference to the object
*/
public static Session getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSession(result);
}
/**
@ -237,15 +238,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -254,15 +255,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Host getThisHost(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -271,15 +272,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public User getThisUser(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toUser(result);
}
/**
@ -288,15 +289,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Date getLastActive(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -305,15 +306,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Boolean getPool(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -322,15 +323,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -339,15 +340,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Boolean getIsLocalSuperuser(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -356,15 +357,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Subject getSubject(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSubject(result);
}
/**
@ -373,15 +374,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Date getValidationTime(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -390,15 +391,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public String getAuthUserSid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -407,15 +408,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public String getAuthUserName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -424,15 +425,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Set<String> getRbacPermissions(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -441,15 +442,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Set<Task> getTasks(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfTask(result);
}
/**
@ -458,15 +459,15 @@ public class Session extends XenAPIObject {
* @return value of the field
*/
public Session getParent(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSession(result);
}
/**
@ -475,9 +476,9 @@ public class Session extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -492,9 +493,9 @@ public class Session extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -508,9 +509,9 @@ public class Session extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -527,15 +528,15 @@ public class Session extends XenAPIObject {
* @return reference of newly created session
*/
public static Session loginWithPassword(Connection c, String uname, String pwd, String version) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SessionAuthenticationFailed {
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);
return Types.toSession(result);
}
/**
@ -543,9 +544,9 @@ public class Session extends XenAPIObject {
*
*/
public static void logout(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "session.logout";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session)};
@ -560,9 +561,9 @@ public class Session extends XenAPIObject {
* @param newPwd New password for account
*/
public static void changePassword(Connection c, String oldPwd, String newPwd) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -578,14 +579,14 @@ public class Session extends XenAPIObject {
* @return ID of newly created session
*/
public static Session slaveLocalLoginWithPassword(Connection c, String uname, String pwd) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSession(result);
}
/**
@ -593,9 +594,9 @@ public class Session extends XenAPIObject {
*
*/
public static void localLogout(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "session.local_logout";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session)};
@ -609,9 +610,9 @@ public class Session extends XenAPIObject {
* @return Task
*/
public static Task getAllSubjectIdentifiersAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.session.get_all_subject_identifiers";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session)};
@ -626,15 +627,15 @@ public class Session extends XenAPIObject {
* @return The list of user subject-identifiers of all existing sessions
*/
public static Set<String> getAllSubjectIdentifiers(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -644,9 +645,9 @@ public class Session extends XenAPIObject {
* @return Task
*/
public static Task logoutSubjectIdentifierAsync(Connection c, String subjectIdentifier) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.session.logout_subject_identifier";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
@ -661,9 +662,9 @@ public class Session extends XenAPIObject {
* @param subjectIdentifier User subject-identifier of the sessions to be destroyed
*/
public static void logoutSubjectIdentifier(Connection c, String subjectIdentifier) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "session.logout_subject_identifier";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Subject extends XenAPIObject {
* For internal use only.
*/
Subject(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Subject extends XenAPIObject {
{
if (obj != null && obj instanceof Subject)
{
Subject other = (Subject)obj;
Subject other = (Subject) obj;
return other.ref.equals(this.ref);
} else
{
@ -109,8 +110,8 @@ public class Subject extends XenAPIObject {
/**
* Convert a subject.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -142,15 +143,15 @@ public class Subject extends XenAPIObject {
* @return all fields from the object
*/
public Subject.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSubjectRecord(result);
}
/**
@ -160,15 +161,15 @@ public class Subject extends XenAPIObject {
* @return reference to the object
*/
public static Subject getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSubject(result);
}
/**
@ -178,9 +179,9 @@ public class Subject extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, Subject.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.subject.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -197,16 +198,16 @@ public class Subject extends XenAPIObject {
* @return reference to the newly created object
*/
public static Subject create(Connection c, Subject.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSubject(result);
}
/**
@ -215,9 +216,9 @@ public class Subject extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.subject.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -231,9 +232,9 @@ public class Subject extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "subject.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -247,15 +248,15 @@ public class Subject extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -264,15 +265,15 @@ public class Subject extends XenAPIObject {
* @return value of the field
*/
public String getSubjectIdentifier(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -281,15 +282,15 @@ public class Subject extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -298,15 +299,15 @@ public class Subject extends XenAPIObject {
* @return value of the field
*/
public Set<Role> getRoles(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfRole(result);
}
/**
@ -315,9 +316,9 @@ public class Subject extends XenAPIObject {
* @param role The unique role reference
*/
public void addToRoles(Connection c, Role role) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -331,9 +332,9 @@ public class Subject extends XenAPIObject {
* @param role The unique role reference in the subject's roles field
*/
public void removeFromRoles(Connection c, Role role) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -347,15 +348,15 @@ public class Subject extends XenAPIObject {
* @return a list of permission names
*/
public Set<String> getPermissionsNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfString(result);
}
/**
@ -364,15 +365,15 @@ public class Subject extends XenAPIObject {
* @return references to all objects
*/
public static Set<Subject> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfSubject(result);
}
/**
@ -381,15 +382,15 @@ public class Subject extends XenAPIObject {
* @return records of all objects
*/
public static Map<Subject, Subject.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfSubjectSubjectRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Task extends XenAPIObject {
* For internal use only.
*/
Task(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Task extends XenAPIObject {
{
if (obj != null && obj instanceof Task)
{
Task other = (Task)obj;
Task other = (Task) obj;
return other.ref.equals(this.ref);
} else
{
@ -121,8 +122,8 @@ public class Task extends XenAPIObject {
/**
* Convert a task.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -214,15 +215,15 @@ public class Task extends XenAPIObject {
* @return all fields from the object
*/
public Task.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTaskRecord(result);
}
/**
@ -232,15 +233,15 @@ public class Task extends XenAPIObject {
* @return reference to the object
*/
public static Task getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTask(result);
}
/**
@ -250,15 +251,15 @@ public class Task extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<Task> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfTask(result);
}
/**
@ -267,15 +268,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -284,15 +285,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -301,15 +302,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -318,15 +319,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Set<Types.TaskAllowedOperations> getAllowedOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfTaskAllowedOperations(result);
}
/**
@ -335,15 +336,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Map<String, Types.TaskAllowedOperations> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringTaskAllowedOperations(result);
}
/**
@ -352,15 +353,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Date getCreated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -369,15 +370,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Date getFinished(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -386,15 +387,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Types.TaskStatusType getStatus(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTaskStatusType(result);
}
/**
@ -403,15 +404,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Host getResidentOn(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toHost(result);
}
/**
@ -420,15 +421,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Double getProgress(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -437,15 +438,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public String getType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -454,15 +455,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public String getResult(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -471,15 +472,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Set<String> getErrorInfo(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -488,15 +489,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -505,15 +506,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Task getSubtaskOf(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTask(result);
}
/**
@ -522,15 +523,15 @@ public class Task extends XenAPIObject {
* @return value of the field
*/
public Set<Task> getSubtasks(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfTask(result);
}
/**
@ -539,9 +540,9 @@ public class Task extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -556,9 +557,9 @@ public class Task extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -572,9 +573,9 @@ public class Task extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -590,15 +591,15 @@ public class Task extends XenAPIObject {
* @return The reference of the created task object
*/
public static Task create(Connection c, String label, String description) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTask(result);
}
/**
@ -606,9 +607,9 @@ public class Task extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "task.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -622,10 +623,10 @@ public class Task extends XenAPIObject {
* @return Task
*/
public Task cancelAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationNotAllowed {
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)};
@ -639,10 +640,10 @@ public class Task extends XenAPIObject {
*
*/
public void cancel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationNotAllowed {
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationNotAllowed {
String method_call = "task.cancel";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -656,15 +657,15 @@ public class Task extends XenAPIObject {
* @return references to all objects
*/
public static Set<Task> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfTask(result);
}
/**
@ -673,15 +674,15 @@ public class Task extends XenAPIObject {
* @return records of all objects
*/
public static Map<Task, Task.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfTaskTaskRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class Tunnel extends XenAPIObject {
* For internal use only.
*/
Tunnel(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class Tunnel extends XenAPIObject {
{
if (obj != null && obj instanceof Tunnel)
{
Tunnel other = (Tunnel)obj;
Tunnel other = (Tunnel) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class Tunnel extends XenAPIObject {
/**
* Convert a tunnel.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class Tunnel extends XenAPIObject {
* @return all fields from the object
*/
public Tunnel.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTunnelRecord(result);
}
/**
@ -166,15 +167,15 @@ public class Tunnel extends XenAPIObject {
* @return reference to the object
*/
public static Tunnel getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toTunnel(result);
}
/**
@ -183,15 +184,15 @@ public class Tunnel extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +201,15 @@ public class Tunnel extends XenAPIObject {
* @return value of the field
*/
public PIF getAccessPIF(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -217,15 +218,15 @@ public class Tunnel extends XenAPIObject {
* @return value of the field
*/
public PIF getTransportPIF(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -234,15 +235,15 @@ public class Tunnel extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getStatus(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -251,15 +252,15 @@ public class Tunnel extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -268,9 +269,9 @@ public class Tunnel extends XenAPIObject {
* @param status New value to set
*/
public void setStatus(Connection c, Map<String, String> status) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +286,9 @@ public class Tunnel extends XenAPIObject {
* @param value Value to add
*/
public void addToStatus(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +302,9 @@ public class Tunnel extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromStatus(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -317,9 +318,9 @@ public class Tunnel extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -334,9 +335,9 @@ public class Tunnel extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -350,9 +351,9 @@ public class Tunnel extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -368,12 +369,12 @@ public class Tunnel extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, PIF transportPIF, Network network) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OpenvswitchNotActive,
Types.TransportPifNotConfigured,
Types.IsTunnelAccessPif {
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)};
@ -390,18 +391,18 @@ public class Tunnel extends XenAPIObject {
* @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 {
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);
return Types.toTunnel(result);
}
/**
@ -410,9 +411,9 @@ public class Tunnel extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.tunnel.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -426,9 +427,9 @@ public class Tunnel extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "tunnel.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -442,15 +443,15 @@ public class Tunnel extends XenAPIObject {
* @return references to all objects
*/
public static Set<Tunnel> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfTunnel(result);
}
/**
@ -459,15 +460,15 @@ public class Tunnel extends XenAPIObject {
* @return records of all objects
*/
public static Map<Tunnel, Tunnel.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfTunnelTunnelRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class User extends XenAPIObject {
* For internal use only.
*/
User(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class User extends XenAPIObject {
{
if (obj != null && obj instanceof User)
{
User other = (User)obj;
User other = (User) obj;
return other.ref.equals(this.ref);
} else
{
@ -109,8 +110,8 @@ public class User extends XenAPIObject {
/**
* Convert a user.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -142,17 +143,16 @@ public class User extends XenAPIObject {
*
* @return all fields from the object
*/
@Deprecated
public User.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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);
return Types.toUserRecord(result);
}
/**
@ -162,17 +162,16 @@ public class User extends XenAPIObject {
* @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 {
@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);
return Types.toUser(result);
}
/**
@ -182,11 +181,10 @@ public class User extends XenAPIObject {
* @param record All constructor arguments
* @return Task
*/
@Deprecated
public static Task createAsync(Connection c, User.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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();
@ -203,18 +201,17 @@ public class User extends XenAPIObject {
* @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 {
@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);
return Types.toUser(result);
}
/**
@ -223,11 +220,10 @@ public class User extends XenAPIObject {
*
* @return Task
*/
@Deprecated
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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)};
@ -241,11 +237,10 @@ public class User extends XenAPIObject {
* @deprecated
*
*/
@Deprecated
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
@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)};
@ -259,15 +254,15 @@ public class User extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -276,15 +271,15 @@ public class User extends XenAPIObject {
* @return value of the field
*/
public String getShortName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -293,15 +288,15 @@ public class User extends XenAPIObject {
* @return value of the field
*/
public String getFullname(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -310,15 +305,15 @@ public class User extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -327,9 +322,9 @@ public class User extends XenAPIObject {
* @param fullname New value to set
*/
public void setFullname(Connection c, String fullname) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -343,9 +338,9 @@ public class User extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -360,9 +355,9 @@ public class User extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -376,9 +371,9 @@ public class User extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VBD extends XenAPIObject {
* For internal use only.
*/
VBD(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VBD extends XenAPIObject {
{
if (obj != null && obj instanceof VBD)
{
VBD other = (VBD)obj;
VBD other = (VBD) obj;
return other.ref.equals(this.ref);
} else
{
@ -127,8 +128,8 @@ public class VBD extends XenAPIObject {
/**
* Convert a VBD.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -250,15 +251,15 @@ public class VBD extends XenAPIObject {
* @return all fields from the object
*/
public VBD.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBDRecord(result);
}
/**
@ -268,15 +269,15 @@ public class VBD extends XenAPIObject {
* @return reference to the object
*/
public static VBD getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBD(result);
}
/**
@ -286,9 +287,9 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, VBD.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VBD.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -305,16 +306,16 @@ public class VBD extends XenAPIObject {
* @return reference to the newly created object
*/
public static VBD create(Connection c, VBD.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBD(result);
}
/**
@ -323,9 +324,9 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VBD.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -339,9 +340,9 @@ public class VBD extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VBD.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -355,15 +356,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -372,15 +373,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Set<Types.VbdOperations> getAllowedOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVbdOperations(result);
}
/**
@ -389,15 +390,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, Types.VbdOperations> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringVbdOperations(result);
}
/**
@ -406,15 +407,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -423,15 +424,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public VDI getVDI(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVDI(result);
}
/**
@ -440,15 +441,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public String getDevice(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -457,15 +458,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public String getUserdevice(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -474,15 +475,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getBootable(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -491,15 +492,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Types.VbdMode getMode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVbdMode(result);
}
/**
@ -508,15 +509,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Types.VbdType getType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVbdType(result);
}
/**
@ -525,15 +526,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getUnpluggable(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -542,15 +543,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getStorageLock(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -559,15 +560,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getEmpty(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -576,15 +577,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -593,15 +594,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Boolean getCurrentlyAttached(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -610,15 +611,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Long getStatusCode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -627,15 +628,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public String getStatusDetail(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -644,15 +645,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getRuntimeProperties(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -661,15 +662,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public String getQosAlgorithmType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -678,15 +679,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getQosAlgorithmParams(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -695,15 +696,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public Set<String> getQosSupportedAlgorithms(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -712,15 +713,15 @@ public class VBD extends XenAPIObject {
* @return value of the field
*/
public VBDMetrics getMetrics(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBDMetrics(result);
}
/**
@ -729,9 +730,9 @@ public class VBD extends XenAPIObject {
* @param userdevice New value to set
*/
public void setUserdevice(Connection c, String userdevice) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -745,9 +746,9 @@ public class VBD extends XenAPIObject {
* @param bootable New value to set
*/
public void setBootable(Connection c, Boolean bootable) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -761,9 +762,9 @@ public class VBD extends XenAPIObject {
* @param mode New value to set
*/
public void setMode(Connection c, Types.VbdMode mode) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -777,9 +778,9 @@ public class VBD extends XenAPIObject {
* @param type New value to set
*/
public void setType(Connection c, Types.VbdType type) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -793,9 +794,9 @@ public class VBD extends XenAPIObject {
* @param unpluggable New value to set
*/
public void setUnpluggable(Connection c, Boolean unpluggable) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -809,9 +810,9 @@ public class VBD extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -826,9 +827,9 @@ public class VBD extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -842,9 +843,9 @@ public class VBD extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -858,9 +859,9 @@ public class VBD extends XenAPIObject {
* @param algorithmType New value to set
*/
public void setQosAlgorithmType(Connection c, String algorithmType) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -874,9 +875,9 @@ public class VBD extends XenAPIObject {
* @param algorithmParams New value to set
*/
public void setQosAlgorithmParams(Connection c, Map<String, String> algorithmParams) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -891,9 +892,9 @@ public class VBD extends XenAPIObject {
* @param value Value to add
*/
public void addToQosAlgorithmParams(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -907,9 +908,9 @@ public class VBD extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromQosAlgorithmParams(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -923,11 +924,11 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task ejectAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VbdNotRemovableMedia,
Types.VbdIsEmpty {
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)};
@ -941,11 +942,11 @@ public class VBD extends XenAPIObject {
*
*/
public void eject(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VbdNotRemovableMedia,
Types.VbdIsEmpty {
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)};
@ -960,11 +961,11 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task insertAsync(Connection c, VDI vdi) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VbdNotRemovableMedia,
Types.VbdNotEmpty {
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)};
@ -979,11 +980,11 @@ public class VBD extends XenAPIObject {
* @param vdi The new VDI to 'insert'
*/
public void insert(Connection c, VDI vdi) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VbdNotRemovableMedia,
Types.VbdNotEmpty {
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)};
@ -997,9 +998,9 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task plugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VBD.plug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1013,9 +1014,9 @@ public class VBD extends XenAPIObject {
*
*/
public void plug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VBD.plug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1029,11 +1030,11 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task unplugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.DeviceDetachRejected,
Types.DeviceAlreadyDetached {
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)};
@ -1047,11 +1048,11 @@ public class VBD extends XenAPIObject {
*
*/
public void unplug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.DeviceDetachRejected,
Types.DeviceAlreadyDetached {
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)};
@ -1065,9 +1066,9 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task unplugForceAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VBD.unplug_force";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1081,9 +1082,9 @@ public class VBD extends XenAPIObject {
*
*/
public void unplugForce(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VBD.unplug_force";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1097,9 +1098,9 @@ public class VBD extends XenAPIObject {
* @return Task
*/
public Task assertAttachableAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VBD.assert_attachable";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1113,9 +1114,9 @@ public class VBD extends XenAPIObject {
*
*/
public void assertAttachable(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VBD.assert_attachable";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -1129,15 +1130,15 @@ public class VBD extends XenAPIObject {
* @return references to all objects
*/
public static Set<VBD> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVBD(result);
}
/**
@ -1146,15 +1147,15 @@ public class VBD extends XenAPIObject {
* @return records of all objects
*/
public static Map<VBD, VBD.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVBDVBDRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VBDMetrics extends XenAPIObject {
* For internal use only.
*/
VBDMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VBDMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof VBDMetrics)
{
VBDMetrics other = (VBDMetrics)obj;
VBDMetrics other = (VBDMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class VBDMetrics extends XenAPIObject {
/**
* Convert a VBD_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class VBDMetrics extends XenAPIObject {
* @return all fields from the object
*/
public VBDMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBDMetricsRecord(result);
}
/**
@ -166,15 +167,15 @@ public class VBDMetrics extends XenAPIObject {
* @return reference to the object
*/
public static VBDMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVBDMetrics(result);
}
/**
@ -183,15 +184,15 @@ public class VBDMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +201,15 @@ public class VBDMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoReadKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -217,15 +218,15 @@ public class VBDMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoWriteKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -234,15 +235,15 @@ public class VBDMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -251,15 +252,15 @@ public class VBDMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -268,9 +269,9 @@ public class VBDMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +286,9 @@ public class VBDMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +302,9 @@ public class VBDMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -317,15 +318,15 @@ public class VBDMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<VBDMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVBDMetrics(result);
}
/**
@ -334,15 +335,15 @@ public class VBDMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<VBDMetrics, VBDMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVBDMetricsVBDMetricsRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VGPU extends XenAPIObject {
* For internal use only.
*/
VGPU(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VGPU extends XenAPIObject {
{
if (obj != null && obj instanceof VGPU)
{
VGPU other = (VGPU)obj;
VGPU other = (VGPU) obj;
return other.ref.equals(this.ref);
} else
{
@ -105,20 +106,24 @@ public class VGPU extends XenAPIObject {
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>();
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;
}
@ -146,6 +151,14 @@ public class VGPU extends XenAPIObject {
* 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;
}
/**
@ -154,15 +167,15 @@ public class VGPU extends XenAPIObject {
* @return all fields from the object
*/
public VGPU.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVGPURecord(result);
}
/**
@ -172,15 +185,15 @@ public class VGPU extends XenAPIObject {
* @return reference to the object
*/
public static VGPU getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVGPU(result);
}
/**
@ -189,15 +202,15 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -206,15 +219,15 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -223,15 +236,15 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public GPUGroup getGPUGroup(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toGPUGroup(result);
}
/**
@ -240,15 +253,15 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public String getDevice(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -257,15 +270,15 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public Boolean getCurrentlyAttached(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -274,15 +287,49 @@ public class VGPU extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
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);
}
/**
@ -291,9 +338,9 @@ public class VGPU extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -308,9 +355,9 @@ public class VGPU extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -324,9 +371,9 @@ public class VGPU extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -335,58 +382,58 @@ public class VGPU extends XenAPIObject {
}
/**
*
*
*
* @param VM
* @param GPUGroup
* @param device
* @param otherConfig
* @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) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
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 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) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
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 Types.toVGPU(result);
}
/**
*
*
*
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VGPU.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -396,13 +443,13 @@ public class VGPU extends XenAPIObject {
}
/**
*
*
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VGPU.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -416,15 +463,15 @@ public class VGPU extends XenAPIObject {
* @return references to all objects
*/
public static Set<VGPU> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVGPU(result);
}
/**
@ -433,15 +480,15 @@ public class VGPU extends XenAPIObject {
* @return records of all objects
*/
public static Map<VGPU, VGPU.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVGPUVGPURecord(result);
}
}

View File

@ -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);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VIF extends XenAPIObject {
* For internal use only.
*/
VIF(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VIF extends XenAPIObject {
{
if (obj != null && obj instanceof VIF)
{
VIF other = (VIF)obj;
VIF other = (VIF) obj;
return other.ref.equals(this.ref);
} else
{
@ -126,8 +127,8 @@ public class VIF extends XenAPIObject {
/**
* Convert a VIF.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -146,7 +147,7 @@ public class VIF extends XenAPIObject {
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.UNRECOGNIZED : this.lockingMode);
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;
@ -244,15 +245,15 @@ public class VIF extends XenAPIObject {
* @return all fields from the object
*/
public VIF.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIFRecord(result);
}
/**
@ -262,15 +263,15 @@ public class VIF extends XenAPIObject {
* @return reference to the object
*/
public static VIF getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIF(result);
}
/**
@ -280,9 +281,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, VIF.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VIF.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -299,16 +300,16 @@ public class VIF extends XenAPIObject {
* @return reference to the newly created object
*/
public static VIF create(Connection c, VIF.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIF(result);
}
/**
@ -317,9 +318,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VIF.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -333,9 +334,9 @@ public class VIF extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VIF.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -349,15 +350,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -366,15 +367,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Set<Types.VifOperations> getAllowedOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVifOperations(result);
}
/**
@ -383,15 +384,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Map<String, Types.VifOperations> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringVifOperations(result);
}
/**
@ -400,15 +401,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public String getDevice(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -417,15 +418,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Network getNetwork(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toNetwork(result);
}
/**
@ -434,15 +435,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -451,15 +452,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public String getMAC(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -468,15 +469,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Long getMTU(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -485,15 +486,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -502,15 +503,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Boolean getCurrentlyAttached(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -519,15 +520,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Long getStatusCode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -536,15 +537,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public String getStatusDetail(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -553,15 +554,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getRuntimeProperties(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -570,15 +571,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public String getQosAlgorithmType(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -587,15 +588,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getQosAlgorithmParams(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -604,15 +605,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Set<String> getQosSupportedAlgorithms(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -621,15 +622,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public VIFMetrics getMetrics(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIFMetrics(result);
}
/**
@ -638,15 +639,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Boolean getMACAutogenerated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -655,15 +656,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Types.VifLockingMode getLockingMode(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVifLockingMode(result);
}
/**
@ -672,15 +673,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Set<String> getIpv4Allowed(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -689,15 +690,15 @@ public class VIF extends XenAPIObject {
* @return value of the field
*/
public Set<String> getIpv6Allowed(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -706,9 +707,9 @@ public class VIF extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -723,9 +724,9 @@ public class VIF extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -739,9 +740,9 @@ public class VIF extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -755,9 +756,9 @@ public class VIF extends XenAPIObject {
* @param algorithmType New value to set
*/
public void setQosAlgorithmType(Connection c, String algorithmType) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -771,9 +772,9 @@ public class VIF extends XenAPIObject {
* @param algorithmParams New value to set
*/
public void setQosAlgorithmParams(Connection c, Map<String, String> algorithmParams) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -788,9 +789,9 @@ public class VIF extends XenAPIObject {
* @param value Value to add
*/
public void addToQosAlgorithmParams(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -804,9 +805,9 @@ public class VIF extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromQosAlgorithmParams(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -820,9 +821,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task plugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VIF.plug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -836,9 +837,9 @@ public class VIF extends XenAPIObject {
*
*/
public void plug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VIF.plug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -852,9 +853,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task unplugAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VIF.unplug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -868,9 +869,9 @@ public class VIF extends XenAPIObject {
*
*/
public void unplug(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VIF.unplug";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -884,9 +885,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task unplugForceAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VIF.unplug_force";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -900,9 +901,9 @@ public class VIF extends XenAPIObject {
*
*/
public void unplugForce(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VIF.unplug_force";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -917,9 +918,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task setLockingModeAsync(Connection c, Types.VifLockingMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -934,9 +935,9 @@ public class VIF extends XenAPIObject {
* @param value The new locking mode for the VIF
*/
public void setLockingMode(Connection c, Types.VifLockingMode value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -951,9 +952,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task setIpv4AllowedAsync(Connection c, Set<String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -968,9 +969,9 @@ public class VIF extends XenAPIObject {
* @param value The IP addresses which will be associated with the VIF
*/
public void setIpv4Allowed(Connection c, Set<String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -985,9 +986,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task addIpv4AllowedAsync(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1002,9 +1003,9 @@ public class VIF extends XenAPIObject {
* @param value The IP address which will be associated with the VIF
*/
public void addIpv4Allowed(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1019,9 +1020,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task removeIpv4AllowedAsync(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1036,9 +1037,9 @@ public class VIF extends XenAPIObject {
* @param value The IP address which will be removed from the VIF
*/
public void removeIpv4Allowed(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1053,9 +1054,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task setIpv6AllowedAsync(Connection c, Set<String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1070,9 +1071,9 @@ public class VIF extends XenAPIObject {
* @param value The IP addresses which will be associated with the VIF
*/
public void setIpv6Allowed(Connection c, Set<String> value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1087,9 +1088,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task addIpv6AllowedAsync(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1104,9 +1105,9 @@ public class VIF extends XenAPIObject {
* @param value The IP address which will be associated with the VIF
*/
public void addIpv6Allowed(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1121,9 +1122,9 @@ public class VIF extends XenAPIObject {
* @return Task
*/
public Task removeIpv6AllowedAsync(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1138,9 +1139,9 @@ public class VIF extends XenAPIObject {
* @param value The IP address which will be removed from the VIF
*/
public void removeIpv6Allowed(Connection c, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -1154,15 +1155,15 @@ public class VIF extends XenAPIObject {
* @return references to all objects
*/
public static Set<VIF> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVIF(result);
}
/**
@ -1171,15 +1172,15 @@ public class VIF extends XenAPIObject {
* @return records of all objects
*/
public static Map<VIF, VIF.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVIFVIFRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VIFMetrics extends XenAPIObject {
* For internal use only.
*/
VIFMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VIFMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof VIFMetrics)
{
VIFMetrics other = (VIFMetrics)obj;
VIFMetrics other = (VIFMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class VIFMetrics extends XenAPIObject {
/**
* Convert a VIF_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class VIFMetrics extends XenAPIObject {
* @return all fields from the object
*/
public VIFMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIFMetricsRecord(result);
}
/**
@ -166,15 +167,15 @@ public class VIFMetrics extends XenAPIObject {
* @return reference to the object
*/
public static VIFMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVIFMetrics(result);
}
/**
@ -183,15 +184,15 @@ public class VIFMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +201,15 @@ public class VIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoReadKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -217,15 +218,15 @@ public class VIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Double getIoWriteKbs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDouble(result);
}
/**
@ -234,15 +235,15 @@ public class VIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -251,15 +252,15 @@ public class VIFMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -268,9 +269,9 @@ public class VIFMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +286,9 @@ public class VIFMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +302,9 @@ public class VIFMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -317,15 +318,15 @@ public class VIFMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<VIFMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVIFMetrics(result);
}
/**
@ -334,15 +335,15 @@ public class VIFMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<VIFMetrics, VIFMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVIFMetricsVIFMetricsRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VLAN extends XenAPIObject {
* For internal use only.
*/
VLAN(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VLAN extends XenAPIObject {
{
if (obj != null && obj instanceof VLAN)
{
VLAN other = (VLAN)obj;
VLAN other = (VLAN) obj;
return other.ref.equals(this.ref);
} else
{
@ -110,8 +111,8 @@ public class VLAN extends XenAPIObject {
/**
* Convert a VLAN.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -148,15 +149,15 @@ public class VLAN extends XenAPIObject {
* @return all fields from the object
*/
public VLAN.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVLANRecord(result);
}
/**
@ -166,15 +167,15 @@ public class VLAN extends XenAPIObject {
* @return reference to the object
*/
public static VLAN getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVLAN(result);
}
/**
@ -183,15 +184,15 @@ public class VLAN extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -200,15 +201,15 @@ public class VLAN extends XenAPIObject {
* @return value of the field
*/
public PIF getTaggedPIF(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -217,15 +218,15 @@ public class VLAN extends XenAPIObject {
* @return value of the field
*/
public PIF getUntaggedPIF(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toPIF(result);
}
/**
@ -234,15 +235,15 @@ public class VLAN extends XenAPIObject {
* @return value of the field
*/
public Long getTag(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -251,15 +252,15 @@ public class VLAN extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -268,9 +269,9 @@ public class VLAN extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -285,9 +286,9 @@ public class VLAN extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -301,9 +302,9 @@ public class VLAN extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -320,9 +321,9 @@ public class VLAN extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, PIF taggedPIF, Long tag, Network network) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -340,15 +341,15 @@ public class VLAN extends XenAPIObject {
* @return The reference of the created VLAN object
*/
public static VLAN create(Connection c, PIF taggedPIF, Long tag, Network network) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVLAN(result);
}
/**
@ -357,9 +358,9 @@ public class VLAN extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VLAN.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -373,9 +374,9 @@ public class VLAN extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VLAN.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -389,15 +390,15 @@ public class VLAN extends XenAPIObject {
* @return references to all objects
*/
public static Set<VLAN> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVLAN(result);
}
/**
@ -406,15 +407,15 @@ public class VLAN extends XenAPIObject {
* @return records of all objects
*/
public static Map<VLAN, VLAN.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVLANVLANRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VMAppliance extends XenAPIObject {
* For internal use only.
*/
VMAppliance(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VMAppliance extends XenAPIObject {
{
if (obj != null && obj instanceof VMAppliance)
{
VMAppliance other = (VMAppliance)obj;
VMAppliance other = (VMAppliance) obj;
return other.ref.equals(this.ref);
} else
{
@ -111,8 +112,8 @@ public class VMAppliance extends XenAPIObject {
/**
* Convert a VM_appliance.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -154,15 +155,15 @@ public class VMAppliance extends XenAPIObject {
* @return all fields from the object
*/
public VMAppliance.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMApplianceRecord(result);
}
/**
@ -172,15 +173,15 @@ public class VMAppliance extends XenAPIObject {
* @return reference to the object
*/
public static VMAppliance getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMAppliance(result);
}
/**
@ -190,9 +191,9 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, VMAppliance.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VM_appliance.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -209,16 +210,16 @@ public class VMAppliance extends XenAPIObject {
* @return reference to the newly created object
*/
public static VMAppliance create(Connection c, VMAppliance.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMAppliance(result);
}
/**
@ -227,9 +228,9 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VM_appliance.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -243,9 +244,9 @@ public class VMAppliance extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VM_appliance.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -260,15 +261,15 @@ public class VMAppliance extends XenAPIObject {
* @return references to objects with matching names
*/
public static Set<VMAppliance> getByNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVMAppliance(result);
}
/**
@ -277,15 +278,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -294,15 +295,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public String getNameLabel(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -311,15 +312,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public String getNameDescription(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -328,15 +329,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public Set<Types.VmApplianceOperation> getAllowedOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVmApplianceOperation(result);
}
/**
@ -345,15 +346,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public Map<String, Types.VmApplianceOperation> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringVmApplianceOperation(result);
}
/**
@ -362,15 +363,15 @@ public class VMAppliance extends XenAPIObject {
* @return value of the field
*/
public Set<VM> getVMs(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfVM(result);
}
/**
@ -379,9 +380,9 @@ public class VMAppliance extends XenAPIObject {
* @param label New value to set
*/
public void setNameLabel(Connection c, String label) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -395,9 +396,9 @@ public class VMAppliance extends XenAPIObject {
* @param description New value to set
*/
public void setNameDescription(Connection c, String description) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -412,10 +413,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task startAsync(Connection c, Boolean paused) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -430,10 +431,10 @@ public class VMAppliance extends XenAPIObject {
* @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 {
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)};
@ -447,10 +448,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task cleanShutdownAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -464,10 +465,10 @@ public class VMAppliance extends XenAPIObject {
*
*/
public void cleanShutdown(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -481,10 +482,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task hardShutdownAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -498,10 +499,10 @@ public class VMAppliance extends XenAPIObject {
*
*/
public void hardShutdown(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -515,10 +516,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task shutdownAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -532,10 +533,10 @@ public class VMAppliance extends XenAPIObject {
*
*/
public void shutdown(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.OperationPartiallyFailed {
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)};
@ -550,10 +551,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task assertCanBeRecoveredAsync(Connection c, Session sessionTo) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VmRequiresSr {
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)};
@ -568,10 +569,10 @@ public class VMAppliance extends XenAPIObject {
* @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 {
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)};
@ -587,10 +588,10 @@ public class VMAppliance extends XenAPIObject {
* @return Task
*/
public Task recoverAsync(Connection c, Session sessionTo, Boolean force) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.VmRequiresSr {
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)};
@ -606,10 +607,10 @@ public class VMAppliance extends XenAPIObject {
* @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 {
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)};
@ -623,15 +624,15 @@ public class VMAppliance extends XenAPIObject {
* @return references to all objects
*/
public static Set<VMAppliance> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVMAppliance(result);
}
/**
@ -640,15 +641,15 @@ public class VMAppliance extends XenAPIObject {
* @return records of all objects
*/
public static Map<VMAppliance, VMAppliance.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVMApplianceVMApplianceRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VMGuestMetrics extends XenAPIObject {
* For internal use only.
*/
VMGuestMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VMGuestMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof VMGuestMetrics)
{
VMGuestMetrics other = (VMGuestMetrics)obj;
VMGuestMetrics other = (VMGuestMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -116,8 +117,8 @@ public class VMGuestMetrics extends XenAPIObject {
/**
* Convert a VM_guest_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -184,15 +185,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return all fields from the object
*/
public VMGuestMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMGuestMetricsRecord(result);
}
/**
@ -202,15 +203,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return reference to the object
*/
public static VMGuestMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMGuestMetrics(result);
}
/**
@ -219,15 +220,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -236,15 +237,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOsVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -253,15 +254,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getPVDriversVersion(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -270,15 +271,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Boolean getPVDriversUpToDate(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -287,15 +288,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getMemory(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -304,15 +305,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getDisks(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -321,15 +322,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getNetworks(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -338,15 +339,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOther(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -355,15 +356,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -372,15 +373,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -389,15 +390,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return value of the field
*/
public Boolean getLive(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toBoolean(result);
}
/**
@ -406,9 +407,9 @@ public class VMGuestMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -423,9 +424,9 @@ public class VMGuestMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -439,9 +440,9 @@ public class VMGuestMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -455,15 +456,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<VMGuestMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVMGuestMetrics(result);
}
/**
@ -472,15 +473,15 @@ public class VMGuestMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<VMGuestMetrics, VMGuestMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVMGuestMetricsVMGuestMetricsRecord(result);
}
}

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VMMetrics extends XenAPIObject {
* For internal use only.
*/
VMMetrics(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VMMetrics extends XenAPIObject {
{
if (obj != null && obj instanceof VMMetrics)
{
VMMetrics other = (VMMetrics)obj;
VMMetrics other = (VMMetrics) obj;
return other.ref.equals(this.ref);
} else
{
@ -117,8 +118,8 @@ public class VMMetrics extends XenAPIObject {
/**
* Convert a VM_metrics.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -190,15 +191,15 @@ public class VMMetrics extends XenAPIObject {
* @return all fields from the object
*/
public VMMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMMetricsRecord(result);
}
/**
@ -208,15 +209,15 @@ public class VMMetrics extends XenAPIObject {
* @return reference to the object
*/
public static VMMetrics getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVMMetrics(result);
}
/**
@ -225,15 +226,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -242,15 +243,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Long getMemoryActual(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -259,15 +260,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Long getVCPUsNumber(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toLong(result);
}
/**
@ -276,15 +277,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<Long, Double> getVCPUsUtilisation(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfLongDouble(result);
}
/**
@ -293,15 +294,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<Long, Long> getVCPUsCPU(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfLongLong(result);
}
/**
@ -310,15 +311,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getVCPUsParams(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -327,15 +328,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<Long, Set<String>> getVCPUsFlags(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfLongSetOfString(result);
}
/**
@ -344,15 +345,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Set<String> getState(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toSetOfString(result);
}
/**
@ -361,15 +362,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getStartTime(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -378,15 +379,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getInstallTime(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -395,15 +396,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Date getLastUpdated(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toDate(result);
}
/**
@ -412,15 +413,15 @@ public class VMMetrics extends XenAPIObject {
* @return value of the field
*/
public Map<String, String> getOtherConfig(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfStringString(result);
}
/**
@ -429,9 +430,9 @@ public class VMMetrics extends XenAPIObject {
* @param otherConfig New value to set
*/
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -446,9 +447,9 @@ public class VMMetrics extends XenAPIObject {
* @param value Value to add
*/
public void addToOtherConfig(Connection c, String key, String value) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -462,9 +463,9 @@ public class VMMetrics extends XenAPIObject {
* @param key Key to remove
*/
public void removeFromOtherConfig(Connection c, String key) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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)};
@ -478,15 +479,15 @@ public class VMMetrics extends XenAPIObject {
* @return references to all objects
*/
public static Set<VMMetrics> getAll(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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 Types.toSetOfVMMetrics(result);
}
/**
@ -495,15 +496,15 @@ public class VMMetrics extends XenAPIObject {
* @return records of all objects
*/
public static Map<VMMetrics, VMMetrics.Record> getAllRecords(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toMapOfVMMetricsVMMetricsRecord(result);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/*
* 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
@ -28,6 +28,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.xensource.xenapi;
import com.xensource.xenapi.Types.BadServerResponse;
@ -60,14 +61,14 @@ public class VTPM extends XenAPIObject {
* For internal use only.
*/
VTPM(String ref) {
this.ref = ref;
this.ref = ref;
}
/**
* @return The XenAPI reference (OpaqueRef) to this object.
*/
public String toWireString() {
return this.ref;
return this.ref;
}
/**
@ -78,7 +79,7 @@ public class VTPM extends XenAPIObject {
{
if (obj != null && obj instanceof VTPM)
{
VTPM other = (VTPM)obj;
VTPM other = (VTPM) obj;
return other.ref.equals(this.ref);
} else
{
@ -108,8 +109,8 @@ public class VTPM extends XenAPIObject {
/**
* Convert a VTPM.Record to a Map
*/
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
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);
@ -136,15 +137,15 @@ public class VTPM extends XenAPIObject {
* @return all fields from the object
*/
public VTPM.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVTPMRecord(result);
}
/**
@ -154,15 +155,15 @@ public class VTPM extends XenAPIObject {
* @return reference to the object
*/
public static VTPM getByUuid(Connection c, String uuid) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVTPM(result);
}
/**
@ -172,9 +173,9 @@ public class VTPM extends XenAPIObject {
* @return Task
*/
public static Task createAsync(Connection c, VTPM.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VTPM.create";
String session = c.getSessionReference();
Map<String, Object> record_map = record.toMap();
@ -191,16 +192,16 @@ public class VTPM extends XenAPIObject {
* @return reference to the newly created object
*/
public static VTPM create(Connection c, VTPM.Record record) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVTPM(result);
}
/**
@ -209,9 +210,9 @@ public class VTPM extends XenAPIObject {
* @return Task
*/
public Task destroyAsync(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "Async.VTPM.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -225,9 +226,9 @@ public class VTPM extends XenAPIObject {
*
*/
public void destroy(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VTPM.destroy";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
@ -241,15 +242,15 @@ public class VTPM extends XenAPIObject {
* @return value of the field
*/
public String getUuid(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toString(result);
}
/**
@ -258,15 +259,15 @@ public class VTPM extends XenAPIObject {
* @return value of the field
*/
public VM getVM(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
/**
@ -275,15 +276,15 @@ public class VTPM extends XenAPIObject {
* @return value of the field
*/
public VM getBackend(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
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);
return Types.toVM(result);
}
}

44
deps/XenServerJava/src/com/xensource/xenapi/XenAPIObject.java vendored Normal file → Executable file
View File

@ -1,18 +1,36 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
/*
* 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();
public abstract String toWireString();
}