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 | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 10 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 11 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 12 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 13 | import net.onrc.onos.ofcontroller.util.FlowPath; |
| 14 | |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 15 | /** |
| 16 | * Interface for providing Datagrid Service to other modules. |
| 17 | */ |
| 18 | public interface IDatagridService extends IFloodlightService { |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 19 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 20 | * Register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 21 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 22 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 23 | * NOTE: Only a single Flow Event Handler Service can be registered. |
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 | * @param flowEventHandlerService the Flow Event Handler Service to register. |
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 | void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 30 | * De-register Flow Event Handler Service for receiving Flow-related |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 31 | * notifications. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 32 | * |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 33 | * NOTE: Only a single Flow Event Handler Service can be registered. |
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 | * @param flowEventHandlerService the Flow Event Handler Service to |
Pavlin Radoslavov | 6b79f2b | 2013-10-26 21:31:10 -0700 | [diff] [blame] | 36 | * de-register. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 37 | */ |
Pavlin Radoslavov | 9a85902 | 2013-10-30 10:08:24 -0700 | [diff] [blame] | 38 | void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService); |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 41 | * Register event handler for ARP events. |
| 42 | * |
| 43 | * @param arpEventHandler The ARP event handler to register. |
| 44 | */ |
| 45 | public void registerArpEventHandler(IArpEventHandler arpEventHandler); |
| 46 | |
| 47 | /** |
| 48 | * De-register event handler service for ARP events. |
| 49 | * |
| 50 | * @param arpEventHandler The ARP event handler to de-register. |
| 51 | */ |
| 52 | public void deregisterArpEventHandler(IArpEventHandler arpEventHandler); |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 53 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 54 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 55 | * Get all Flows that are currently in the datagrid. |
| 56 | * |
| 57 | * @return all Flows that are currently in the datagrid. |
| 58 | */ |
| 59 | Collection<FlowPath> getAllFlows(); |
| 60 | |
| 61 | /** |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 62 | * Get a Flow for a given Flow ID. |
| 63 | * |
| 64 | * @param flowId the Flow ID of the Flow to get. |
| 65 | * @return the Flow if found, otherwise null. |
| 66 | */ |
| 67 | FlowPath getFlow(FlowId flowId); |
| 68 | |
| 69 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 70 | * Send a notification that a Flow is added. |
| 71 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 72 | * @param flowPath the Flow that is added. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 73 | */ |
| 74 | void notificationSendFlowAdded(FlowPath flowPath); |
| 75 | |
| 76 | /** |
| 77 | * Send a notification that a Flow is removed. |
| 78 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 79 | * @param flowId the Flow ID of the Flow that is removed. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 80 | */ |
| 81 | void notificationSendFlowRemoved(FlowId flowId); |
| 82 | |
| 83 | /** |
| 84 | * Send a notification that a Flow is updated. |
| 85 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 86 | * @param flowPath the Flow that is updated. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 87 | */ |
| 88 | void notificationSendFlowUpdated(FlowPath flowPath); |
| 89 | |
| 90 | /** |
| 91 | * Send a notification that all Flows are removed. |
| 92 | */ |
| 93 | void notificationSendAllFlowsRemoved(); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 94 | |
| 95 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 96 | * Get all Flow Entries that are currently in the datagrid. |
| 97 | * |
| 98 | * @return all Flow Entries that are currently in the datagrid. |
| 99 | */ |
| 100 | Collection<FlowEntry> getAllFlowEntries(); |
| 101 | |
| 102 | /** |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 103 | * Get a Flow Entry for a given Flow Entry ID. |
| 104 | * |
| 105 | * @param flowEntryId the Flow Entry ID of the Flow Entry to get. |
| 106 | * @return the Flow Entry if found, otherwise null. |
| 107 | */ |
| 108 | FlowEntry getFlowEntry(FlowEntryId flowEntryId); |
| 109 | |
| 110 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 111 | * Send a notification that a FlowEntry is added. |
| 112 | * |
| 113 | * @param flowEntry the FlowEntry that is added. |
| 114 | */ |
| 115 | void notificationSendFlowEntryAdded(FlowEntry flowEntry); |
| 116 | |
| 117 | /** |
| 118 | * Send a notification that a FlowEntry is removed. |
| 119 | * |
| 120 | * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed. |
| 121 | */ |
| 122 | void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId); |
| 123 | |
| 124 | /** |
| 125 | * Send a notification that a FlowEntry is updated. |
| 126 | * |
| 127 | * @param flowEntry the FlowEntry that is updated. |
| 128 | */ |
| 129 | void notificationSendFlowEntryUpdated(FlowEntry flowEntry); |
| 130 | |
| 131 | /** |
| 132 | * Send a notification that all Flow Entries are removed. |
| 133 | */ |
| 134 | void notificationSendAllFlowEntriesRemoved(); |
| 135 | |
| 136 | /** |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 137 | * Get all Topology Elements that are currently in the datagrid. |
| 138 | * |
| 139 | * @return all Topology Elements that are currently in the datagrid. |
| 140 | */ |
| 141 | Collection<TopologyElement> getAllTopologyElements(); |
| 142 | |
| 143 | /** |
| 144 | * Send a notification that a Topology Element is added. |
| 145 | * |
| 146 | * @param topologyElement the Topology Element that is added. |
| 147 | */ |
| 148 | void notificationSendTopologyElementAdded(TopologyElement topologyElement); |
| 149 | |
| 150 | /** |
| 151 | * Send a notification that a Topology Element is removed. |
| 152 | * |
| 153 | * @param topologyElement the Topology Element that is removed. |
| 154 | */ |
| 155 | void notificationSendTopologyElementRemoved(TopologyElement topologyElement); |
| 156 | |
| 157 | /** |
| 158 | * Send a notification that a Topology Element is updated. |
| 159 | * |
| 160 | * @param topologyElement the Topology Element that is updated. |
| 161 | */ |
| 162 | void notificationSendTopologyElementUpdated(TopologyElement topologyElement); |
| 163 | |
| 164 | /** |
| 165 | * Send a notification that all Topology Elements are removed. |
| 166 | */ |
| 167 | void notificationSendAllTopologyElementsRemoved(); |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 168 | |
| 169 | /** |
| 170 | * Send an ARP request to other ONOS instances |
| 171 | * @param arpRequest The request packet to send |
| 172 | */ |
Jonathan Hart | d300325 | 2013-11-15 09:44:46 -0800 | [diff] [blame] | 173 | public void sendArpRequest(ArpMessage arpMessage); |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 174 | } |