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 | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame^] | 7 | import net.onrc.onos.ofcontroller.topology.TopologyElement; |
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. |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 25 | * @param dataPathSummaryStr the data path summary string if the added |
| 26 | * flow will be maintained internally, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 27 | * @return true on success, otherwise false. |
| 28 | */ |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 29 | boolean addFlow(FlowPath flowPath, FlowId flowId, |
| 30 | String dataPathSummaryStr); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 31 | |
| 32 | /** |
Pavlin Radoslavov | baea924 | 2013-05-08 00:20:09 +0000 | [diff] [blame] | 33 | * Delete all previously added flows. |
| 34 | * |
| 35 | * @return true on success, otherwise false. |
| 36 | */ |
| 37 | boolean deleteAllFlows(); |
| 38 | |
| 39 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 40 | * Delete a previously added flow. |
| 41 | * |
| 42 | * @param flowId the Flow ID of the flow to delete. |
| 43 | * @return true on success, otherwise false. |
| 44 | */ |
| 45 | boolean deleteFlow(FlowId flowId); |
| 46 | |
| 47 | /** |
Pavlin Radoslavov | baea924 | 2013-05-08 00:20:09 +0000 | [diff] [blame] | 48 | * Clear the state for all previously added flows. |
| 49 | * |
| 50 | * @return true on success, otherwise false. |
| 51 | */ |
| 52 | boolean clearAllFlows(); |
| 53 | |
| 54 | /** |
Pavlin Radoslavov | 916832f | 2013-03-14 17:48:41 -0700 | [diff] [blame] | 55 | * Clear the state for a previously added flow. |
| 56 | * |
| 57 | * @param flowId the Flow ID of the flow to clear. |
| 58 | * @return true on success, otherwise false. |
| 59 | */ |
| 60 | boolean clearFlow(FlowId flowId); |
| 61 | |
| 62 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 63 | * Get a previously added flow. |
| 64 | * |
| 65 | * @param flowId the Flow ID of the flow to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 66 | * @return the Flow Path 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 | FlowPath getFlow(FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 69 | |
| 70 | /** |
Pavlin Radoslavov | 661c86f | 2013-10-21 12:40:40 -0700 | [diff] [blame] | 71 | * Get all installed flows by all installers. |
| 72 | * |
| 73 | * @return the Flow Paths if found, otherwise null. |
| 74 | */ |
| 75 | ArrayList<FlowPath> getAllFlows(); |
| 76 | |
| 77 | /** |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 78 | * Get all previously added flows by a specific installer for a given |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 79 | * data path endpoints. |
| 80 | * |
| 81 | * @param installerId the Caller ID of the installer of the flow to get. |
| 82 | * @param dataPathEndpoints the data path endpoints of the flow to get. |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 83 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 84 | */ |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 85 | ArrayList<FlowPath> getAllFlows(CallerId installerId, |
| 86 | DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 87 | |
| 88 | /** |
| 89 | * Get all installed flows by all installers for given data path endpoints. |
| 90 | * |
| 91 | * @param dataPathEndpoints the data path endpoints of the flows to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 92 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 93 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 94 | ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 95 | |
| 96 | /** |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 97 | * Get summary of all installed flows by all installers. |
| 98 | * |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 99 | * @param flowId starting flow Id of the range |
| 100 | * @param maxFlows number of flows to return |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 101 | * @return the Flow Paths if found, otherwise null. |
| 102 | */ |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame] | 103 | ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows); |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 104 | |
| 105 | /** |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 106 | * Add and maintain a shortest-path flow. |
| 107 | * |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 108 | * NOTE: The Flow Path argument does NOT contain all flow entries. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 109 | * Instead, it contains a single dummy flow entry that is used to |
| 110 | * store the matching condition(s). |
| 111 | * That entry is replaced by the appropriate entries from the |
| 112 | * internally performed shortest-path computation. |
| 113 | * |
| 114 | * @param flowPath the Flow Path with the endpoints and the match |
| 115 | * conditions to install. |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 116 | * @return the added shortest-path flow on success, otherwise null. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 117 | */ |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 118 | FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath); |
| 119 | |
| 120 | /** |
| 121 | * Receive a notification that a Flow is added. |
| 122 | * |
| 123 | * @param flowPath the flow that is added. |
| 124 | */ |
| 125 | void notificationRecvFlowAdded(FlowPath flowPath); |
| 126 | |
| 127 | /** |
| 128 | * Receive a notification that a Flow is removed. |
| 129 | * |
| 130 | * @param flowPath the flow that is removed. |
| 131 | */ |
| 132 | void notificationRecvFlowRemoved(FlowPath flowPath); |
| 133 | |
| 134 | /** |
| 135 | * Receive a notification that a Flow is updated. |
| 136 | * |
| 137 | * @param flowPath the flow that is updated. |
| 138 | */ |
| 139 | void notificationRecvFlowUpdated(FlowPath flowPath); |
Pavlin Radoslavov | aaace7f | 2013-10-25 19:42:00 -0700 | [diff] [blame^] | 140 | |
| 141 | /** |
| 142 | * Receive a notification that a Topology Element is added. |
| 143 | * |
| 144 | * @param topologyElement the Topology Element that is added. |
| 145 | */ |
| 146 | void notificationRecvTopologyElementAdded(TopologyElement topologyElement); |
| 147 | |
| 148 | /** |
| 149 | * Receive a notification that a Topology Element is removed. |
| 150 | * |
| 151 | * @param topologyElement the Topology Element that is removed. |
| 152 | */ |
| 153 | void notificationRecvTopologyElementRemoved(TopologyElement topologyElement); |
| 154 | |
| 155 | /** |
| 156 | * Receive a notification that a Topology Element is updated. |
| 157 | * |
| 158 | * @param topologyElement the Topology Element that is updated. |
| 159 | */ |
| 160 | void notificationRecvTopologyElementUpdated(TopologyElement topologyElement); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 161 | } |