com.xensource.xenapi
Class PoolPatch

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

public class PoolPatch
extends XenAPIObject

Pool-wide patches


Nested Class Summary
static class PoolPatch.Record
          Represents all the fields in a PoolPatch
 
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 pool_patch.
 String apply(Connection c, Host host)
          Apply the selected patch to a host and return its output
 Task applyAsync(Connection c, Host host)
          Apply the selected patch to a host and return its output
 void clean(Connection c)
          Removes the patch's files from all hosts in the pool, but does not remove the database entries
 Task cleanAsync(Connection c)
          Removes the patch's files from all hosts in the pool, but does not remove the database entries
 void destroy(Connection c)
          Removes the patch's files from all hosts in the pool, and removes the database entries.
 Task destroyAsync(Connection c)
          Removes the patch's files from all hosts in the pool, and removes the database entries.
 boolean equals(Object obj)
          If obj is a PoolPatch, compares XenAPI references for equality.
 Set<Types.AfterApplyGuidance> getAfterApplyGuidance(Connection c)
          Get the after_apply_guidance field of the given pool_patch.
static Set<PoolPatch> getAll(Connection c)
          Return a list of all the pool_patchs known to the system.
static Map<PoolPatch,PoolPatch.Record> getAllRecords(Connection c)
          Return a map of pool_patch references to pool_patch records for all pool_patchs known to the system.
static Set<PoolPatch> getByNameLabel(Connection c, String label)
          Get all the pool_patch instances with the given label.
static PoolPatch getByUuid(Connection c, String uuid)
          Get a reference to the pool_patch instance with the specified UUID.
 Set<HostPatch> getHostPatches(Connection c)
          Get the host_patches field of the given pool_patch.
 String getNameDescription(Connection c)
          Get the name/description field of the given pool_patch.
 String getNameLabel(Connection c)
          Get the name/label field of the given pool_patch.
 Map<String,String> getOtherConfig(Connection c)
          Get the other_config field of the given pool_patch.
 Boolean getPoolApplied(Connection c)
          Get the pool_applied field of the given pool_patch.
 PoolPatch.Record getRecord(Connection c)
          Get a record containing the current state of the given pool_patch.
 Long getSize(Connection c)
          Get the size field of the given pool_patch.
 String getUuid(Connection c)
          Get the uuid field of the given pool_patch.
 String getVersion(Connection c)
          Get the version field of the given pool_patch.
 int hashCode()
           
 void poolApply(Connection c)
          Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output
 Task poolApplyAsync(Connection c)
          Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output
 String precheck(Connection c, Host host)
          Execute the precheck stage of the selected patch on a host and return its output
 Task precheckAsync(Connection c, Host host)
          Execute the precheck stage of the selected patch on a host and return its output
 void removeFromOtherConfig(Connection c, String key)
          Remove the given key and its corresponding value from the other_config field of the given pool_patch.
 void setOtherConfig(Connection c, Map<String,String> otherConfig)
          Set the other_config field of the given pool_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 PoolPatch, compares XenAPI references for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getRecord

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

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

getByUuid

public static PoolPatch getByUuid(Connection c,
                                  String uuid)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get a reference to the pool_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<PoolPatch> getByNameLabel(Connection c,
                                            String label)
                                     throws Types.BadServerResponse,
                                            Types.XenAPIException,
                                            org.apache.xmlrpc.XmlRpcException
Get all the pool_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 pool_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 pool_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 pool_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 pool_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 pool_patch.

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

getPoolApplied

public Boolean getPoolApplied(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the pool_applied field of the given pool_patch.

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

getHostPatches

public Set<HostPatch> getHostPatches(Connection c)
                              throws Types.BadServerResponse,
                                     Types.XenAPIException,
                                     org.apache.xmlrpc.XmlRpcException
Get the host_patches field of the given pool_patch.

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

getAfterApplyGuidance

public Set<Types.AfterApplyGuidance> getAfterApplyGuidance(Connection c)
                                                    throws Types.BadServerResponse,
                                                           Types.XenAPIException,
                                                           org.apache.xmlrpc.XmlRpcException
Get the after_apply_guidance field of the given pool_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 pool_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 pool_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 pool_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 pool_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

applyAsync

public Task applyAsync(Connection c,
                       Host host)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Apply the selected patch to a host and return its output

Parameters:
host - The host to apply the patch too
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

apply

public String apply(Connection c,
                    Host host)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Apply the selected patch to a host and return its output

Parameters:
host - The host to apply the patch too
Returns:
the output of the patch application process
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

poolApplyAsync

public Task poolApplyAsync(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output

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

poolApply

public void poolApply(Connection c)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Apply the selected patch to all hosts in the pool and return a map of host_ref -> patch output

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

precheckAsync

public Task precheckAsync(Connection c,
                          Host host)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Execute the precheck stage of the selected patch on a host and return its output

Parameters:
host - The host to run the prechecks on
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

precheck

public String precheck(Connection c,
                       Host host)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Execute the precheck stage of the selected patch on a host and return its output

Parameters:
host - The host to run the prechecks on
Returns:
the output of the patch prechecks
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

cleanAsync

public Task cleanAsync(Connection c)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Removes the patch's files from all hosts in the pool, but does not remove the database entries

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

clean

public void clean(Connection c)
           throws Types.BadServerResponse,
                  Types.XenAPIException,
                  org.apache.xmlrpc.XmlRpcException
Removes the patch's files from all hosts in the pool, but does not remove the database entries

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

destroyAsync

public Task destroyAsync(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Removes the patch's files from all hosts in the pool, and removes the database entries. Only works on unapplied patches.

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

destroy

public void destroy(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Removes the patch's files from all hosts in the pool, and removes the database entries. Only works on unapplied patches.

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

getAll

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

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

getAllRecords

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

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