com.xensource.xenapi
Class PBD

java.lang.Object
  extended by com.xensource.xenapi.PBD

public class PBD
extends Object

The physical block devices through which hosts access SRs


Nested Class Summary
static class PBD.Record
          Represents all the fields in a PBD
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
static PBD create(PBD.Record record)
          Create a new PBD instance, and return its handle.
 void destroy()
          Destroy the specified PBD instance.
static Set<PBD> getAll()
          Return a list of all the PBDs known to the system.
static Map<PBD,PBD.Record> getAllRecords()
          Get all the PBD Records at once, in a single XML RPC call
static PBD getByUuid(String uuid)
          Get a reference to the PBD instance with the specified UUID.
 Boolean getCurrentlyAttached()
          Get the currently_attached field of the given PBD.
 Map<String,String> getDeviceConfig()
          Get the device_config field of the given PBD.
 Host getHost()
          Get the host field of the given PBD.
protected static PBD getInstFromRef(String ref)
           
 PBD.Record getRecord()
          Get a record containing the current state of the given PBD.
 SR getSR()
          Get the SR field of the given PBD.
 String getUuid()
          Get the uuid field of the given PBD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final String ref
The XenAPI reference to this object.

Method Detail

getInstFromRef

protected static PBD getInstFromRef(String ref)

getRecord

public PBD.Record getRecord()
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get a record containing the current state of the given PBD.

Returns:
all fields from the object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getByUuid

public static PBD getByUuid(String uuid)
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get a reference to the PBD instance with the specified UUID.

Parameters:
uuid - UUID of object to return
Returns:
reference to the object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

create

public static PBD create(PBD.Record record)
                  throws Types.BadServerResponse,
                         ConnectionHelper.NoConnectionOnThisThreadException,
                         XmlRpcException
Create a new PBD instance, and return its handle.

Parameters:
record - All constructor arguments
Returns:
reference to the newly created object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

destroy

public void destroy()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Destroy the specified PBD instance.

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getUuid

public String getUuid()
               throws Types.BadServerResponse,
                      ConnectionHelper.NoConnectionOnThisThreadException,
                      XmlRpcException
Get the uuid field of the given PBD.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getHost

public Host getHost()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Get the host field of the given PBD.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getSR

public SR getSR()
         throws Types.BadServerResponse,
                ConnectionHelper.NoConnectionOnThisThreadException,
                XmlRpcException
Get the SR field of the given PBD.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getDeviceConfig

public Map<String,String> getDeviceConfig()
                                   throws Types.BadServerResponse,
                                          ConnectionHelper.NoConnectionOnThisThreadException,
                                          XmlRpcException
Get the device_config field of the given PBD.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getCurrentlyAttached

public Boolean getCurrentlyAttached()
                             throws Types.BadServerResponse,
                                    ConnectionHelper.NoConnectionOnThisThreadException,
                                    XmlRpcException
Get the currently_attached field of the given PBD.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAll

public static Set<PBD> getAll()
                       throws Types.BadServerResponse,
                              ConnectionHelper.NoConnectionOnThisThreadException,
                              XmlRpcException
Return a list of all the PBDs known to the system.

Returns:
references to all objects
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAllRecords

public static Map<PBD,PBD.Record> getAllRecords()
                                         throws Types.BadServerResponse,
                                                ConnectionHelper.NoConnectionOnThisThreadException,
                                                XmlRpcException
Get all the PBD Records at once, in a single XML RPC call

Returns:
A map from PBD to PBD.Record
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException