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; |
Pavlin Radoslavov | ab3f886 | 2013-12-04 18:35:53 -0800 | [diff] [blame] | 4 | import java.util.Collection; |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 5 | |
Brian O'Connor | 4f0b60c | 2013-11-26 15:00:04 -0800 | [diff] [blame] | 6 | import net.floodlightcontroller.core.IOFSwitch; |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 7 | import net.floodlightcontroller.core.module.IFloodlightService; |
Pavlin Radoslavov | ed0f4a8 | 2013-11-04 16:38:36 -0800 | [diff] [blame] | 8 | import net.onrc.onos.ofcontroller.topology.Topology; |
Pavlin Radoslavov | da0ab44 | 2013-12-04 14:08:58 -0800 | [diff] [blame] | 9 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
Pavlin Radoslavov | 4df85ae | 2013-11-26 14:48:32 -0800 | [diff] [blame] | 10 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame] | 11 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 12 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Pavlin Radoslavov | ab3f886 | 2013-12-04 18:35:53 -0800 | [diff] [blame] | 13 | import net.onrc.onos.ofcontroller.util.Pair; |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 14 | |
| 15 | /** |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 16 | * Interface for providing Flow Service to other modules. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 17 | */ |
| 18 | public interface IFlowService extends IFloodlightService { |
| 19 | /** |
| 20 | * Add a flow. |
| 21 | * |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 22 | * @param flowPath the Flow Path to install. |
Pavlin Radoslavov | 051abb4 | 2013-12-05 17:24:50 -0800 | [diff] [blame] | 23 | * @return the Flow ID on success, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 24 | */ |
Pavlin Radoslavov | 051abb4 | 2013-12-05 17:24:50 -0800 | [diff] [blame] | 25 | FlowId addFlow(FlowPath flowPath); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 26 | |
| 27 | /** |
Pavlin Radoslavov | baea924 | 2013-05-08 00:20:09 +0000 | [diff] [blame] | 28 | * Delete all previously added flows. |
| 29 | * |
| 30 | * @return true on success, otherwise false. |
| 31 | */ |
| 32 | boolean deleteAllFlows(); |
| 33 | |
| 34 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 35 | * Delete a previously added flow. |
| 36 | * |
| 37 | * @param flowId the Flow ID of the flow to delete. |
| 38 | * @return true on success, otherwise false. |
| 39 | */ |
| 40 | boolean deleteFlow(FlowId flowId); |
| 41 | |
| 42 | /** |
| 43 | * Get a previously added flow. |
| 44 | * |
| 45 | * @param flowId the Flow ID of the flow to get. |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 46 | * @return the Flow Path if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 47 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 48 | FlowPath getFlow(FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 49 | |
| 50 | /** |
Pavlin Radoslavov | 661c86f | 2013-10-21 12:40:40 -0700 | [diff] [blame] | 51 | * Get all installed flows by all installers. |
| 52 | * |
| 53 | * @return the Flow Paths if found, otherwise null. |
| 54 | */ |
| 55 | ArrayList<FlowPath> getAllFlows(); |
| 56 | |
| 57 | /** |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 58 | * Get summary of all installed flows by all installers. |
| 59 | * |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 60 | * @param flowId starting flow Id of the range |
| 61 | * @param maxFlows number of flows to return |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 62 | * @return the Flow Paths if found, otherwise null. |
| 63 | */ |
Pavlin Radoslavov | 4ef6ba2 | 2013-11-22 19:32:58 -0800 | [diff] [blame] | 64 | ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows); |
Pavlin Radoslavov | ed0f4a8 | 2013-11-04 16:38:36 -0800 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * Get the network topology. |
| 68 | * |
| 69 | * @return the network topology. |
| 70 | */ |
| 71 | Topology getTopology(); |
Pavlin Radoslavov | da0ab44 | 2013-12-04 14:08:58 -0800 | [diff] [blame] | 72 | |
Jonathan Hart | 9709991 | 2013-11-14 13:40:16 -0800 | [diff] [blame] | 73 | /** |
Pavlin Radoslavov | 4df85ae | 2013-11-26 14:48:32 -0800 | [diff] [blame] | 74 | * Inform the Flow Manager that a Flow Entry on switch expired. |
| 75 | * |
Pavlin Radoslavov | 3bd5ccf | 2013-11-26 15:10:21 -0800 | [diff] [blame] | 76 | * @param sw the switch the Flow Entry expired on. |
Pavlin Radoslavov | 4df85ae | 2013-11-26 14:48:32 -0800 | [diff] [blame] | 77 | * @param flowEntryId the Flow Entry ID of the expired Flow Entry. |
| 78 | */ |
Brian O'Connor | 4f0b60c | 2013-11-26 15:00:04 -0800 | [diff] [blame] | 79 | public void flowEntryOnSwitchExpired(IOFSwitch sw, FlowEntryId flowEntryId); |
Pavlin Radoslavov | da0ab44 | 2013-12-04 14:08:58 -0800 | [diff] [blame] | 80 | |
| 81 | /** |
Pavlin Radoslavov | ab3f886 | 2013-12-04 18:35:53 -0800 | [diff] [blame] | 82 | * Inform the Flow Manager that a collection of Flow Entries have been |
| 83 | * pushed to a switch. |
Pavlin Radoslavov | da0ab44 | 2013-12-04 14:08:58 -0800 | [diff] [blame] | 84 | * |
Pavlin Radoslavov | ab3f886 | 2013-12-04 18:35:53 -0800 | [diff] [blame] | 85 | * @param entries the collection of <IOFSwitch, FlowEntry> pairs |
| 86 | * that have been pushed. |
Pavlin Radoslavov | da0ab44 | 2013-12-04 14:08:58 -0800 | [diff] [blame] | 87 | */ |
Pavlin Radoslavov | ab3f886 | 2013-12-04 18:35:53 -0800 | [diff] [blame] | 88 | public void flowEntriesPushedToSwitch( |
| 89 | Collection<Pair<IOFSwitch, FlowEntry>> entries); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 90 | } |