Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

EventBus shall expose subscribe interface method to which a subscribed subscriber (which needs to be a component running in management server) can register for call backs when an event occurs.  Intended subscriber shall implement EventSubscriber interface as described below.

Code Block
public interface EventSubscriber {
    /**
     * Callback method. EventBus calls this method on occurrence of subscribed event
     *
     * @param event details of the event
     */
    void onEvent(Event event);
}

 

Subscribe method of EventBus interface shall take two parameters as described below one to provide the subscribe which will receive the call back and other parameter to define topics to which subscriber wants to subscribe to.

subscribe(EventTopic topic, EventSubscriber subscriber) throws EventBusException;

 

EventTopic shall have structure as described below. 

Code Block
public class EventTopic {
    String eventCategory; // describes the category of event subscriber is interested in, which can be 'ActionEvent', 'AlertEvent', 'UsageEvent', 'ResourceStateEvent', 'AsyncJobEvent'
    String eventType;     // describes the type of the event with the event category subscriber is interested in. For e.g for an events of category 'ActionEvent' type could be VM.START, VM.STOP etc
    String resourceType;  // describes the type of the resource for which event generated. E.g.) VirtualMachine, Network, Volume, SnapShot etc.
    String resourceUUID;  // described the UUID of the resource for which event is generated
    String eventSource;  // source of the event, what component of management server generated the events, plug-in which generated event etc
}