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 | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.proxyarp.ArpReplyNotification; |
| 8 | import net.onrc.onos.ofcontroller.proxyarp.IArpReplyEventHandler; |
| 9 | import net.onrc.onos.ofcontroller.proxyarp.IPacketOutEventHandler; |
| 10 | import net.onrc.onos.ofcontroller.proxyarp.PacketOutNotification; |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 11 | import net.onrc.onos.ofcontroller.topology.TopologyElement; |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 12 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 13 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 14 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 15 | import net.onrc.onos.ofcontroller.util.FlowPath; |
| 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 | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 43 | * Register event handler for packet-out events. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 44 | * |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 45 | * @param packetOutEventHandler The packet-out event handler to register. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 46 | */ |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 47 | public void registerPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler); |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 48 | |
| 49 | /** |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 50 | * Deregister event handler service for packet-out events. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 51 | * |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 52 | * @param packetOutEventHandler The packet-out event handler to deregister. |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 53 | */ |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 54 | public void deregisterPacketOutEventHandler(IPacketOutEventHandler packetOutEventHandler); |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 55 | |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 56 | /** |
| 57 | * Register event handler for ARP reply events. |
| 58 | * |
| 59 | * @param packetOutEventHandler The ARP reply event handler to register. |
| 60 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 61 | public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
| 62 | |
Jonathan Hart | c632562 | 2014-01-14 16:37:50 -0800 | [diff] [blame^] | 63 | /** |
| 64 | * Deregister event handler service for ARP reply events. |
| 65 | * |
| 66 | * @param packetOutEventHandler The ARP reply event handler to deregister. |
| 67 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 68 | public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 69 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 70 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 71 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 78 | * 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 Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 86 | * Send a notification that a Flow is added. |
| 87 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 88 | * @param flowPath the Flow that is added. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 89 | */ |
| 90 | void notificationSendFlowAdded(FlowPath flowPath); |
| 91 | |
| 92 | /** |
| 93 | * Send a notification that a Flow is removed. |
| 94 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 95 | * @param flowId the Flow ID of the Flow that is removed. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 96 | */ |
| 97 | void notificationSendFlowRemoved(FlowId flowId); |
| 98 | |
| 99 | /** |
| 100 | * Send a notification that a Flow is updated. |
| 101 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 102 | * @param flowPath the Flow that is updated. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 103 | */ |
| 104 | void notificationSendFlowUpdated(FlowPath flowPath); |
| 105 | |
| 106 | /** |
| 107 | * Send a notification that all Flows are removed. |
| 108 | */ |
| 109 | void notificationSendAllFlowsRemoved(); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 110 | |
| 111 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 112 | * 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 Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 119 | * 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 Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 127 | * 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 Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 153 | * 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 Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 184 | |
| 185 | /** |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 186 | * 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 Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 194 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame] | 195 | 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 Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 203 | } |