Jonathan Hart | 6df9017 | 2014-04-03 10:13:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.datagrid; |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 2 | |
| 3 | import net.floodlightcontroller.core.module.IFloodlightService; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 4 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 5 | /** |
| 6 | * Interface for providing Datagrid Service to other modules. |
| 7 | */ |
| 8 | public interface IDatagridService extends IFloodlightService { |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 9 | /** |
| 10 | * Create an event channel. |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 11 | * <p/> |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 12 | * If the channel already exists, just return it. |
| 13 | * NOTE: The channel is started automatically. |
| 14 | * |
| 15 | * @param channelName the event channel name. |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 16 | * @param typeK the type of the Key in the Key-Value store. |
| 17 | * @param typeV the type of the Value in the Key-Value store. |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 18 | * @return the event channel for the channel name. |
| 19 | */ |
| 20 | <K, V> IEventChannel<K, V> createChannel(String channelName, |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 21 | Class<K> typeK, Class<V> typeV); |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Add event channel listener. |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 25 | * <p/> |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 26 | * NOTE: The channel is started automatically right after the listener |
| 27 | * is added. |
| 28 | * |
| 29 | * @param channelName the event channel name. |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 30 | * @param listener the listener to add. |
| 31 | * @param typeK the type of the Key in the Key-Value store. |
| 32 | * @param typeV the type of the Value in the Key-Value store. |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 33 | * @return the event channel for the channel name. |
| 34 | */ |
| 35 | <K, V> IEventChannel<K, V> addListener(String channelName, |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 36 | IEventChannelListener<K, V> listener, |
| 37 | Class<K> typeK, Class<V> typeV); |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * Remove event channel listener. |
| 41 | * |
| 42 | * @param channelName the event channel name. |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 43 | * @param listener the listener to remove. |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 44 | */ |
| 45 | <K, V> void removeListener(String channelName, |
Ray Milkey | 9c8a213 | 2014-04-02 15:16:42 -0700 | [diff] [blame] | 46 | IEventChannelListener<K, V> listener); |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 47 | } |