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. |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 23 | * @param dataPathSummaryStr the data path summary string if the added |
| 24 | * flow will be maintained internally, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 25 | * @return true on success, otherwise false. |
| 26 | */ |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 27 | boolean addFlow(FlowPath flowPath, FlowId flowId, |
| 28 | String dataPathSummaryStr); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Delete a previously added flow. |
| 32 | * |
| 33 | * @param flowId the Flow ID of the flow to delete. |
| 34 | * @return true on success, otherwise false. |
| 35 | */ |
| 36 | boolean deleteFlow(FlowId flowId); |
| 37 | |
| 38 | /** |
Pavlin Radoslavov | 916832f | 2013-03-14 17:48:41 -0700 | [diff] [blame] | 39 | * Clear the state for a previously added flow. |
| 40 | * |
| 41 | * @param flowId the Flow ID of the flow to clear. |
| 42 | * @return true on success, otherwise false. |
| 43 | */ |
| 44 | boolean clearFlow(FlowId flowId); |
| 45 | |
| 46 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 47 | * Get a previously added flow. |
| 48 | * |
| 49 | * @param flowId the Flow ID of the flow to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 50 | * @return the Flow Path if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 51 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 52 | FlowPath getFlow(FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 53 | |
| 54 | /** |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 55 | * Get all previously added flows by a specific installer for a given |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 56 | * data path endpoints. |
| 57 | * |
| 58 | * @param installerId the Caller ID of the installer of the flow to get. |
| 59 | * @param dataPathEndpoints the data path endpoints of the flow to get. |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 60 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 61 | */ |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 62 | ArrayList<FlowPath> getAllFlows(CallerId installerId, |
| 63 | DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 64 | |
| 65 | /** |
| 66 | * Get all installed flows by all installers for given data path endpoints. |
| 67 | * |
| 68 | * @param dataPathEndpoints the data path endpoints of the flows to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 69 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 70 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 71 | ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 72 | |
| 73 | /** |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 74 | * Get summary of all installed flows by all installers. |
| 75 | * |
| 76 | * @param flowId: starting flow Id of the range |
| 77 | * @param maxFlows: number of flows to return |
| 78 | * @return the Flow Paths if found, otherwise null. |
| 79 | */ |
| 80 | ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows); |
| 81 | |
| 82 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 83 | * Get all installed flows by all installers. |
| 84 | * |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 85 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 86 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 87 | ArrayList<FlowPath> getAllFlows(); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 88 | |
| 89 | /** |
| 90 | * Add and maintain a shortest-path flow. |
| 91 | * |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 92 | * NOTE: The Flow Path argument does NOT contain all flow entries. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 93 | * Instead, it contains a single dummy flow entry that is used to |
| 94 | * store the matching condition(s). |
| 95 | * That entry is replaced by the appropriate entries from the |
| 96 | * internally performed shortest-path computation. |
| 97 | * |
| 98 | * @param flowPath the Flow Path with the endpoints and the match |
| 99 | * conditions to install. |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 100 | * @return the added shortest-path flow on success, otherwise null. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 101 | */ |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 102 | public FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 103 | } |