blob: 1f8cd5b8b8672440d3e7795168acdaae8cfff27e [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;
4
5import net.floodlightcontroller.core.module.IFloodlightService;
HIGUCHI Yuta20514902013-06-12 11:24:16 -07006import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07007import net.onrc.onos.ofcontroller.util.CallerId;
8import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
9import net.onrc.onos.ofcontroller.util.FlowId;
10import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080011
12/**
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070013 * Interface for providing Flow Service to other modules.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080014 */
15public 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.
24 * @return true on success, otherwise false.
25 */
Pavlin Radoslavovbcc86ef2013-10-26 12:06:25 -070026 boolean addFlow(FlowPath flowPath, FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080027
28 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000029 * Delete all previously added flows.
30 *
31 * @return true on success, otherwise false.
32 */
33 boolean deleteAllFlows();
34
35 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080036 * Delete a previously added flow.
37 *
38 * @param flowId the Flow ID of the flow to delete.
39 * @return true on success, otherwise false.
40 */
41 boolean deleteFlow(FlowId flowId);
42
43 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000044 * Clear the state for all previously added flows.
45 *
46 * @return true on success, otherwise false.
47 */
48 boolean clearAllFlows();
49
50 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070051 * Clear the state for a previously added flow.
52 *
53 * @param flowId the Flow ID of the flow to clear.
54 * @return true on success, otherwise false.
55 */
56 boolean clearFlow(FlowId flowId);
57
58 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080059 * Get a previously added flow.
60 *
61 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080062 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080063 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080064 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080065
66 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070067 * Get all installed flows by all installers.
68 *
69 * @return the Flow Paths if found, otherwise null.
70 */
71 ArrayList<FlowPath> getAllFlows();
72
73 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080074 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080075 * data path endpoints.
76 *
77 * @param installerId the Caller ID of the installer of the flow to get.
78 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080079 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080080 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080081 ArrayList<FlowPath> getAllFlows(CallerId installerId,
82 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080083
84 /**
85 * Get all installed flows by all installers for given data path endpoints.
86 *
87 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080088 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080089 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080090 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080091
92 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070093 * Get summary of all installed flows by all installers.
94 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070095 * @param flowId starting flow Id of the range
96 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070097 * @return the Flow Paths if found, otherwise null.
98 */
Jonathan Hart01f2d272013-04-04 20:03:46 -070099 ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700100
101 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700102 * Add and maintain a shortest-path flow.
103 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700104 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700105 * Instead, it contains a single dummy flow entry that is used to
106 * store the matching condition(s).
107 * That entry is replaced by the appropriate entries from the
108 * internally performed shortest-path computation.
109 *
110 * @param flowPath the Flow Path with the endpoints and the match
111 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700112 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700113 */
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700114 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800115}