blob: 8c908cf714e2aa6923ead541cc13f7cd992ce90f [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;
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.
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070024 * @param dataPathSummaryStr the data path summary string if the added
25 * flow will be maintained internally, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080026 * @return true on success, otherwise false.
27 */
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -070028 boolean addFlow(FlowPath flowPath, FlowId flowId,
29 String dataPathSummaryStr);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080030
31 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000032 * Delete all previously added flows.
33 *
34 * @return true on success, otherwise false.
35 */
36 boolean deleteAllFlows();
37
38 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080039 * Delete a previously added flow.
40 *
41 * @param flowId the Flow ID of the flow to delete.
42 * @return true on success, otherwise false.
43 */
44 boolean deleteFlow(FlowId flowId);
45
46 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000047 * Clear the state for all previously added flows.
48 *
49 * @return true on success, otherwise false.
50 */
51 boolean clearAllFlows();
52
53 /**
Pavlin Radoslavov916832f2013-03-14 17:48:41 -070054 * Clear the state for a previously added flow.
55 *
56 * @param flowId the Flow ID of the flow to clear.
57 * @return true on success, otherwise false.
58 */
59 boolean clearFlow(FlowId flowId);
60
61 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080062 * Get a previously added flow.
63 *
64 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080065 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080066 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080067 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080068
69 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070070 * Get all installed flows by all installers.
71 *
72 * @return the Flow Paths if found, otherwise null.
73 */
74 ArrayList<FlowPath> getAllFlows();
75
76 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080077 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080078 * data path endpoints.
79 *
80 * @param installerId the Caller ID of the installer of the flow to get.
81 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080082 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080083 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080084 ArrayList<FlowPath> getAllFlows(CallerId installerId,
85 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080086
87 /**
88 * Get all installed flows by all installers for given data path endpoints.
89 *
90 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080091 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080092 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080093 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080094
95 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070096 * Get summary of all installed flows by all installers.
97 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070098 * @param flowId starting flow Id of the range
99 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700100 * @return the Flow Paths if found, otherwise null.
101 */
Jonathan Hart01f2d272013-04-04 20:03:46 -0700102 ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700103
104 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700105 * Add and maintain a shortest-path flow.
106 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700107 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700108 * Instead, it contains a single dummy flow entry that is used to
109 * store the matching condition(s).
110 * That entry is replaced by the appropriate entries from the
111 * internally performed shortest-path computation.
112 *
113 * @param flowPath the Flow Path with the endpoints and the match
114 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -0700115 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700116 */
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700117 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
118
119 /**
120 * Receive a notification that a Flow is added.
121 *
122 * @param flowPath the flow that is added.
123 */
124 void notificationRecvFlowAdded(FlowPath flowPath);
125
126 /**
127 * Receive a notification that a Flow is removed.
128 *
129 * @param flowPath the flow that is removed.
130 */
131 void notificationRecvFlowRemoved(FlowPath flowPath);
132
133 /**
134 * Receive a notification that a Flow is updated.
135 *
136 * @param flowPath the flow that is updated.
137 */
138 void notificationRecvFlowUpdated(FlowPath flowPath);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800139}