blob: b6df1e248cead84412dc1fc33369e1e62eaffcaa [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.
23 * @return true on success, otherwise false.
24 */
25 boolean addFlow(FlowPath flowPath, FlowId flowId);
26
27 /**
28 * Delete a previously added flow.
29 *
30 * @param flowId the Flow ID of the flow to delete.
31 * @return true on success, otherwise false.
32 */
33 boolean deleteFlow(FlowId flowId);
34
35 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070036 * Clear the state for a previously added flow.
37 *
38 * @param flowId the Flow ID of the flow to clear.
39 * @return true on success, otherwise false.
40 */
41 boolean clearFlow(FlowId flowId);
42
43 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080044 * Get a previously added flow.
45 *
46 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080047 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080048 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080049 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080050
51 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080052 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080053 * data path endpoints.
54 *
55 * @param installerId the Caller ID of the installer of the flow to get.
56 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080057 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080058 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080059 ArrayList<FlowPath> getAllFlows(CallerId installerId,
60 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080061
62 /**
63 * Get all installed flows by all installers for given data path endpoints.
64 *
65 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080066 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080067 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080068 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080069
70 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070071 * Get summary of all installed flows by all installers.
72 *
73 * @param flowId: starting flow Id of the range
74 * @param maxFlows: number of flows to return
75 * @return the Flow Paths if found, otherwise null.
76 */
77 ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
78
79 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080080 * Get all installed flows by all installers.
81 *
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080082 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080083 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080084 ArrayList<FlowPath> getAllFlows();
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070085
86 /**
87 * Add and maintain a shortest-path flow.
88 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -070089 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070090 * Instead, it contains a single dummy flow entry that is used to
91 * store the matching condition(s).
92 * That entry is replaced by the appropriate entries from the
93 * internally performed shortest-path computation.
94 *
95 * @param flowPath the Flow Path with the endpoints and the match
96 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -070097 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070098 */
Pavlin Radoslavove0575292013-03-28 05:35:25 -070099 public FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800100}