com.xensource.xenapi
Class Message

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

public class Message
extends XenAPIObject

An message for the attention of the administrator


Nested Class Summary
static class Message.Record
          Represents all the fields in a Message
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
static Message create(Connection c, String name, Long priority, Types.Cls cls, String objUuid, String body)
           
 void destroy(Connection c)
           
 boolean equals(Object obj)
          If obj is a Message, compares XenAPI references for equality.
static Map<Message,Message.Record> get(Connection c, Types.Cls cls, String objUuid, Date since)
           
static Set<Message> getAll(Connection c)
           
static Map<Message,Message.Record> getAllRecords(Connection c)
           
static Map<Message,Message.Record> getAllRecordsWhere(Connection c, String expr)
           
static Message getByUuid(Connection c, String uuid)
           
 Message.Record getRecord(Connection c)
           
static Map<Message,Message.Record> getSince(Connection c, Date since)
           
 int hashCode()
           
 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 Message, compares XenAPI references for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

create

public static Message create(Connection c,
                             String name,
                             Long priority,
                             Types.Cls cls,
                             String objUuid,
                             String body)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Parameters:
name - The name of the message
priority - The priority of the message
cls - The class of object this message is associated with
objUuid - The uuid of the object this message is associated with
body - The body of the message
Returns:
The reference of the created message
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroy

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

get

public static Map<Message,Message.Record> get(Connection c,
                                              Types.Cls cls,
                                              String objUuid,
                                              Date since)
                                       throws Types.BadServerResponse,
                                              Types.XenAPIException,
                                              org.apache.xmlrpc.XmlRpcException
Parameters:
cls - The class of object
objUuid - The uuid of the object
since - The cutoff time
Returns:
The relevant messages
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static Set<Message> getAll(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Returns:
The references to the messages
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSince

public static Map<Message,Message.Record> getSince(Connection c,
                                                   Date since)
                                            throws Types.BadServerResponse,
                                                   Types.XenAPIException,
                                                   org.apache.xmlrpc.XmlRpcException
Parameters:
since - The cutoff time
Returns:
The relevant messages
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getRecord

public Message.Record getRecord(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Returns:
The message record
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByUuid

public static Message getByUuid(Connection c,
                                String uuid)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Parameters:
uuid - The uuid of the message
Returns:
The message reference
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllRecords

public static Map<Message,Message.Record> getAllRecords(Connection c)
                                                 throws Types.BadServerResponse,
                                                        Types.XenAPIException,
                                                        org.apache.xmlrpc.XmlRpcException
Returns:
The messages
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllRecordsWhere

public static Map<Message,Message.Record> getAllRecordsWhere(Connection c,
                                                             String expr)
                                                      throws Types.BadServerResponse,
                                                             Types.XenAPIException,
                                                             org.apache.xmlrpc.XmlRpcException
Parameters:
expr - The expression to match (not currently used)
Returns:
The messages
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException