com.xensource.xenapi
Class Event

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

public class Event
extends Object

Asynchronous event registration and handling


Nested Class Summary
static class Event.Record
          Represents all the fields in a Event
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
static Map<Event,Event.Record> getAllRecords()
          Get all the Event Records at once, in a single XML RPC call
protected static Event getInstFromRef(String ref)
           
static Set<Event.Record> next()
          Blocking call which returns a (possibly empty) batch of events
static void register(Set<String> classes)
          Registers this session with the event system.
static void unregister(Set<String> classes)
          Unregisters this session with the event system
 
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 Event getInstFromRef(String ref)

register

public static void register(Set<String> classes)
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Registers this session with the event system. Specifying the empty list will register for all classes.

Parameters:
classes - register for events for the indicated classes
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

unregister

public static void unregister(Set<String> classes)
                       throws Types.BadServerResponse,
                              ConnectionHelper.NoConnectionOnThisThreadException,
                              XmlRpcException
Unregisters this session with the event system

Parameters:
classes - remove this session's registration for the indicated classes
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

next

public static Set<Event.Record> next()
                              throws Types.BadServerResponse,
                                     ConnectionHelper.NoConnectionOnThisThreadException,
                                     XmlRpcException,
                                     Types.SessionNotRegistered
Blocking call which returns a (possibly empty) batch of events

Returns:
the batch of events
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException
Types.SessionNotRegistered

getAllRecords

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

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