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 | 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 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame^] | 47 | public void registerPacketOutEventHandler(IPacketOutEventHandler arpEventHandler); |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * De-register event handler service for ARP events. |
| 51 | * |
| 52 | * @param arpEventHandler The ARP event handler to de-register. |
| 53 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame^] | 54 | public void deregisterPacketOutEventHandler(IPacketOutEventHandler arpEventHandler); |
| 55 | |
| 56 | public void registerArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
| 57 | |
| 58 | public void deregisterArpReplyEventHandler(IArpReplyEventHandler arpReplyEventHandler); |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 59 | |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 60 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 61 | * Get all Flows that are currently in the datagrid. |
| 62 | * |
| 63 | * @return all Flows that are currently in the datagrid. |
| 64 | */ |
| 65 | Collection<FlowPath> getAllFlows(); |
| 66 | |
| 67 | /** |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 68 | * Get a Flow for a given Flow ID. |
| 69 | * |
| 70 | * @param flowId the Flow ID of the Flow to get. |
| 71 | * @return the Flow if found, otherwise null. |
| 72 | */ |
| 73 | FlowPath getFlow(FlowId flowId); |
| 74 | |
| 75 | /** |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 76 | * Send a notification that a Flow is added. |
| 77 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 78 | * @param flowPath the Flow that is added. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 79 | */ |
| 80 | void notificationSendFlowAdded(FlowPath flowPath); |
| 81 | |
| 82 | /** |
| 83 | * Send a notification that a Flow is removed. |
| 84 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 85 | * @param flowId the Flow ID of the Flow that is removed. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 86 | */ |
| 87 | void notificationSendFlowRemoved(FlowId flowId); |
| 88 | |
| 89 | /** |
| 90 | * Send a notification that a Flow is updated. |
| 91 | * |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 92 | * @param flowPath the Flow that is updated. |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 93 | */ |
| 94 | void notificationSendFlowUpdated(FlowPath flowPath); |
| 95 | |
| 96 | /** |
| 97 | * Send a notification that all Flows are removed. |
| 98 | */ |
| 99 | void notificationSendAllFlowsRemoved(); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 100 | |
| 101 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 102 | * Get all Flow Entries that are currently in the datagrid. |
| 103 | * |
| 104 | * @return all Flow Entries that are currently in the datagrid. |
| 105 | */ |
| 106 | Collection<FlowEntry> getAllFlowEntries(); |
| 107 | |
| 108 | /** |
Pavlin Radoslavov | 379c904 | 2013-11-26 15:40:49 -0800 | [diff] [blame] | 109 | * Get a Flow Entry for a given Flow Entry ID. |
| 110 | * |
| 111 | * @param flowEntryId the Flow Entry ID of the Flow Entry to get. |
| 112 | * @return the Flow Entry if found, otherwise null. |
| 113 | */ |
| 114 | FlowEntry getFlowEntry(FlowEntryId flowEntryId); |
| 115 | |
| 116 | /** |
Pavlin Radoslavov | b750684 | 2013-10-29 17:46:54 -0700 | [diff] [blame] | 117 | * Send a notification that a FlowEntry is added. |
| 118 | * |
| 119 | * @param flowEntry the FlowEntry that is added. |
| 120 | */ |
| 121 | void notificationSendFlowEntryAdded(FlowEntry flowEntry); |
| 122 | |
| 123 | /** |
| 124 | * Send a notification that a FlowEntry is removed. |
| 125 | * |
| 126 | * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed. |
| 127 | */ |
| 128 | void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId); |
| 129 | |
| 130 | /** |
| 131 | * Send a notification that a FlowEntry is updated. |
| 132 | * |
| 133 | * @param flowEntry the FlowEntry that is updated. |
| 134 | */ |
| 135 | void notificationSendFlowEntryUpdated(FlowEntry flowEntry); |
| 136 | |
| 137 | /** |
| 138 | * Send a notification that all Flow Entries are removed. |
| 139 | */ |
| 140 | void notificationSendAllFlowEntriesRemoved(); |
| 141 | |
| 142 | /** |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame] | 143 | * Get all Topology Elements that are currently in the datagrid. |
| 144 | * |
| 145 | * @return all Topology Elements that are currently in the datagrid. |
| 146 | */ |
| 147 | Collection<TopologyElement> getAllTopologyElements(); |
| 148 | |
| 149 | /** |
| 150 | * Send a notification that a Topology Element is added. |
| 151 | * |
| 152 | * @param topologyElement the Topology Element that is added. |
| 153 | */ |
| 154 | void notificationSendTopologyElementAdded(TopologyElement topologyElement); |
| 155 | |
| 156 | /** |
| 157 | * Send a notification that a Topology Element is removed. |
| 158 | * |
| 159 | * @param topologyElement the Topology Element that is removed. |
| 160 | */ |
| 161 | void notificationSendTopologyElementRemoved(TopologyElement topologyElement); |
| 162 | |
| 163 | /** |
| 164 | * Send a notification that a Topology Element is updated. |
| 165 | * |
| 166 | * @param topologyElement the Topology Element that is updated. |
| 167 | */ |
| 168 | void notificationSendTopologyElementUpdated(TopologyElement topologyElement); |
| 169 | |
| 170 | /** |
| 171 | * Send a notification that all Topology Elements are removed. |
| 172 | */ |
| 173 | void notificationSendAllTopologyElementsRemoved(); |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 174 | |
| 175 | /** |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame^] | 176 | * Send a packet-out notification to other ONOS instances. This informs |
| 177 | * other instances that they should send this packet out some of the ports |
| 178 | * they control. Not all notifications are applicable to all instances |
| 179 | * (i.e. some notifications specify a single port to send the packet out), |
| 180 | * so each instance must determine whether it needs to take action when it |
| 181 | * receives the notification. |
| 182 | * |
| 183 | * @param packetOutNotification The packet notification to send |
Jonathan Hart | 18ad55c | 2013-11-11 22:49:55 -0800 | [diff] [blame] | 184 | */ |
Jonathan Hart | 7804bea | 2014-01-07 10:50:52 -0800 | [diff] [blame^] | 185 | public void sendPacketOutNotification(PacketOutNotification packetOutNotification); |
| 186 | |
| 187 | /** |
| 188 | * Send notification to other ONOS instances that an ARP reply has been |
| 189 | * received. |
| 190 | * @param arpReply The notification of the ARP reply |
| 191 | */ |
| 192 | public void sendArpReplyNotification(ArpReplyNotification arpReply); |
Pavlin Radoslavov | 1eee2c8 | 2013-10-15 02:30:32 -0700 | [diff] [blame] | 193 | } |