blob: a855798aca3490684b7b7eb14d5cf2fb1e19cfd8 [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 Hartd3003252013-11-15 09:44:46 -08007import net.onrc.onos.ofcontroller.proxyarp.ArpMessage;
Jonathan Hart18ad55c2013-11-11 22:49:55 -08008import net.onrc.onos.ofcontroller.proxyarp.IArpEventHandler;
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -07009import net.onrc.onos.ofcontroller.topology.TopologyElement;
Pavlin Radoslavov909da3c2014-01-09 04:04:33 -080010import net.onrc.onos.ofcontroller.util.Dpid;
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070011import net.onrc.onos.ofcontroller.util.FlowEntry;
12import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070013import net.onrc.onos.ofcontroller.util.FlowId;
14import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -080015import net.onrc.onos.ofcontroller.util.Pair;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070016
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 */
47 public void registerArpEventHandler(IArpEventHandler arpEventHandler);
48
49 /**
50 * De-register event handler service for ARP events.
51 *
52 * @param arpEventHandler The ARP event handler to de-register.
53 */
54 public void deregisterArpEventHandler(IArpEventHandler arpEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080055
Jonathan Hart18ad55c2013-11-11 22:49:55 -080056 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070057 * Get all Flows that are currently in the datagrid.
58 *
59 * @return all Flows that are currently in the datagrid.
60 */
61 Collection<FlowPath> getAllFlows();
62
63 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080064 * Get a Flow for a given Flow ID.
65 *
66 * @param flowId the Flow ID of the Flow to get.
67 * @return the Flow if found, otherwise null.
68 */
69 FlowPath getFlow(FlowId flowId);
70
71 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070072 * Send a notification that a Flow is added.
73 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070074 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070075 */
76 void notificationSendFlowAdded(FlowPath flowPath);
77
78 /**
79 * Send a notification that a Flow is removed.
80 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070081 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070082 */
83 void notificationSendFlowRemoved(FlowId flowId);
84
85 /**
86 * Send a notification that a Flow is updated.
87 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070088 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070089 */
90 void notificationSendFlowUpdated(FlowPath flowPath);
91
92 /**
93 * Send a notification that all Flows are removed.
94 */
95 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070096
97 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070098 * Get all Flow Entries that are currently in the datagrid.
99 *
100 * @return all Flow Entries that are currently in the datagrid.
101 */
102 Collection<FlowEntry> getAllFlowEntries();
103
104 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800105 * Get a Flow Entry for a given Flow Entry ID.
106 *
107 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
108 * @return the Flow Entry if found, otherwise null.
109 */
110 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
111
112 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700113 * Send a notification that a FlowEntry is added.
114 *
115 * @param flowEntry the FlowEntry that is added.
116 */
117 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
118
119 /**
120 * Send a notification that a FlowEntry is removed.
121 *
122 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
123 */
124 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
125
126 /**
127 * Send a notification that a FlowEntry is updated.
128 *
129 * @param flowEntry the FlowEntry that is updated.
130 */
131 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
132
133 /**
134 * Send a notification that all Flow Entries are removed.
135 */
136 void notificationSendAllFlowEntriesRemoved();
137
138 /**
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800139 * Get all Flow IDs that are currently in the datagrid.
140 *
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -0800141 * @return all Flow IDs that ae currently in the datagrid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800142 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800143 Collection<Pair<FlowId, Dpid>> getAllFlowIds();
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800144
145 /**
146 * Send a notification that a FlowId is added.
147 *
148 * @param flowId the FlowId that is added.
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800149 * @param dpid the Source Switch Dpid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800150 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800151 void notificationSendFlowIdAdded(FlowId flowId, Dpid dpid);
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800152
153 /**
154 * Send a notification that a FlowId is removed.
155 *
156 * @param flowId the FlowId that is removed.
157 */
158 void notificationSendFlowIdRemoved(FlowId flowId);
159
160 /**
161 * Send a notification that a FlowId is updated.
162 *
163 * @param flowId the FlowId that is updated.
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800164 * @param dpid the Source Switch Dpid.
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800165 */
Pavlin Radoslavov2194d112014-01-10 13:36:00 -0800166 void notificationSendFlowIdUpdated(FlowId flowId, Dpid dpid);
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800167
168 /**
169 * Send a notification that all Flow IDs are removed.
170 */
171 void notificationSendAllFlowIdsRemoved();
172
173 /**
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -0800174 * Get all Flow Entry IDs that are currently in the datagrid.
175 *
176 * @return all Flow Entry IDs that ae currently in the datagrid.
177 */
178 Collection<Pair<FlowEntryId, Dpid>> getAllFlowEntryIds();
179
180 /**
Pavlin Radoslavov909da3c2014-01-09 04:04:33 -0800181 * Send a notification that a FlowEntryId is added.
182 *
183 * @param flowEntryId the FlowEntryId that is added.
184 * @param dpid the Switch Dpid.
185 */
186 void notificationSendFlowEntryIdAdded(FlowEntryId flowEntryId, Dpid dpid);
187
188 /**
189 * Send a notification that a FlowEntryId is removed.
190 *
191 * @param flowEntryId the FlowEntryId that is removed.
192 */
193 void notificationSendFlowEntryIdRemoved(FlowEntryId flowEntryId);
194
195 /**
196 * Send a notification that a FlowEntryId is updated.
197 *
198 * @param flowEntryId the FlowEntryId that is updated.
199 * @param dpid the Switch Dpid.
200 */
201 void notificationSendFlowEntryIdUpdated(FlowEntryId flowEntryId,
202 Dpid dpid);
203
204 /**
205 * Send a notification that all Flow Entry IDs are removed.
206 */
207 void notificationSendAllFlowEntryIdsRemoved();
208
209 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700210 * Get all Topology Elements that are currently in the datagrid.
211 *
212 * @return all Topology Elements that are currently in the datagrid.
213 */
214 Collection<TopologyElement> getAllTopologyElements();
215
216 /**
217 * Send a notification that a Topology Element is added.
218 *
219 * @param topologyElement the Topology Element that is added.
220 */
221 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
222
223 /**
224 * Send a notification that a Topology Element is removed.
225 *
226 * @param topologyElement the Topology Element that is removed.
227 */
228 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
229
230 /**
231 * Send a notification that a Topology Element is updated.
232 *
233 * @param topologyElement the Topology Element that is updated.
234 */
235 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
236
237 /**
238 * Send a notification that all Topology Elements are removed.
239 */
240 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800241
242 /**
243 * Send an ARP request to other ONOS instances
244 * @param arpRequest The request packet to send
245 */
pingping-lin017a8922013-12-11 11:15:33 +0800246 public void sendArpRequest(ArpMessage arpMessage);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700247}