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