blob: a15f56c1d4d0410ddf9a6c89f8a200d1f51838b5 [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;
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -07007import net.onrc.onos.ofcontroller.topology.TopologyElement;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07008import net.onrc.onos.ofcontroller.util.CallerId;
9import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
10import net.onrc.onos.ofcontroller.util.FlowId;
11import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080012
13/**
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070014 * Interface for providing Flow Service to other modules.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080015 */
16public interface IFlowService extends IFloodlightService {
17 /**
18 * Add a flow.
19 *
20 * Internally, ONOS will automatically register the installer for
21 * receiving Flow Path Notifications for that path.
22 *
23 * @param flowPath the Flow Path to install.
24 * @param flowId the return-by-reference Flow ID as assigned internally.
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070025 * @param dataPathSummaryStr the data path summary string if the added
26 * flow will be maintained internally, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080027 * @return true on success, otherwise false.
28 */
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070029 boolean addFlow(FlowPath flowPath, FlowId flowId,
30 String dataPathSummaryStr);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080031
32 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000033 * Delete all previously added flows.
34 *
35 * @return true on success, otherwise false.
36 */
37 boolean deleteAllFlows();
38
39 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080040 * Delete a previously added flow.
41 *
42 * @param flowId the Flow ID of the flow to delete.
43 * @return true on success, otherwise false.
44 */
45 boolean deleteFlow(FlowId flowId);
46
47 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000048 * Clear the state for all previously added flows.
49 *
50 * @return true on success, otherwise false.
51 */
52 boolean clearAllFlows();
53
54 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070055 * Clear the state for a previously added flow.
56 *
57 * @param flowId the Flow ID of the flow to clear.
58 * @return true on success, otherwise false.
59 */
60 boolean clearFlow(FlowId flowId);
61
62 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080063 * Get a previously added flow.
64 *
65 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080066 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080067 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080068 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080069
70 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070071 * Get all installed flows by all installers.
72 *
73 * @return the Flow Paths if found, otherwise null.
74 */
75 ArrayList<FlowPath> getAllFlows();
76
77 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080078 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080079 * data path endpoints.
80 *
81 * @param installerId the Caller ID of the installer of the flow to get.
82 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080083 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080084 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080085 ArrayList<FlowPath> getAllFlows(CallerId installerId,
86 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080087
88 /**
89 * Get all installed flows by all installers for given data path endpoints.
90 *
91 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080092 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080093 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080094 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080095
96 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070097 * Get summary of all installed flows by all installers.
98 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070099 * @param flowId starting flow Id of the range
100 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700101 * @return the Flow Paths if found, otherwise null.
102 */
Jonathan Hart01f2d272013-04-04 20:03:46 -0700103 ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700104
105 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700106 * Add and maintain a shortest-path flow.
107 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700108 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700109 * Instead, it contains a single dummy flow entry that is used to
110 * store the matching condition(s).
111 * That entry is replaced by the appropriate entries from the
112 * internally performed shortest-path computation.
113 *
114 * @param flowPath the Flow Path with the endpoints and the match
115 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700116 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700117 */
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700118 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
119
120 /**
121 * Receive a notification that a Flow is added.
122 *
123 * @param flowPath the flow that is added.
124 */
125 void notificationRecvFlowAdded(FlowPath flowPath);
126
127 /**
128 * Receive a notification that a Flow is removed.
129 *
130 * @param flowPath the flow that is removed.
131 */
132 void notificationRecvFlowRemoved(FlowPath flowPath);
133
134 /**
135 * Receive a notification that a Flow is updated.
136 *
137 * @param flowPath the flow that is updated.
138 */
139 void notificationRecvFlowUpdated(FlowPath flowPath);
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700140
141 /**
142 * Receive a notification that a Topology Element is added.
143 *
144 * @param topologyElement the Topology Element that is added.
145 */
146 void notificationRecvTopologyElementAdded(TopologyElement topologyElement);
147
148 /**
149 * Receive a notification that a Topology Element is removed.
150 *
151 * @param topologyElement the Topology Element that is removed.
152 */
153 void notificationRecvTopologyElementRemoved(TopologyElement topologyElement);
154
155 /**
156 * Receive a notification that a Topology Element is updated.
157 *
158 * @param topologyElement the Topology Element that is updated.
159 */
160 void notificationRecvTopologyElementUpdated(TopologyElement topologyElement);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800161}