blob: ba3a6e7055ef3acfb09ae2b1fb9e07a9a408c009 [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;
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -08006import net.onrc.onos.ofcontroller.topology.Topology;
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 /**
44 * 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 Radoslavov661c86f2013-10-21 12:40:40 -070052 * Get all installed flows by all installers.
53 *
54 * @return the Flow Paths if found, otherwise null.
55 */
56 ArrayList<FlowPath> getAllFlows();
57
58 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080059 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080060 * data path endpoints.
61 *
62 * @param installerId the Caller ID of the installer of the flow to get.
63 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080064 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080065 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080066 ArrayList<FlowPath> getAllFlows(CallerId installerId,
67 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080068
69 /**
70 * Get all installed flows by all installers for given data path endpoints.
71 *
72 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080073 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080074 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080075 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080076
77 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070078 * Get summary of all installed flows by all installers.
79 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070080 * @param flowId starting flow Id of the range
81 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070082 * @return the Flow Paths if found, otherwise null.
83 */
Pavlin Radoslavov4ef6ba22013-11-22 19:32:58 -080084 ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070085
86 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070087 * 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 Radoslavov1308dc62013-10-25 15:54:31 -070099 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -0800100
101 /**
102 * Get the network topology.
103 *
104 * @return the network topology.
105 */
106 Topology getTopology();
Jonathan Hart97099912013-11-14 13:40:16 -0800107
108 /**
109 * Get a globally unique flow ID from the flow service.
110 * NOTE: Not currently guaranteed to be globally unique.
111 *
112 * @return unique flow ID
113 */
114 public long getNextFlowEntryId();
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800115}