Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 1 | package net.onrc.onos.datagrid; |
| 2 | |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 3 | import java.util.Collection; |
| 4 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 5 | import net.floodlightcontroller.core.module.IFloodlightService; |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 6 | import net.onrc.onos.ofcontroller.flowmanager.IFlowEventHandlerService; |
Jonathan Hart | d300325 | 2013-11-15 09:44:46 -0800 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.proxyarp.ArpMessage; |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 8 | import net.onrc.onos.ofcontroller.proxyarp.IArpEventHandler; |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 9 | import net.onrc.onos.ofcontroller.topology.TopologyElement; |
Pavlin Radoslavov | 909da3c | 2014-01-09 04:04:33 -0800 | [diff] [blame] | 10 | import net.onrc.onos.ofcontroller.util.Dpid; |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 11 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 12 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 13 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 14 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Pavlin Radoslavov | a9c0c3b | 2014-01-09 10:54:45 -0800 | [diff] [blame] | 15 | import net.onrc.onos.ofcontroller.util.Pair; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 16 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 17 | /** |
| 18 | * Interface for providing Datagrid Service to other modules. |
| 19 | */ |
| 20 | public interface IDatagridService extends IFloodlightService { |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 21 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 22 | * Register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 23 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 24 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 25 | * NOTE: Only a single Flow Event Handler Service can be registered. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 26 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 27 | * @param flowEventHandlerService the Flow Event Handler Service to register. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 28 | */ |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 29 | void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 32 | * De-register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 33 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 34 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 35 | * NOTE: Only a single Flow Event Handler Service can be registered. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 36 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 37 | * @param flowEventHandlerService the Flow Event Handler Service to |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 38 | * de-register. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 39 | */ |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 40 | void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 41 | |
| 42 | /** |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 43 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 55 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 56 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 57 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 64 | * 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 Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 72 | * Send a notification that a Flow is added. |
| 73 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 74 | * @param flowPath the Flow that is added. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 75 | */ |
| 76 | void notificationSendFlowAdded(FlowPath flowPath); |
| 77 | |
| 78 | /** |
| 79 | * Send a notification that a Flow is removed. |
| 80 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 81 | * @param flowId the Flow ID of the Flow that is removed. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 82 | */ |
| 83 | void notificationSendFlowRemoved(FlowId flowId); |
| 84 | |
| 85 | /** |
| 86 | * Send a notification that a Flow is updated. |
| 87 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 88 | * @param flowPath the Flow that is updated. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 89 | */ |
| 90 | void notificationSendFlowUpdated(FlowPath flowPath); |
| 91 | |
| 92 | /** |
| 93 | * Send a notification that all Flows are removed. |
| 94 | */ |
| 95 | void notificationSendAllFlowsRemoved(); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 96 | |
| 97 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 98 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 105 | * 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 Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 113 | * 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 Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 139 | * Get all Flow IDs that are currently in the datagrid. |
| 140 | * |
Pavlin Radoslavov | a9c0c3b | 2014-01-09 10:54:45 -0800 | [diff] [blame] | 141 | * @return all Flow IDs that ae currently in the datagrid. |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 142 | */ |
Pavlin Radoslavov | 2194d11 | 2014-01-10 13:36:00 -0800 | [diff] [blame^] | 143 | Collection<Pair<FlowId, Dpid>> getAllFlowIds(); |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 144 | |
| 145 | /** |
| 146 | * Send a notification that a FlowId is added. |
| 147 | * |
| 148 | * @param flowId the FlowId that is added. |
Pavlin Radoslavov | 2194d11 | 2014-01-10 13:36:00 -0800 | [diff] [blame^] | 149 | * @param dpid the Source Switch Dpid. |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 150 | */ |
Pavlin Radoslavov | 2194d11 | 2014-01-10 13:36:00 -0800 | [diff] [blame^] | 151 | void notificationSendFlowIdAdded(FlowId flowId, Dpid dpid); |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 152 | |
| 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 Radoslavov | 2194d11 | 2014-01-10 13:36:00 -0800 | [diff] [blame^] | 164 | * @param dpid the Source Switch Dpid. |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 165 | */ |
Pavlin Radoslavov | 2194d11 | 2014-01-10 13:36:00 -0800 | [diff] [blame^] | 166 | void notificationSendFlowIdUpdated(FlowId flowId, Dpid dpid); |
Pavlin Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 167 | |
| 168 | /** |
| 169 | * Send a notification that all Flow IDs are removed. |
| 170 | */ |
| 171 | void notificationSendAllFlowIdsRemoved(); |
| 172 | |
| 173 | /** |
Pavlin Radoslavov | a9c0c3b | 2014-01-09 10:54:45 -0800 | [diff] [blame] | 174 | * 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 Radoslavov | 909da3c | 2014-01-09 04:04:33 -0800 | [diff] [blame] | 181 | * 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 Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 210 | * 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 Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 241 | |
| 242 | /** |
| 243 | * Send an ARP request to other ONOS instances |
| 244 | * @param arpRequest The request packet to send |
| 245 | */ |
pingping-lin | 017a892 | 2013-12-11 11:15:33 +0800 | [diff] [blame] | 246 | public void sendArpRequest(ArpMessage arpMessage); |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 247 | } |