blob: 619d36b4e8a39aa2d5ae383852e1813beb674756 [file] [log] [blame]
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -08001package net.floodlightcontroller.flowcache;
2
3import java.util.ArrayList;
4
5import net.floodlightcontroller.core.module.IFloodlightService;
6import net.floodlightcontroller.util.CallerId;
7import net.floodlightcontroller.util.DataPathEndpoints;
8import net.floodlightcontroller.util.FlowId;
9import net.floodlightcontroller.util.FlowPath;
10
11/**
12 * @short Interface for providing Flow Service to other modules.
13 */
14public interface IFlowService extends IFloodlightService {
15 /**
16 * Add a flow.
17 *
18 * Internally, ONOS will automatically register the installer for
19 * receiving Flow Path Notifications for that path.
20 *
21 * @param flowPath the Flow Path to install.
22 * @param flowId the return-by-reference Flow ID as assigned internally.
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070023 * @param dataPathSummaryStr the data path summary string if the added
24 * flow will be maintained internally, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080025 * @return true on success, otherwise false.
26 */
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070027 boolean addFlow(FlowPath flowPath, FlowId flowId,
28 String dataPathSummaryStr);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080029
30 /**
31 * Delete a previously added flow.
32 *
33 * @param flowId the Flow ID of the flow to delete.
34 * @return true on success, otherwise false.
35 */
36 boolean deleteFlow(FlowId flowId);
37
38 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070039 * Clear the state for a previously added flow.
40 *
41 * @param flowId the Flow ID of the flow to clear.
42 * @return true on success, otherwise false.
43 */
44 boolean clearFlow(FlowId flowId);
45
46 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080047 * Get a previously added flow.
48 *
49 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080050 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080051 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080052 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080053
54 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080055 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080056 * data path endpoints.
57 *
58 * @param installerId the Caller ID of the installer of the flow to get.
59 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080060 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080061 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080062 ArrayList<FlowPath> getAllFlows(CallerId installerId,
63 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080064
65 /**
66 * Get all installed flows by all installers for given data path endpoints.
67 *
68 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080069 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080070 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080071 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080072
73 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070074 * Get summary of all installed flows by all installers.
75 *
76 * @param flowId: starting flow Id of the range
77 * @param maxFlows: number of flows to return
78 * @return the Flow Paths if found, otherwise null.
79 */
80 ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
81
82 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080083 * Get all installed flows by all installers.
84 *
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080085 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080086 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080087 ArrayList<FlowPath> getAllFlows();
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070088
89 /**
90 * Add and maintain a shortest-path flow.
91 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -070092 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070093 * Instead, it contains a single dummy flow entry that is used to
94 * store the matching condition(s).
95 * That entry is replaced by the appropriate entries from the
96 * internally performed shortest-path computation.
97 *
98 * @param flowPath the Flow Path with the endpoints and the match
99 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700100 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700101 */
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700102 public FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800103}