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