blob: 7be956251c991b3023ecf44fc096afef46b11b2d [file] [log] [blame]
tomd7356722014-08-26 01:07:39 -07001package org.onlab.onos.event;
2
3import java.util.Set;
4
5/**
6 * Abstraction of an event sink broker capable of tracking sinks based on
7 * their event class.
8 */
9public interface EventSinkBroker {
10
11 /**
12 * Adds the specified sink for the given event class.
13 *
14 * @param eventClass event class
15 * @param sink event sink
16 * @param <E> type of event
17 */
18 <E extends Event> void addSink(Class<E> eventClass, EventSink<E> sink);
19
20 /**
21 * Removes the sink associated with the given event class.
22 *
23 * @param eventClass event class
24 * @param <E> type of event
25 */
26 <E extends Event> void removeSink(Class<E> eventClass);
27
28 /**
29 * Returns the event sink associated with the specified event class.
30 *
31 * @param eventClass event class
32 * @param <E> type of event
33 * @return event sink or null if none found
34 */
35 <E extends Event> EventSink<E> getSink(Class<E> eventClass);
36
37 /**
38 * Returns the set of all event classes for which sinks are presently
39 * registered.
40 *
41 * @return set of event classes
42 */
43 Set<Class<? extends Event>> getSinks();
44
45}