com.xensource.xenapi
Class Role

java.lang.Object
  extended by com.xensource.xenapi.XenAPIObject
      extended by com.xensource.xenapi.Role

public class Role
extends XenAPIObject

A set of permissions associated with a subject


Nested Class Summary
static class Role.Record
          Represents all the fields in a Role
 
Field Summary
protected  java.lang.String ref
          The XenAPI reference to this object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          If obj is a Role, compares XenAPI references for equality.
static java.util.Set<Role> getAll(Connection c)
          Return a list of all the roles known to the system.
static java.util.Map<Role,Role.Record> getAllRecords(Connection c)
          Return a map of role references to role records for all roles known to the system.
static java.util.Set<Role> getByNameLabel(Connection c, java.lang.String label)
          Get all the role instances with the given label.
 java.util.Set<Role> getByPermission(Connection c)
          This call returns a list of roles given a permission
static java.util.Set<Role> getByPermissionNameLabel(Connection c, java.lang.String label)
          This call returns a list of roles given a permission name
static Role getByUuid(Connection c, java.lang.String uuid)
          Get a reference to the role instance with the specified UUID.
 java.lang.String getNameDescription(Connection c)
          Get the name/description field of the given role.
 java.lang.String getNameLabel(Connection c)
          Get the name/label field of the given role.
 java.util.Set<Role> getPermissions(Connection c)
          This call returns a list of permissions given a role
 java.util.Set<java.lang.String> getPermissionsNameLabel(Connection c)
          This call returns a list of permission names given a role
 Role.Record getRecord(Connection c)
          Get a record containing the current state of the given role.
 java.util.Set<Role> getSubroles(Connection c)
          Get the subroles field of the given role.
 java.lang.String getUuid(Connection c)
          Get the uuid field of the given role.
 int hashCode()
           
 java.lang.String toWireString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final java.lang.String ref
The XenAPI reference to this object.

Method Detail

toWireString

public java.lang.String toWireString()
Specified by:
toWireString in class XenAPIObject

equals

public boolean equals(java.lang.Object obj)
If obj is a Role, compares XenAPI references for equality.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getRecord

public Role.Record getRecord(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get a record containing the current state of the given role.

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

getByUuid

public static Role getByUuid(Connection c,
                             java.lang.String uuid)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get a reference to the role instance with the specified UUID.

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

getByNameLabel

public static java.util.Set<Role> getByNameLabel(Connection c,
                                                 java.lang.String label)
                                          throws Types.BadServerResponse,
                                                 Types.XenAPIException,
                                                 org.apache.xmlrpc.XmlRpcException
Get all the role instances with the given label.

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

getUuid

public java.lang.String getUuid(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given role.

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

getNameLabel

public java.lang.String getNameLabel(Connection c)
                              throws Types.BadServerResponse,
                                     Types.XenAPIException,
                                     org.apache.xmlrpc.XmlRpcException
Get the name/label field of the given role.

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

getNameDescription

public java.lang.String getNameDescription(Connection c)
                                    throws Types.BadServerResponse,
                                           Types.XenAPIException,
                                           org.apache.xmlrpc.XmlRpcException
Get the name/description field of the given role.

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

getSubroles

public java.util.Set<Role> getSubroles(Connection c)
                                throws Types.BadServerResponse,
                                       Types.XenAPIException,
                                       org.apache.xmlrpc.XmlRpcException
Get the subroles field of the given role.

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

getPermissions

public java.util.Set<Role> getPermissions(Connection c)
                                   throws Types.BadServerResponse,
                                          Types.XenAPIException,
                                          org.apache.xmlrpc.XmlRpcException
This call returns a list of permissions given a role

Returns:
a list of permissions
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getPermissionsNameLabel

public java.util.Set<java.lang.String> getPermissionsNameLabel(Connection c)
                                                        throws Types.BadServerResponse,
                                                               Types.XenAPIException,
                                                               org.apache.xmlrpc.XmlRpcException
This call returns a list of permission names given a role

Returns:
a list of permission names
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByPermission

public java.util.Set<Role> getByPermission(Connection c)
                                    throws Types.BadServerResponse,
                                           Types.XenAPIException,
                                           org.apache.xmlrpc.XmlRpcException
This call returns a list of roles given a permission

Returns:
a list of references to roles
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByPermissionNameLabel

public static java.util.Set<Role> getByPermissionNameLabel(Connection c,
                                                           java.lang.String label)
                                                    throws Types.BadServerResponse,
                                                           Types.XenAPIException,
                                                           org.apache.xmlrpc.XmlRpcException
This call returns a list of roles given a permission name

Parameters:
label - The short friendly name of the role
Returns:
a list of references to roles
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static java.util.Set<Role> getAll(Connection c)
                                  throws Types.BadServerResponse,
                                         Types.XenAPIException,
                                         org.apache.xmlrpc.XmlRpcException
Return a list of all the roles known to the system.

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

getAllRecords

public static java.util.Map<Role,Role.Record> getAllRecords(Connection c)
                                                     throws Types.BadServerResponse,
                                                            Types.XenAPIException,
                                                            org.apache.xmlrpc.XmlRpcException
Return a map of role references to role records for all roles known to the system.

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