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; |
| 15 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 16 | /** |
| 17 | * Interface for providing Datagrid Service to other modules. |
| 18 | */ |
| 19 | public interface IDatagridService extends IFloodlightService { |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 20 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 21 | * Register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 22 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 23 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 24 | * NOTE: Only a single Flow Event Handler Service can be registered. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 25 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 26 | * @param flowEventHandlerService the Flow Event Handler Service to register. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 27 | */ |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 28 | void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 29 | |
| 30 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 31 | * De-register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 32 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 33 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 34 | * NOTE: Only a single Flow Event Handler Service can be registered. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 35 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 36 | * @param flowEventHandlerService the Flow Event Handler Service to |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 37 | * de-register. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 38 | */ |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 39 | void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 42 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 54 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 55 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 56 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 63 | * 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 Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 71 | * Send a notification that a Flow is added. |
| 72 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 73 | * @param flowPath the Flow that is added. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 74 | */ |
| 75 | void notificationSendFlowAdded(FlowPath flowPath); |
| 76 | |
| 77 | /** |
| 78 | * Send a notification that a Flow is removed. |
| 79 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 80 | * @param flowId the Flow ID of the Flow that is removed. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 81 | */ |
| 82 | void notificationSendFlowRemoved(FlowId flowId); |
| 83 | |
| 84 | /** |
| 85 | * Send a notification that a Flow is updated. |
| 86 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 87 | * @param flowPath the Flow that is updated. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 88 | */ |
| 89 | void notificationSendFlowUpdated(FlowPath flowPath); |
| 90 | |
| 91 | /** |
| 92 | * Send a notification that all Flows are removed. |
| 93 | */ |
| 94 | void notificationSendAllFlowsRemoved(); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 95 | |
| 96 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 97 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 104 | * 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 Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 112 | * 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 Radoslavov | 2004fa0 | 2014-01-07 14:46:42 -0800 | [diff] [blame] | 138 | * 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 Radoslavov | 909da3c | 2014-01-09 04:04:33 -0800 | [diff] [blame^] | 171 | * 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 Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 200 | * 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 Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 231 | |
| 232 | /** |
| 233 | * Send an ARP request to other ONOS instances |
| 234 | * @param arpRequest The request packet to send |
| 235 | */ |
pingping-lin | 017a892 | 2013-12-11 11:15:33 +0800 | [diff] [blame] | 236 | public void sendArpRequest(ArpMessage arpMessage); |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 237 | } |