Package com.xensource.xenapi
Class Subject
java.lang.Object
com.xensource.xenapi.XenAPIObject
com.xensource.xenapi.Subject
A user or group that can log in xapi
First published in XenServer 5.5.
- Author:
- Cloud Software Group, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents all the fields in a Subject -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToRoles
(Connection c, Role role) This call adds a new role to a subject Minimum allowed role: pool-admin First published in XenServer 5.6.static Subject
create
(Connection c, Subject.Record record) Create a new subject instance, and return its handle.static Task
createAsync
(Connection c, Subject.Record record) Create a new subject instance, and return its handle.void
Destroy the specified subject instance.Destroy the specified subject instance.boolean
If obj is a Subject, compares XenAPI references for equality.getAll
(Connection c) Return a list of all the subjects known to the system.static Map<Subject,
Subject.Record> Return a map of subject references to subject records for all subjects known to the system.static Subject
getByUuid
(Connection c, String uuid) Get a reference to the subject instance with the specified UUID.Get the other_config field of the given subject.This call returns a list of permission names given a subject Minimum allowed role: read-only First published in XenServer 5.6.Get a record containing the current state of the given subject.Get the roles field of the given subject.Get the subject_identifier field of the given subject.Get the uuid field of the given subject.int
hashCode()
void
removeFromRoles
(Connection c, Role role) This call removes a role from a subject Minimum allowed role: pool-admin First published in XenServer 5.6.Methods inherited from class com.xensource.xenapi.XenAPIObject
isNull
-
Field Details
-
ref
The XenAPI reference (OpaqueRef) to this object.
-
-
Method Details
-
toWireString
- Specified by:
toWireString
in classXenAPIObject
- Returns:
- The XenAPI reference (OpaqueRef) to this object.
-
equals
If obj is a Subject, compares XenAPI references for equality. -
hashCode
public int hashCode() -
getRecord
public Subject.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get a record containing the current state of the given subject. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- all fields from the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getByUuid
public static Subject getByUuid(Connection c, String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get a reference to the subject instance with the specified UUID. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made onuuid
- UUID of object to return- Returns:
- reference to the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
createAsync
public static Task createAsync(Connection c, Subject.Record record) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Create a new subject instance, and return its handle. Minimum allowed role: pool-admin First published in XenServer 5.5.- Parameters:
c
- The connection the call is made onrecord
- All constructor arguments- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
create
public static Subject create(Connection c, Subject.Record record) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Create a new subject instance, and return its handle. Minimum allowed role: pool-admin First published in XenServer 5.5.- Parameters:
c
- The connection the call is made onrecord
- All constructor arguments- Returns:
- reference to the newly created object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
destroyAsync
public Task destroyAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Destroy the specified subject instance. Minimum allowed role: pool-admin First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
destroy
public void destroy(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Destroy the specified subject instance. Minimum allowed role: pool-admin First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getUuid
public String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the uuid field of the given subject. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getSubjectIdentifier
public String getSubjectIdentifier(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the subject_identifier field of the given subject. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getOtherConfig
public Map<String,String> getOtherConfig(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the other_config field of the given subject. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getRoles
public Set<Role> getRoles(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the roles field of the given subject. Minimum allowed role: read-only First published in XenServer 5.6.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
addToRoles
public void addToRoles(Connection c, Role role) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException This call adds a new role to a subject Minimum allowed role: pool-admin First published in XenServer 5.6.- Parameters:
c
- The connection the call is made onrole
- The unique role reference- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
removeFromRoles
public void removeFromRoles(Connection c, Role role) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException This call removes a role from a subject Minimum allowed role: pool-admin First published in XenServer 5.6.- Parameters:
c
- The connection the call is made onrole
- The unique role reference in the subject's roles field- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getPermissionsNameLabel
public Set<String> getPermissionsNameLabel(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException This call returns a list of permission names given a subject Minimum allowed role: read-only First published in XenServer 5.6.- Parameters:
c
- The connection the call is made on- Returns:
- a list of permission names
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getAll
public static Set<Subject> getAll(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Return a list of all the subjects known to the system. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- references to all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getAllRecords
public static Map<Subject,Subject.Record> getAllRecords(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Return a map of subject references to subject records for all subjects known to the system. Minimum allowed role: read-only First published in XenServer 5.5.- Parameters:
c
- The connection the call is made on- Returns:
- records of all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-