blob: 90fe57cbe9346faae01a497b78951700923dea39 [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;
Pavlin Radoslavov9a859022013-10-30 10:08:24 -07006import net.onrc.onos.ofcontroller.flowmanager.IFlowEventHandlerService;
Jonathan Hart7804bea2014-01-07 10:50:52 -08007import net.onrc.onos.ofcontroller.proxyarp.ArpReplyNotification;
8import net.onrc.onos.ofcontroller.proxyarp.IArpReplyEventHandler;
9import net.onrc.onos.ofcontroller.proxyarp.IPacketOutEventHandler;
10import net.onrc.onos.ofcontroller.proxyarp.PacketOutNotification;
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070011import net.onrc.onos.ofcontroller.topology.TopologyElement;
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070012import net.onrc.onos.ofcontroller.util.FlowEntry;
13import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070014import net.onrc.onos.ofcontroller.util.FlowId;
15import net.onrc.onos.ofcontroller.util.FlowPath;
16
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070017/**
18 * Interface for providing Datagrid Service to other modules.
19 */
20public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070021 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070022 * Register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070023 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070024 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070025 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070026 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070027 * @param flowEventHandlerService the Flow Event Handler Service to register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070028 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070029 void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070030
31 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070032 * De-register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070033 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070034 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070035 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070036 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070037 * @param flowEventHandlerService the Flow Event Handler Service to
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070038 * de-register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070039 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070040 void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070041
42 /**
Jonathan Hart18ad55c2013-11-11 22:49:55 -080043 * Register event handler for ARP events.
44 *
45 * @param arpEventHandler The ARP event handler to register.
46 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080047 public void registerPacketOutEventHandler(IPacketOutEventHandler arpEventHandler);
Jonathan Hart18ad55c2013-11-11 22:49:55 -080048
49 /**
50 * De-register event handler service for ARP events.
51 *
52 * @param arpEventHandler The ARP event handler to de-register.
53 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080054 public void deregisterPacketOutEventHandler(IPacketOutEventHandler arpEventHandler);
55
56 public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
57
58 public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080059
Jonathan Hart18ad55c2013-11-11 22:49:55 -080060 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070061 * Get all Flows that are currently in the datagrid.
62 *
63 * @return all Flows that are currently in the datagrid.
64 */
65 Collection<FlowPath> getAllFlows();
66
67 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080068 * Get a Flow for a given Flow ID.
69 *
70 * @param flowId the Flow ID of the Flow to get.
71 * @return the Flow if found, otherwise null.
72 */
73 FlowPath getFlow(FlowId flowId);
74
75 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070076 * Send a notification that a Flow is added.
77 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070078 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070079 */
80 void notificationSendFlowAdded(FlowPath flowPath);
81
82 /**
83 * Send a notification that a Flow is removed.
84 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070085 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070086 */
87 void notificationSendFlowRemoved(FlowId flowId);
88
89 /**
90 * Send a notification that a Flow is updated.
91 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070092 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070093 */
94 void notificationSendFlowUpdated(FlowPath flowPath);
95
96 /**
97 * Send a notification that all Flows are removed.
98 */
99 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700100
101 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700102 * Get all Flow Entries that are currently in the datagrid.
103 *
104 * @return all Flow Entries that are currently in the datagrid.
105 */
106 Collection<FlowEntry> getAllFlowEntries();
107
108 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800109 * Get a Flow Entry for a given Flow Entry ID.
110 *
111 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
112 * @return the Flow Entry if found, otherwise null.
113 */
114 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
115
116 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700117 * Send a notification that a FlowEntry is added.
118 *
119 * @param flowEntry the FlowEntry that is added.
120 */
121 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
122
123 /**
124 * Send a notification that a FlowEntry is removed.
125 *
126 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
127 */
128 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
129
130 /**
131 * Send a notification that a FlowEntry is updated.
132 *
133 * @param flowEntry the FlowEntry that is updated.
134 */
135 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
136
137 /**
138 * Send a notification that all Flow Entries are removed.
139 */
140 void notificationSendAllFlowEntriesRemoved();
141
142 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700143 * Get all Topology Elements that are currently in the datagrid.
144 *
145 * @return all Topology Elements that are currently in the datagrid.
146 */
147 Collection<TopologyElement> getAllTopologyElements();
148
149 /**
150 * Send a notification that a Topology Element is added.
151 *
152 * @param topologyElement the Topology Element that is added.
153 */
154 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
155
156 /**
157 * Send a notification that a Topology Element is removed.
158 *
159 * @param topologyElement the Topology Element that is removed.
160 */
161 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
162
163 /**
164 * Send a notification that a Topology Element is updated.
165 *
166 * @param topologyElement the Topology Element that is updated.
167 */
168 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
169
170 /**
171 * Send a notification that all Topology Elements are removed.
172 */
173 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800174
175 /**
Jonathan Hart7804bea2014-01-07 10:50:52 -0800176 * Send a packet-out notification to other ONOS instances. This informs
177 * other instances that they should send this packet out some of the ports
178 * they control. Not all notifications are applicable to all instances
179 * (i.e. some notifications specify a single port to send the packet out),
180 * so each instance must determine whether it needs to take action when it
181 * receives the notification.
182 *
183 * @param packetOutNotification The packet notification to send
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800184 */
Jonathan Hart7804bea2014-01-07 10:50:52 -0800185 public void sendPacketOutNotification(PacketOutNotification packetOutNotification);
186
187 /**
188 * Send notification to other ONOS instances that an ARP reply has been
189 * received.
190 * @param arpReply The notification of the ARP reply
191 */
192 public void sendArpReplyNotification(ArpReplyNotification arpReply);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700193}