com.xensource.xenapi
Class HostPatch

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

public class HostPatch
extends XenAPIObject

Represents a patch stored on a server


Nested Class Summary
static class HostPatch.Record
          Represents all the fields in a HostPatch
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
 void addToOtherConfig(Connection c, String key, String value)
          Add the given key-value pair to the other_config field of the given host_patch.
 String apply(Connection c)
          Deprecated.  
 Task applyAsync(Connection c)
          Deprecated.  
 void destroy(Connection c)
          Deprecated.  
 Task destroyAsync(Connection c)
          Deprecated.  
 boolean equals(Object obj)
          If obj is a HostPatch, compares XenAPI references for equality.
static Set<HostPatch> getAll(Connection c)
          Return a list of all the host_patchs known to the system.
static Map<HostPatch,HostPatch.Record> getAllRecords(Connection c)
          Return a map of host_patch references to host_patch records for all host_patchs known to the system.
 Boolean getApplied(Connection c)
          Get the applied field of the given host_patch.
static Set<HostPatch> getByNameLabel(Connection c, String label)
          Get all the host_patch instances with the given label.
static HostPatch getByUuid(Connection c, String uuid)
          Get a reference to the host_patch instance with the specified UUID.
 Host getHost(Connection c)
          Get the host field of the given host_patch.
 String getNameDescription(Connection c)
          Get the name/description field of the given host_patch.
 String getNameLabel(Connection c)
          Get the name/label field of the given host_patch.
 Map<String,String> getOtherConfig(Connection c)
          Get the other_config field of the given host_patch.
 PoolPatch getPoolPatch(Connection c)
          Get the pool_patch field of the given host_patch.
 HostPatch.Record getRecord(Connection c)
          Get a record containing the current state of the given host_patch.
 Long getSize(Connection c)
          Get the size field of the given host_patch.
 Date getTimestampApplied(Connection c)
          Get the timestamp_applied field of the given host_patch.
 String getUuid(Connection c)
          Get the uuid field of the given host_patch.
 String getVersion(Connection c)
          Get the version field of the given host_patch.
 int hashCode()
           
 void removeFromOtherConfig(Connection c, String key)
          Remove the given key and its corresponding value from the other_config field of the given host_patch.
 void setOtherConfig(Connection c, Map<String,String> otherConfig)
          Set the other_config field of the given host_patch.
 String toWireString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final String ref
The XenAPI reference to this object.

Method Detail

toWireString

public String toWireString()
Specified by:
toWireString in class XenAPIObject

equals

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

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getRecord

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

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

getByUuid

public static HostPatch getByUuid(Connection c,
                                  String uuid)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get a reference to the host_patch 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 Set<HostPatch> getByNameLabel(Connection c,
                                            String label)
                                     throws Types.BadServerResponse,
                                            Types.XenAPIException,
                                            org.apache.xmlrpc.XmlRpcException
Get all the host_patch 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 String getUuid(Connection c)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given host_patch.

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

getNameLabel

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

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

getNameDescription

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

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

getVersion

public String getVersion(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Get the version field of the given host_patch.

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

getHost

public Host getHost(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Get the host field of the given host_patch.

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

getApplied

public Boolean getApplied(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the applied field of the given host_patch.

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

getTimestampApplied

public Date getTimestampApplied(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get the timestamp_applied field of the given host_patch.

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

getSize

public Long getSize(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Get the size field of the given host_patch.

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

getPoolPatch

public PoolPatch getPoolPatch(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the pool_patch field of the given host_patch.

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

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

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

setOtherConfig

public void setOtherConfig(Connection c,
                           Map<String,String> otherConfig)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Set the other_config field of the given host_patch.

Parameters:
otherConfig - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToOtherConfig

public void addToOtherConfig(Connection c,
                             String key,
                             String value)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the other_config field of the given host_patch.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromOtherConfig

public void removeFromOtherConfig(Connection c,
                                  String key)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the other_config field of the given host_patch. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroyAsync

@Deprecated
public Task destroyAsync(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Deprecated. 

Destroy the specified host patch, removing it from the disk. This does NOT reverse the patch

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroy

@Deprecated
public void destroy(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Deprecated. 

Destroy the specified host patch, removing it from the disk. This does NOT reverse the patch

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

applyAsync

@Deprecated
public Task applyAsync(Connection c)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Deprecated. 

Apply the selected patch and return its output

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

apply

@Deprecated
public String apply(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Deprecated. 

Apply the selected patch and return its output

Returns:
the output of the patch application process
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

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

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

getAllRecords

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

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