blob: 5fe52cc192576ec8f5709a5a65537f4f49581905 [file] [log] [blame]
Jonathan Hart6df90172014-04-03 10:13:11 -07001package net.onrc.onos.core.datagrid;
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07002
3import net.floodlightcontroller.core.module.IFloodlightService;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -07004
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07005/**
6 * Interface for providing Datagrid Service to other modules.
7 */
8public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov7940b652014-02-13 19:42:05 -08009 /**
10 * Create an event channel.
Ray Milkey9c8a2132014-04-02 15:16:42 -070011 * <p/>
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080012 * If the channel already exists, just return it.
13 * NOTE: The channel is started automatically.
14 *
15 * @param channelName the event channel name.
Ray Milkey9c8a2132014-04-02 15:16:42 -070016 * @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 Radoslavov7940b652014-02-13 19:42:05 -080018 * @return the event channel for the channel name.
19 */
20 <K, V> IEventChannel<K, V> createChannel(String channelName,
Ray Milkey9c8a2132014-04-02 15:16:42 -070021 Class<K> typeK, Class<V> typeV);
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080022
23 /**
24 * Add event channel listener.
Ray Milkey9c8a2132014-04-02 15:16:42 -070025 * <p/>
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080026 * NOTE: The channel is started automatically right after the listener
27 * is added.
28 *
29 * @param channelName the event channel name.
Ray Milkey9c8a2132014-04-02 15:16:42 -070030 * @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 Radoslavov7940b652014-02-13 19:42:05 -080033 * @return the event channel for the channel name.
34 */
35 <K, V> IEventChannel<K, V> addListener(String channelName,
Ray Milkey9c8a2132014-04-02 15:16:42 -070036 IEventChannelListener<K, V> listener,
37 Class<K> typeK, Class<V> typeV);
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080038
39 /**
40 * Remove event channel listener.
41 *
42 * @param channelName the event channel name.
Ray Milkey9c8a2132014-04-02 15:16:42 -070043 * @param listener the listener to remove.
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080044 */
45 <K, V> void removeListener(String channelName,
Ray Milkey9c8a2132014-04-02 15:16:42 -070046 IEventChannelListener<K, V> listener);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070047}