blob: 549a0fcdfe29fe164466ea70dbf80cd670132c68 [file] [log] [blame]
HIGUCHI Yuta60a10142013-06-14 15:50:10 -07001package net.onrc.onos.ofcontroller.flowmanager;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -08002
3import java.util.ArrayList;
Pavlin Radoslavovab3f8862013-12-04 18:35:53 -08004import java.util.Collection;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -08005
Brian O'Connor4f0b60c2013-11-26 15:00:04 -08006import net.floodlightcontroller.core.IOFSwitch;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -08007import net.floodlightcontroller.core.module.IFloodlightService;
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -08008import net.onrc.onos.ofcontroller.topology.Topology;
Pavlin Radoslavovda0ab442013-12-04 14:08:58 -08009import net.onrc.onos.ofcontroller.util.FlowEntry;
Pavlin Radoslavov4df85ae2013-11-26 14:48:32 -080010import net.onrc.onos.ofcontroller.util.FlowEntryId;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -070011import net.onrc.onos.ofcontroller.util.FlowId;
12import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavovab3f8862013-12-04 18:35:53 -080013import net.onrc.onos.ofcontroller.util.Pair;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080014
15/**
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070016 * Interface for providing Flow Service to other modules.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080017 */
18public interface IFlowService extends IFloodlightService {
19 /**
20 * Add a flow.
21 *
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080022 * @param flowPath the Flow Path to install.
Pavlin Radoslavov051abb42013-12-05 17:24:50 -080023 * @return the Flow ID on success, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080024 */
Pavlin Radoslavov051abb42013-12-05 17:24:50 -080025 FlowId addFlow(FlowPath flowPath);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080026
27 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000028 * Delete all previously added flows.
29 *
30 * @return true on success, otherwise false.
31 */
32 boolean deleteAllFlows();
33
34 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080035 * 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 Radoslavovb6f53542013-03-01 16:02:14 -080046 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080047 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080048 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080049
50 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070051 * 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 Krishnaswamy57a32a92013-03-21 14:21:15 -070058 * Get summary of all installed flows by all installers.
59 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070060 * @param flowId starting flow Id of the range
61 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070062 * @return the Flow Paths if found, otherwise null.
63 */
Pavlin Radoslavov4ef6ba22013-11-22 19:32:58 -080064 ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -080065
66 /**
67 * Get the network topology.
68 *
69 * @return the network topology.
70 */
71 Topology getTopology();
Pavlin Radoslavovda0ab442013-12-04 14:08:58 -080072
Jonathan Hart97099912013-11-14 13:40:16 -080073 /**
74 * Get a globally unique flow ID from the flow service.
75 * NOTE: Not currently guaranteed to be globally unique.
76 *
77 * @return unique flow ID
78 */
79 public long getNextFlowEntryId();
Pavlin Radoslavov4df85ae2013-11-26 14:48:32 -080080
81 /**
82 * Inform the Flow Manager that a Flow Entry on switch expired.
83 *
Pavlin Radoslavov3bd5ccf2013-11-26 15:10:21 -080084 * @param sw the switch the Flow Entry expired on.
Pavlin Radoslavov4df85ae2013-11-26 14:48:32 -080085 * @param flowEntryId the Flow Entry ID of the expired Flow Entry.
86 */
Brian O'Connor4f0b60c2013-11-26 15:00:04 -080087 public void flowEntryOnSwitchExpired(IOFSwitch sw, FlowEntryId flowEntryId);
Pavlin Radoslavovda0ab442013-12-04 14:08:58 -080088
89 /**
Pavlin Radoslavovab3f8862013-12-04 18:35:53 -080090 * Inform the Flow Manager that a collection of Flow Entries have been
91 * pushed to a switch.
Pavlin Radoslavovda0ab442013-12-04 14:08:58 -080092 *
Pavlin Radoslavovab3f8862013-12-04 18:35:53 -080093 * @param entries the collection of <IOFSwitch, FlowEntry> pairs
94 * that have been pushed.
Pavlin Radoslavovda0ab442013-12-04 14:08:58 -080095 */
Pavlin Radoslavovab3f8862013-12-04 18:35:53 -080096 public void flowEntriesPushedToSwitch(
97 Collection<Pair<IOFSwitch, FlowEntry>> entries);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080098}