blob: 1045bcd3d752cba0b44cb40e454e309bc31f3277 [file] [log] [blame]
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07001package net.onrc.onos.datagrid;
2
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -07003import java.util.Collection;
4
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07005import net.floodlightcontroller.core.module.IFloodlightService;
Toshio Koide3738ee52014-02-12 14:57:39 -08006import net.onrc.onos.intent.Intent;
TeruU80ce5062014-03-03 17:16:13 -08007import net.onrc.onos.ofcontroller.devicemanager.IDeviceEventHandler;
8import net.onrc.onos.ofcontroller.devicemanager.OnosDevice;
Jonathan Hart7804bea2014-01-07 10:50:52 -08009import net.onrc.onos.ofcontroller.proxyarp.ArpReplyNotification;
10import net.onrc.onos.ofcontroller.proxyarp.IArpReplyEventHandler;
11import net.onrc.onos.ofcontroller.proxyarp.IPacketOutEventHandler;
12import net.onrc.onos.ofcontroller.proxyarp.PacketOutNotification;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070013
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070014/**
15 * Interface for providing Datagrid Service to other modules.
16 */
17public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov7940b652014-02-13 19:42:05 -080018 /**
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 Koide3738ee52014-02-12 14:57:39 -080057 /*
58 * register all the intents as one batch
59 */
60 void registerIntent(Collection<Intent> intents);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070061
62 /**
Jonathan Hartc6325622014-01-14 16:37:50 -080063 * Register event handler for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080064 *
Jonathan Hartc6325622014-01-14 16:37:50 -080065 * @param packetOutEventHandler The packet-out event handler to register.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080066 */
Jonathan Hartc6325622014-01-14 16:37:50 -080067 public void registerPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart18ad55c2013-11-11 22:49:55 -080068
69 /**
Jonathan Hartc6325622014-01-14 16:37:50 -080070 * Deregister event handler service for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080071 *
Jonathan Hartc6325622014-01-14 16:37:50 -080072 * @param packetOutEventHandler The packet-out event handler to deregister.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080073 */
Jonathan Hartc6325622014-01-14 16:37:50 -080074 public void deregisterPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart7804bea2014-01-07 10:50:52 -080075
Jonathan Hartc6325622014-01-14 16:37:50 -080076 /**
77 * Register event handler for ARP reply events.
78 *
79 * @param packetOutEventHandler The ARP reply event handler to register.
80 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080081 public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
82
Jonathan Hartc6325622014-01-14 16:37:50 -080083 /**
84 * Deregister event handler service for ARP reply events.
85 *
86 * @param packetOutEventHandler The ARP reply event handler to deregister.
87 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080088 public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080089
Jonathan Hart18ad55c2013-11-11 22:49:55 -080090 /**
Jonathan Hart7804bea2014-01-07 10:50:52 -080091 * 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 Hart18ad55c2013-11-11 22:49:55 -080099 */
Jonathan Hart7804bea2014-01-07 10:50:52 -0800100 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);
TeruU80ce5062014-03-03 17:16:13 -0800108
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 Radoslavov1eee2c82013-10-15 02:30:32 -0700117}