Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 1 | package net.onrc.onos.datagrid; |
| 2 | |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 3 | import java.util.Collection; |
| 4 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 5 | import net.floodlightcontroller.core.module.IFloodlightService; |
Toshio Koide | 3738ee5 | 2014-02-12 14:57:39 -0800 | [diff] [blame] | 6 | import net.onrc.onos.intent.Intent; |
TeruU | 80ce506 | 2014-03-03 17:16:13 -0800 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.devicemanager.IDeviceEventHandler; |
| 8 | import net.onrc.onos.ofcontroller.devicemanager.OnosDevice; |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 9 | import net.onrc.onos.ofcontroller.proxyarp.ArpReplyNotification; |
| 10 | import net.onrc.onos.ofcontroller.proxyarp.IArpReplyEventHandler; |
| 11 | import net.onrc.onos.ofcontroller.proxyarp.IPacketOutEventHandler; |
| 12 | import net.onrc.onos.ofcontroller.proxyarp.PacketOutNotification; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 13 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 14 | /** |
| 15 | * Interface for providing Datagrid Service to other modules. |
| 16 | */ |
| 17 | public interface IDatagridService extends IFloodlightService { |
Pavlin Radoslavov | 7940b65 | 2014-02-13 19:42:05 -0800 | [diff] [blame] | 18 | /** |
| 19 | * Create an event channel. |
| 20 | * |
| 21 | * If the channel already exists, just return it. |
| 22 | * NOTE: The channel is started automatically. |
| 23 | * |
| 24 | * @param channelName the event channel name. |
| 25 | * @param typeK the type of the Key in the Key-Value store. |
| 26 | * @param typeV the type of the Value in the Key-Value store. |
| 27 | * @return the event channel for the channel name. |
| 28 | */ |
| 29 | <K, V> IEventChannel<K, V> createChannel(String channelName, |
| 30 | Class<K> typeK, Class<V> typeV); |
| 31 | |
| 32 | /** |
| 33 | * Add event channel listener. |
| 34 | * |
| 35 | * NOTE: The channel is started automatically right after the listener |
| 36 | * is added. |
| 37 | * |
| 38 | * @param channelName the event channel name. |
| 39 | * @param listener the listener to add. |
| 40 | * @param typeK the type of the Key in the Key-Value store. |
| 41 | * @param typeV the type of the Value in the Key-Value store. |
| 42 | * @return the event channel for the channel name. |
| 43 | */ |
| 44 | <K, V> IEventChannel<K, V> addListener(String channelName, |
| 45 | IEventChannelListener<K, V> listener, |
| 46 | Class<K> typeK, Class<V> typeV); |
| 47 | |
| 48 | /** |
| 49 | * Remove event channel listener. |
| 50 | * |
| 51 | * @param channelName the event channel name. |
| 52 | * @param listener the listener to remove. |
| 53 | */ |
| 54 | <K, V> void removeListener(String channelName, |
| 55 | IEventChannelListener<K, V> listener); |
| 56 | |
Toshio Koide | 3738ee5 | 2014-02-12 14:57:39 -0800 | [diff] [blame] | 57 | /* |
| 58 | * register all the intents as one batch |
| 59 | */ |
| 60 | void registerIntent(Collection<Intent> intents); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 63 | * Register event handler for packet-out events. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 64 | * |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 65 | * @param packetOutEventHandler The packet-out event handler to register. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 66 | */ |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 67 | public void registerPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler); |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 70 | * Deregister event handler service for packet-out events. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 71 | * |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 72 | * @param packetOutEventHandler The packet-out event handler to deregister. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 73 | */ |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 74 | public void deregisterPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler); |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 75 | |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 76 | /** |
| 77 | * Register event handler for ARP reply events. |
| 78 | * |
| 79 | * @param packetOutEventHandler The ARP reply event handler to register. |
| 80 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 81 | public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
| 82 | |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame] | 83 | /** |
| 84 | * Deregister event handler service for ARP reply events. |
| 85 | * |
| 86 | * @param packetOutEventHandler The ARP reply event handler to deregister. |
| 87 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 88 | public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 89 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 90 | /** |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 91 | * Send a packet-out notification to other ONOS instances. This informs |
| 92 | * other instances that they should send this packet out some of the ports |
| 93 | * they control. Not all notifications are applicable to all instances |
| 94 | * (i.e. some notifications specify a single port to send the packet out), |
| 95 | * so each instance must determine whether it needs to take action when it |
| 96 | * receives the notification. |
| 97 | * |
| 98 | * @param packetOutNotification The packet notification to send |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 99 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 100 | public void sendPacketOutNotification(PacketOutNotification packetOutNotification); |
| 101 | |
| 102 | /** |
| 103 | * Send notification to other ONOS instances that an ARP reply has been |
| 104 | * received. |
| 105 | * @param arpReply The notification of the ARP reply |
| 106 | */ |
| 107 | public void sendArpReplyNotification(ArpReplyNotification arpReply); |
TeruU | 80ce506 | 2014-03-03 17:16:13 -0800 | [diff] [blame] | 108 | |
| 109 | void sendNotificationDeviceAdded(Long mac, OnosDevice dev); |
| 110 | |
| 111 | void sendNotificationDeviceDeleted(OnosDevice dev); |
| 112 | |
| 113 | void registerMapDeviceEventHandler(IDeviceEventHandler deviceEventHandler); |
| 114 | |
| 115 | void deregisterMapDeviceEventHandler(IDeviceEventHandler deviceEventHandler); |
| 116 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 117 | } |