blob: bd9819ec76b07c50cc3a571cc2afb1a02533f1fa [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.
25 * @return true on success, otherwise false.
26 */
Pavlin Radoslavovbcc86ef2013-10-26 12:06:25 -070027 boolean addFlow(FlowPath flowPath, FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080028
29 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000030 * Delete all previously added flows.
31 *
32 * @return true on success, otherwise false.
33 */
34 boolean deleteAllFlows();
35
36 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080037 * Delete a previously added flow.
38 *
39 * @param flowId the Flow ID of the flow to delete.
40 * @return true on success, otherwise false.
41 */
42 boolean deleteFlow(FlowId flowId);
43
44 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000045 * Clear the state for all previously added flows.
46 *
47 * @return true on success, otherwise false.
48 */
49 boolean clearAllFlows();
50
51 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070052 * Clear the state for a previously added flow.
53 *
54 * @param flowId the Flow ID of the flow to clear.
55 * @return true on success, otherwise false.
56 */
57 boolean clearFlow(FlowId flowId);
58
59 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080060 * Get a previously added flow.
61 *
62 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080063 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080064 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080065 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080066
67 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070068 * Get all installed flows by all installers.
69 *
70 * @return the Flow Paths if found, otherwise null.
71 */
72 ArrayList<FlowPath> getAllFlows();
73
74 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080075 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080076 * data path endpoints.
77 *
78 * @param installerId the Caller ID of the installer of the flow to get.
79 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080080 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080081 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080082 ArrayList<FlowPath> getAllFlows(CallerId installerId,
83 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080084
85 /**
86 * Get all installed flows by all installers for given data path endpoints.
87 *
88 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080089 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080090 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080091 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080092
93 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070094 * Get summary of all installed flows by all installers.
95 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070096 * @param flowId starting flow Id of the range
97 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070098 * @return the Flow Paths if found, otherwise null.
99 */
Jonathan Hart01f2d272013-04-04 20:03:46 -0700100 ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700101
102 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700103 * Add and maintain a shortest-path flow.
104 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700105 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700106 * Instead, it contains a single dummy flow entry that is used to
107 * store the matching condition(s).
108 * That entry is replaced by the appropriate entries from the
109 * internally performed shortest-path computation.
110 *
111 * @param flowPath the Flow Path with the endpoints and the match
112 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700113 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700114 */
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700115 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
116
117 /**
118 * Receive a notification that a Flow is added.
119 *
120 * @param flowPath the flow that is added.
121 */
122 void notificationRecvFlowAdded(FlowPath flowPath);
123
124 /**
125 * Receive a notification that a Flow is removed.
126 *
127 * @param flowPath the flow that is removed.
128 */
129 void notificationRecvFlowRemoved(FlowPath flowPath);
130
131 /**
132 * Receive a notification that a Flow is updated.
133 *
134 * @param flowPath the flow that is updated.
135 */
136 void notificationRecvFlowUpdated(FlowPath flowPath);
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700137
138 /**
139 * Receive a notification that a Topology Element is added.
140 *
141 * @param topologyElement the Topology Element that is added.
142 */
143 void notificationRecvTopologyElementAdded(TopologyElement topologyElement);
144
145 /**
146 * Receive a notification that a Topology Element is removed.
147 *
148 * @param topologyElement the Topology Element that is removed.
149 */
150 void notificationRecvTopologyElementRemoved(TopologyElement topologyElement);
151
152 /**
153 * Receive a notification that a Topology Element is updated.
154 *
155 * @param topologyElement the Topology Element that is updated.
156 */
157 void notificationRecvTopologyElementUpdated(TopologyElement topologyElement);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800158}