blob: 1478129cb33c52d200a618a3b8306883ba653936 [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 Hartc6325622014-01-14 16:37:50 -080043 * Register event handler for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080044 *
Jonathan Hartc6325622014-01-14 16:37:50 -080045 * @param packetOutEventHandler The packet-out event handler to register.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080046 */
Jonathan Hartc6325622014-01-14 16:37:50 -080047 public void registerPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart18ad55c2013-11-11 22:49:55 -080048
49 /**
Jonathan Hartc6325622014-01-14 16:37:50 -080050 * Deregister event handler service for packet-out events.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080051 *
Jonathan Hartc6325622014-01-14 16:37:50 -080052 * @param packetOutEventHandler The packet-out event handler to deregister.
Jonathan Hart18ad55c2013-11-11 22:49:55 -080053 */
Jonathan Hartc6325622014-01-14 16:37:50 -080054 public void deregisterPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler);
Jonathan Hart7804bea2014-01-07 10:50:52 -080055
Jonathan Hartc6325622014-01-14 16:37:50 -080056 /**
57 * Register event handler for ARP reply events.
58 *
59 * @param packetOutEventHandler The ARP reply event handler to register.
60 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080061 public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
62
Jonathan Hartc6325622014-01-14 16:37:50 -080063 /**
64 * Deregister event handler service for ARP reply events.
65 *
66 * @param packetOutEventHandler The ARP reply event handler to deregister.
67 */
Jonathan Hart7804bea2014-01-07 10:50:52 -080068 public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080069
Jonathan Hart18ad55c2013-11-11 22:49:55 -080070 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070071 * Get all Flows that are currently in the datagrid.
72 *
73 * @return all Flows that are currently in the datagrid.
74 */
75 Collection<FlowPath> getAllFlows();
76
77 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080078 * Get a Flow for a given Flow ID.
79 *
80 * @param flowId the Flow ID of the Flow to get.
81 * @return the Flow if found, otherwise null.
82 */
83 FlowPath getFlow(FlowId flowId);
84
85 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070086 * Send a notification that a Flow is added.
87 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070088 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070089 */
90 void notificationSendFlowAdded(FlowPath flowPath);
91
92 /**
93 * Send a notification that a Flow is removed.
94 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070095 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070096 */
97 void notificationSendFlowRemoved(FlowId flowId);
98
99 /**
100 * Send a notification that a Flow is updated.
101 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700102 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700103 */
104 void notificationSendFlowUpdated(FlowPath flowPath);
105
106 /**
107 * Send a notification that all Flows are removed.
108 */
109 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700110
111 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700112 * Get all Flow Entries that are currently in the datagrid.
113 *
114 * @return all Flow Entries that are currently in the datagrid.
115 */
116 Collection<FlowEntry> getAllFlowEntries();
117
118 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800119 * Get a Flow Entry for a given Flow Entry ID.
120 *
121 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
122 * @return the Flow Entry if found, otherwise null.
123 */
124 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
125
126 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700127 * Send a notification that a FlowEntry is added.
128 *
129 * @param flowEntry the FlowEntry that is added.
130 */
131 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
132
133 /**
134 * Send a notification that a FlowEntry is removed.
135 *
136 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
137 */
138 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
139
140 /**
141 * Send a notification that a FlowEntry is updated.
142 *
143 * @param flowEntry the FlowEntry that is updated.
144 */
145 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
146
147 /**
148 * Send a notification that all Flow Entries are removed.
149 */
150 void notificationSendAllFlowEntriesRemoved();
151
152 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700153 * Get all Topology Elements that are currently in the datagrid.
154 *
155 * @return all Topology Elements that are currently in the datagrid.
156 */
157 Collection<TopologyElement> getAllTopologyElements();
158
159 /**
160 * Send a notification that a Topology Element is added.
161 *
162 * @param topologyElement the Topology Element that is added.
163 */
164 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
165
166 /**
167 * Send a notification that a Topology Element is removed.
168 *
169 * @param topologyElement the Topology Element that is removed.
170 */
171 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
172
173 /**
174 * Send a notification that a Topology Element is updated.
175 *
176 * @param topologyElement the Topology Element that is updated.
177 */
178 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
179
180 /**
181 * Send a notification that all Topology Elements are removed.
182 */
183 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800184
185 /**
Jonathan Hart7804bea2014-01-07 10:50:52 -0800186 * Send a packet-out notification to other ONOS instances. This informs
187 * other instances that they should send this packet out some of the ports
188 * they control. Not all notifications are applicable to all instances
189 * (i.e. some notifications specify a single port to send the packet out),
190 * so each instance must determine whether it needs to take action when it
191 * receives the notification.
192 *
193 * @param packetOutNotification The packet notification to send
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800194 */
Jonathan Hart7804bea2014-01-07 10:50:52 -0800195 public void sendPacketOutNotification(PacketOutNotification packetOutNotification);
196
197 /**
198 * Send notification to other ONOS instances that an ARP reply has been
199 * received.
200 * @param arpReply The notification of the ARP reply
201 */
202 public void sendArpReplyNotification(ArpReplyNotification arpReply);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700203}