blob: cfc10bc12539fdc448196f7e8f81d3496b68b04b [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 */
143 Collection<FlowId> getAllFlowIds();
144
145 /**
146 * Send a notification that a FlowId is added.
147 *
148 * @param flowId the FlowId that is added.
149 */
150 void notificationSendFlowIdAdded(FlowId flowId);
151
152 /**
153 * Send a notification that a FlowId is removed.
154 *
155 * @param flowId the FlowId that is removed.
156 */
157 void notificationSendFlowIdRemoved(FlowId flowId);
158
159 /**
160 * Send a notification that a FlowId is updated.
161 *
162 * @param flowId the FlowId that is updated.
163 */
164 void notificationSendFlowIdUpdated(FlowId flowId);
165
166 /**
167 * Send a notification that all Flow IDs are removed.
168 */
169 void notificationSendAllFlowIdsRemoved();
170
171 /**
Pavlin Radoslavova9c0c3b2014-01-09 10:54:45 -0800172 * Get all Flow Entry IDs that are currently in the datagrid.
173 *
174 * @return all Flow Entry IDs that ae currently in the datagrid.
175 */
176 Collection<Pair<FlowEntryId, Dpid>> getAllFlowEntryIds();
177
178 /**
Pavlin Radoslavov909da3c2014-01-09 04:04:33 -0800179 * Send a notification that a FlowEntryId is added.
180 *
181 * @param flowEntryId the FlowEntryId that is added.
182 * @param dpid the Switch Dpid.
183 */
184 void notificationSendFlowEntryIdAdded(FlowEntryId flowEntryId, Dpid dpid);
185
186 /**
187 * Send a notification that a FlowEntryId is removed.
188 *
189 * @param flowEntryId the FlowEntryId that is removed.
190 */
191 void notificationSendFlowEntryIdRemoved(FlowEntryId flowEntryId);
192
193 /**
194 * Send a notification that a FlowEntryId is updated.
195 *
196 * @param flowEntryId the FlowEntryId that is updated.
197 * @param dpid the Switch Dpid.
198 */
199 void notificationSendFlowEntryIdUpdated(FlowEntryId flowEntryId,
200 Dpid dpid);
201
202 /**
203 * Send a notification that all Flow Entry IDs are removed.
204 */
205 void notificationSendAllFlowEntryIdsRemoved();
206
207 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700208 * Get all Topology Elements that are currently in the datagrid.
209 *
210 * @return all Topology Elements that are currently in the datagrid.
211 */
212 Collection<TopologyElement> getAllTopologyElements();
213
214 /**
215 * Send a notification that a Topology Element is added.
216 *
217 * @param topologyElement the Topology Element that is added.
218 */
219 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
220
221 /**
222 * Send a notification that a Topology Element is removed.
223 *
224 * @param topologyElement the Topology Element that is removed.
225 */
226 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
227
228 /**
229 * Send a notification that a Topology Element is updated.
230 *
231 * @param topologyElement the Topology Element that is updated.
232 */
233 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
234
235 /**
236 * Send a notification that all Topology Elements are removed.
237 */
238 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800239
240 /**
241 * Send an ARP request to other ONOS instances
242 * @param arpRequest The request packet to send
243 */
pingping-lin017a8922013-12-11 11:15:33 +0800244 public void sendArpRequest(ArpMessage arpMessage);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700245}