You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/02/25 06:13:15 UTC
[09/19] CLOUDSTACK-6058: New XenServer 6.2sp1 SDKs
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f501ec69/deps/XenServerJava/src/com/xensource/xenapi/Session.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Session.java b/deps/XenServerJava/src/com/xensource/xenapi/Session.java
index bdf3b4c..a00ab7d 100644
--- a/deps/XenServerJava/src/com/xensource/xenapi/Session.java
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Session.java
@@ -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)};
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f501ec69/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Subject.java b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
index a599f237..9a8fbfb 100644
--- a/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java
@@ -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);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f501ec69/deps/XenServerJava/src/com/xensource/xenapi/Task.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Task.java b/deps/XenServerJava/src/com/xensource/xenapi/Task.java
index 59d59f6..4a85dfe 100644
--- a/deps/XenServerJava/src/com/xensource/xenapi/Task.java
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Task.java
@@ -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);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f501ec69/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
----------------------------------------------------------------------
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
index 44b236d..e30bd0a 100644
--- a/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java
@@ -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);
}
}
\ No newline at end of file