blob: 80d178113af6d6e97226c1261619ada5199a2e1f [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 Radoslavov909da3c2014-01-09 04:04:33 -080012import net.onrc.onos.ofcontroller.util.Dpid;
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070013import net.onrc.onos.ofcontroller.util.FlowEntry;
14import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070015import net.onrc.onos.ofcontroller.util.FlowId;
16import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -080017import net.onrc.onos.ofcontroller.util.Pair;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070018
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070019/**
20 * Interface for providing Datagrid Service to other modules.
21 */
22public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070023 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070024 * Register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070025 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070026 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070027 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070028 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070029 * @param flowEventHandlerService the Flow Event Handler Service to register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070030 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070031 void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070032
33 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070034 * De-register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070035 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070036 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070037 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070038 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070039 * @param flowEventHandlerService the Flow Event Handler Service to
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070040 * de-register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070041 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070042 void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070043
44 /**
Jonathan Hartc6325622014-01-14 16:37:50 -080045 * Register event handler for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080046 *
Jonathan Hartc6325622014-01-14 16:37:50 -080047 * @param packetOutEventHandler The packet-out event handler to register.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080048 */
Jonathan Hartc6325622014-01-14 16:37:50 -080049 public void registerPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart18ad55c2013-11-11 22:49:55 -080050
51 /**
Jonathan Hartc6325622014-01-14 16:37:50 -080052 * Deregister event handler service for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080053 *
Jonathan Hartc6325622014-01-14 16:37:50 -080054 * @param packetOutEventHandler The packet-out event handler to deregister.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080055 */
Jonathan Hartc6325622014-01-14 16:37:50 -080056 public void deregisterPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart7804bea2014-01-07 10:50:52 -080057
Jonathan Hartc6325622014-01-14 16:37:50 -080058 /**
59 * Register event handler for ARP reply events.
60 *
61 * @param packetOutEventHandler The ARP reply event handler to register.
62 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080063 public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
64
Jonathan Hartc6325622014-01-14 16:37:50 -080065 /**
66 * Deregister event handler service for ARP reply events.
67 *
68 * @param packetOutEventHandler The ARP reply event handler to deregister.
69 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080070 public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080071
Jonathan Hart18ad55c2013-11-11 22:49:55 -080072 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070073 * Get all Flows that are currently in the datagrid.
74 *
75 * @return all Flows that are currently in the datagrid.
76 */
77 Collection<FlowPath> getAllFlows();
78
79 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080080 * Get a Flow for a given Flow ID.
81 *
82 * @param flowId the Flow ID of the Flow to get.
83 * @return the Flow if found, otherwise null.
84 */
85 FlowPath getFlow(FlowId flowId);
86
87 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070088 * Send a notification that a Flow is added.
89 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070090 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070091 */
92 void notificationSendFlowAdded(FlowPath flowPath);
93
94 /**
95 * Send a notification that a Flow is removed.
96 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070097 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070098 */
99 void notificationSendFlowRemoved(FlowId flowId);
100
101 /**
102 * Send a notification that a Flow is updated.
103 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700104 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700105 */
106 void notificationSendFlowUpdated(FlowPath flowPath);
107
108 /**
109 * Send a notification that all Flows are removed.
110 */
111 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700112
113 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700114 * Get all Flow Entries that are currently in the datagrid.
115 *
116 * @return all Flow Entries that are currently in the datagrid.
117 */
118 Collection<FlowEntry> getAllFlowEntries();
119
120 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800121 * Get a Flow Entry for a given Flow Entry ID.
122 *
123 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
124 * @return the Flow Entry if found, otherwise null.
125 */
126 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
127
128 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700129 * Send a notification that a FlowEntry is added.
130 *
131 * @param flowEntry the FlowEntry that is added.
132 */
133 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
134
135 /**
136 * Send a notification that a FlowEntry is removed.
137 *
138 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
139 */
140 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
141
142 /**
143 * Send a notification that a FlowEntry is updated.
144 *
145 * @param flowEntry the FlowEntry that is updated.
146 */
147 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
148
149 /**
150 * Send a notification that all Flow Entries are removed.
151 */
152 void notificationSendAllFlowEntriesRemoved();
153
154 /**
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800155 * Get all Flow IDs that are currently in the datagrid.
156 *
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -0800157 * @return all Flow IDs that ae currently in the datagrid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800158 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800159 Collection<Pair<FlowId, Dpid>> getAllFlowIds();
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800160
161 /**
162 * Send a notification that a FlowId is added.
163 *
164 * @param flowId the FlowId that is added.
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800165 * @param dpid the Source Switch Dpid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800166 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800167 void notificationSendFlowIdAdded(FlowId flowId, Dpid dpid);
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800168
169 /**
170 * Send a notification that a FlowId is removed.
171 *
172 * @param flowId the FlowId that is removed.
173 */
174 void notificationSendFlowIdRemoved(FlowId flowId);
175
176 /**
177 * Send a notification that a FlowId is updated.
178 *
179 * @param flowId the FlowId that is updated.
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800180 * @param dpid the Source Switch Dpid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800181 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800182 void notificationSendFlowIdUpdated(FlowId flowId, Dpid dpid);
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800183
184 /**
185 * Send a notification that all Flow IDs are removed.
186 */
187 void notificationSendAllFlowIdsRemoved();
188
189 /**
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -0800190 * Get all Flow Entry IDs that are currently in the datagrid.
191 *
192 * @return all Flow Entry IDs that ae currently in the datagrid.
193 */
194 Collection<Pair<FlowEntryId, Dpid>> getAllFlowEntryIds();
195
196 /**
Pavlin Radoslavov909da3c2014-01-09 04:04:33 -0800197 * Send a notification that a FlowEntryId is added.
198 *
199 * @param flowEntryId the FlowEntryId that is added.
200 * @param dpid the Switch Dpid.
201 */
202 void notificationSendFlowEntryIdAdded(FlowEntryId flowEntryId, Dpid dpid);
203
204 /**
205 * Send a notification that a FlowEntryId is removed.
206 *
207 * @param flowEntryId the FlowEntryId that is removed.
208 */
209 void notificationSendFlowEntryIdRemoved(FlowEntryId flowEntryId);
210
211 /**
212 * Send a notification that a FlowEntryId is updated.
213 *
214 * @param flowEntryId the FlowEntryId that is updated.
215 * @param dpid the Switch Dpid.
216 */
217 void notificationSendFlowEntryIdUpdated(FlowEntryId flowEntryId,
218 Dpid dpid);
219
220 /**
221 * Send a notification that all Flow Entry IDs are removed.
222 */
223 void notificationSendAllFlowEntryIdsRemoved();
224
225 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700226 * Get all Topology Elements that are currently in the datagrid.
227 *
228 * @return all Topology Elements that are currently in the datagrid.
229 */
230 Collection<TopologyElement> getAllTopologyElements();
231
232 /**
233 * Send a notification that a Topology Element is added.
234 *
235 * @param topologyElement the Topology Element that is added.
236 */
237 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
238
239 /**
240 * Send a notification that a Topology Element is removed.
241 *
242 * @param topologyElement the Topology Element that is removed.
243 */
244 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
245
246 /**
247 * Send a notification that a Topology Element is updated.
248 *
249 * @param topologyElement the Topology Element that is updated.
250 */
251 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
252
253 /**
254 * Send a notification that all Topology Elements are removed.
255 */
256 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800257
258 /**
Jonathan Hart7804bea2014-01-07 10:50:52 -0800259 * Send a packet-out notification to other ONOS instances. This informs
260 * other instances that they should send this packet out some of the ports
261 * they control. Not all notifications are applicable to all instances
262 * (i.e. some notifications specify a single port to send the packet out),
263 * so each instance must determine whether it needs to take action when it
264 * receives the notification.
265 *
266 * @param packetOutNotification The packet notification to send
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800267 */
Jonathan Hart7804bea2014-01-07 10:50:52 -0800268 public void sendPacketOutNotification(PacketOutNotification packetOutNotification);
269
270 /**
271 * Send notification to other ONOS instances that an ARP reply has been
272 * received.
273 * @param arpReply The notification of the ARP reply
274 */
275 public void sendArpReplyNotification(ArpReplyNotification arpReply);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700276}