blob: 20a43d27eeb252741283e1716f72f08be1c165cb [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;
15
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070016/**
17 * Interface for providing Datagrid Service to other modules.
18 */
19public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070020 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070021 * Register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070022 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070023 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070024 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070025 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070026 * @param flowEventHandlerService the Flow Event Handler Service to register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070027 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070028 void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070029
30 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070031 * De-register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070032 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070033 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070034 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070035 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070036 * @param flowEventHandlerService the Flow Event Handler Service to
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070037 * de-register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070038 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070039 void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070040
41 /**
Jonathan Hart18ad55c2013-11-11 22:49:55 -080042 * Register event handler for ARP events.
43 *
44 * @param arpEventHandler The ARP event handler to register.
45 */
46 public void registerArpEventHandler(IArpEventHandler arpEventHandler);
47
48 /**
49 * De-register event handler service for ARP events.
50 *
51 * @param arpEventHandler The ARP event handler to de-register.
52 */
53 public void deregisterArpEventHandler(IArpEventHandler arpEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080054
Jonathan Hart18ad55c2013-11-11 22:49:55 -080055 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070056 * Get all Flows that are currently in the datagrid.
57 *
58 * @return all Flows that are currently in the datagrid.
59 */
60 Collection<FlowPath> getAllFlows();
61
62 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080063 * Get a Flow for a given Flow ID.
64 *
65 * @param flowId the Flow ID of the Flow to get.
66 * @return the Flow if found, otherwise null.
67 */
68 FlowPath getFlow(FlowId flowId);
69
70 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070071 * Send a notification that a Flow is added.
72 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070073 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070074 */
75 void notificationSendFlowAdded(FlowPath flowPath);
76
77 /**
78 * Send a notification that a Flow is removed.
79 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070080 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070081 */
82 void notificationSendFlowRemoved(FlowId flowId);
83
84 /**
85 * Send a notification that a Flow is updated.
86 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070087 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070088 */
89 void notificationSendFlowUpdated(FlowPath flowPath);
90
91 /**
92 * Send a notification that all Flows are removed.
93 */
94 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070095
96 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070097 * Get all Flow Entries that are currently in the datagrid.
98 *
99 * @return all Flow Entries that are currently in the datagrid.
100 */
101 Collection<FlowEntry> getAllFlowEntries();
102
103 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800104 * Get a Flow Entry for a given Flow Entry ID.
105 *
106 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
107 * @return the Flow Entry if found, otherwise null.
108 */
109 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
110
111 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700112 * Send a notification that a FlowEntry is added.
113 *
114 * @param flowEntry the FlowEntry that is added.
115 */
116 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
117
118 /**
119 * Send a notification that a FlowEntry is removed.
120 *
121 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
122 */
123 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
124
125 /**
126 * Send a notification that a FlowEntry is updated.
127 *
128 * @param flowEntry the FlowEntry that is updated.
129 */
130 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
131
132 /**
133 * Send a notification that all Flow Entries are removed.
134 */
135 void notificationSendAllFlowEntriesRemoved();
136
137 /**
Pavlin Radoslavov2004fa02014-01-07 14:46:42 -0800138 * Get all Flow IDs that are currently in the datagrid.
139 *
140 * @return all Flow IDs that are currently in the datagrid.
141 */
142 Collection<FlowId> getAllFlowIds();
143
144 /**
145 * Send a notification that a FlowId is added.
146 *
147 * @param flowId the FlowId that is added.
148 */
149 void notificationSendFlowIdAdded(FlowId flowId);
150
151 /**
152 * Send a notification that a FlowId is removed.
153 *
154 * @param flowId the FlowId that is removed.
155 */
156 void notificationSendFlowIdRemoved(FlowId flowId);
157
158 /**
159 * Send a notification that a FlowId is updated.
160 *
161 * @param flowId the FlowId that is updated.
162 */
163 void notificationSendFlowIdUpdated(FlowId flowId);
164
165 /**
166 * Send a notification that all Flow IDs are removed.
167 */
168 void notificationSendAllFlowIdsRemoved();
169
170 /**
Pavlin Radoslavov909da3c2014-01-09 04:04:33 -0800171 * Send a notification that a FlowEntryId is added.
172 *
173 * @param flowEntryId the FlowEntryId that is added.
174 * @param dpid the Switch Dpid.
175 */
176 void notificationSendFlowEntryIdAdded(FlowEntryId flowEntryId, Dpid dpid);
177
178 /**
179 * Send a notification that a FlowEntryId is removed.
180 *
181 * @param flowEntryId the FlowEntryId that is removed.
182 */
183 void notificationSendFlowEntryIdRemoved(FlowEntryId flowEntryId);
184
185 /**
186 * Send a notification that a FlowEntryId is updated.
187 *
188 * @param flowEntryId the FlowEntryId that is updated.
189 * @param dpid the Switch Dpid.
190 */
191 void notificationSendFlowEntryIdUpdated(FlowEntryId flowEntryId,
192 Dpid dpid);
193
194 /**
195 * Send a notification that all Flow Entry IDs are removed.
196 */
197 void notificationSendAllFlowEntryIdsRemoved();
198
199 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700200 * Get all Topology Elements that are currently in the datagrid.
201 *
202 * @return all Topology Elements that are currently in the datagrid.
203 */
204 Collection<TopologyElement> getAllTopologyElements();
205
206 /**
207 * Send a notification that a Topology Element is added.
208 *
209 * @param topologyElement the Topology Element that is added.
210 */
211 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
212
213 /**
214 * Send a notification that a Topology Element is removed.
215 *
216 * @param topologyElement the Topology Element that is removed.
217 */
218 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
219
220 /**
221 * Send a notification that a Topology Element is updated.
222 *
223 * @param topologyElement the Topology Element that is updated.
224 */
225 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
226
227 /**
228 * Send a notification that all Topology Elements are removed.
229 */
230 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800231
232 /**
233 * Send an ARP request to other ONOS instances
234 * @param arpRequest The request packet to send
235 */
pingping-lin017a8922013-12-11 11:15:33 +0800236 public void sendArpRequest(ArpMessage arpMessage);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700237}