Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.flowcache; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | |
| 5 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 6 | import net.floodlightcontroller.util.CallerId; |
| 7 | import net.floodlightcontroller.util.DataPathEndpoints; |
| 8 | import net.floodlightcontroller.util.FlowId; |
| 9 | import net.floodlightcontroller.util.FlowPath; |
| 10 | |
| 11 | /** |
| 12 | * @short Interface for providing Flow Service to other modules. |
| 13 | */ |
| 14 | public interface IFlowService extends IFloodlightService { |
| 15 | /** |
| 16 | * Add a flow. |
| 17 | * |
| 18 | * Internally, ONOS will automatically register the installer for |
| 19 | * receiving Flow Path Notifications for that path. |
| 20 | * |
| 21 | * @param flowPath the Flow Path to install. |
| 22 | * @param flowId the return-by-reference Flow ID as assigned internally. |
| 23 | * @return true on success, otherwise false. |
| 24 | */ |
| 25 | boolean addFlow(FlowPath flowPath, FlowId flowId); |
| 26 | |
| 27 | /** |
| 28 | * Delete a previously added flow. |
| 29 | * |
| 30 | * @param flowId the Flow ID of the flow to delete. |
| 31 | * @return true on success, otherwise false. |
| 32 | */ |
| 33 | boolean deleteFlow(FlowId flowId); |
| 34 | |
| 35 | /** |
Pavlin Radoslavov | 916832f | 2013-03-14 17:48:41 -0700 | [diff] [blame] | 36 | * Clear the state for a previously added flow. |
| 37 | * |
| 38 | * @param flowId the Flow ID of the flow to clear. |
| 39 | * @return true on success, otherwise false. |
| 40 | */ |
| 41 | boolean clearFlow(FlowId flowId); |
| 42 | |
| 43 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 44 | * Get a previously added flow. |
| 45 | * |
| 46 | * @param flowId the Flow ID of the flow to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 47 | * @return the Flow Path if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 48 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 49 | FlowPath getFlow(FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 50 | |
| 51 | /** |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 52 | * Get all previously added flows by a specific installer for a given |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 53 | * data path endpoints. |
| 54 | * |
| 55 | * @param installerId the Caller ID of the installer of the flow to get. |
| 56 | * @param dataPathEndpoints the data path endpoints of the flow to get. |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 57 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 58 | */ |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 59 | ArrayList<FlowPath> getAllFlows(CallerId installerId, |
| 60 | DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Get all installed flows by all installers for given data path endpoints. |
| 64 | * |
| 65 | * @param dataPathEndpoints the data path endpoints of the flows to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 66 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 67 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 68 | ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * Get all installed flows by all installers. |
| 72 | * |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 73 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 74 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 75 | ArrayList<FlowPath> getAllFlows(); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 76 | } |