2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.forwardingrulesmanager;
11 import java.util.List;
14 import org.opendaylight.controller.sal.core.Node;
15 import org.opendaylight.controller.sal.core.NodeConnector;
16 import org.opendaylight.controller.sal.utils.Status;
19 * Interface that describes methods for installing or removing forwarding rules
20 * and to access to the flows database.
22 public interface IForwardingRulesManager {
25 * It requests FRM to install the passed Flow Entry. FRM will request the
26 * SDN protocol plugin to install the flow on the network node. Based on the
27 * result of this operation FRM will update its database accordingly and
28 * will return the proper {@code Status} code.
31 * the flow entry to install
32 * @return the {@code Status} object indicating the result of this action.
34 public Status installFlowEntry(FlowEntry flow);
37 * It requests FRM to remove the passed Flow Entry. FRM will request the SDN
38 * protocol plugin to uninstall the flow from the network node. Based on the
39 * result of this operation FRM will update its database accordingly and
40 * will return the proper {@code Status} code.
43 * the flow entry to uninstall
44 * @return the {@code Status} object indicating the result of this action
46 public Status uninstallFlowEntry(FlowEntry flow);
49 * It requests FRM to remove all the Flow Entry that are part of the
50 * specified group. FRM will request the SDN protocol plugin to uninstall
51 * the flows from the network node one by one. Based on the result of this
52 * operation FRM will update its database accordingly and will return the
53 * proper {@code Status} code.
57 * @return the {@code Status} object indicating the result of this action
59 public Status uninstallFlowEntryGroup(String groupName);
62 * It requests FRM to replace the currently installed Flow Entry with the
63 * new one. It is up to the SDN protocol plugin to decide how to convey this
64 * message to the network node. It could be a delete + add or a single
65 * modify message depending on the SDN protocol specifications If the
66 * current flow is equal to the new one it will be a no op and success code
70 * the current flow entry to modify
72 * the new flow entry which will replace the current one
73 * @return the {@code Status} object indicating the result of this action
75 public Status modifyFlowEntry(FlowEntry current, FlowEntry newone);
78 * It requests the FRM to replace the currently installed Flow Entry with
79 * the new one. The currently installed entry is derived by the Match
80 * portion of the passed Flow. FRM looks in its database for a previously
81 * installed FlowEntry which Match equals the Match of the passed Flow. If
82 * it finds it, it will request the SDN protocol plugin to replace the
83 * existing flow with the new one on the network node. If it does not find
84 * it, it will request plugin to add the new flow. If the passed entry is
85 * not valid an error code is returned. If the existing flow is equal to the
86 * passed one it will be a no op and success code is returned.
89 * the new flow entry to install
90 * @return the {@code Status} object indicating the result of this action
92 public Status modifyOrAddFlowEntry(FlowEntry newone);
95 * It requests FRM to install the passed Flow Entry through an asynchronous
96 * call. A unique request id is returned to the caller. FRM will request the
97 * SDN protocol plugin to install the flow on the network node. As immediate
98 * result of this asynchronous call, FRM will update its flow database as if
99 * the flow was successfully installed.
102 * the flow entry to install
103 * @return the status of this request containing the request id associated
104 * to this asynchronous request
106 public Status installFlowEntryAsync(FlowEntry flow);
109 * It requests FRM to remove the passed Flow Entry through an asynchronous
110 * call. A unique request id is returned to the caller. FRM will request the
111 * SDN protocol plugin to uninstall the flow from the network node. As
112 * immediate result of this asynchronous call, FRM will update its flow
113 * database as if the flow was successfully removed.
116 * the flow entry to uninstall
117 * @return the status of this request containing the unique id associated to
118 * this asynchronous request
120 public Status uninstallFlowEntryAsync(FlowEntry flow);
123 * It requests FRM to remove all the Flow Entry that are part of the
124 * specified group through an asynchronous call. FRM will request the SDN
125 * protocol plugin to uninstall the flows from the network node one by one.
126 * As immediate result of this asynchronous call, FRM will update its flow
127 * database as if the flow was successfully removed.
131 * @return the {@code Status} object indicating the result of this action
133 public Status uninstallFlowEntryGroupAsync(String groupName);
136 * It requests FRM to replace the currently installed Flow Entry with the
137 * new one through an asynchronous call. A unique request id is returned to
138 * the caller. It is up to the SDN protocol plugin to decide how to convey
139 * this message to the network node. It could be a delete + add or a single
140 * modify message depending on the SDN protocol specifications. If the
141 * current flow is equal to the new one it will be a no op.
144 * the current flow entry to modify
146 * the new flow entry which will replace the current one
147 * @return the status of this request containing the request id associated
148 * to this asynchronous request
150 public Status modifyFlowEntryAsync(FlowEntry current, FlowEntry newone);
153 * It requests the FRM to replace the currently installed Flow Entry with
154 * the new one through an asynchronous call. A unique request id is returned
155 * to the caller. The currently installed entry is derived by the Match
156 * portion of the passed Flow. FRM looks in its database for a previously
157 * installed FlowEntry which Match equals the Match of the passed Flow. If
158 * it finds it, it will request the SDN protocol plugin to replace the
159 * existing flow with the new one on the network node. If it does not find
160 * it, it will request plugin to add the new flow. If the passed entry is
161 * not valid a zero request id is returned. If the existing flow is equal to
162 * the passed one it will be a no op.
165 * the new flow entry to install
166 * @return the unique id associated to this request. In case of not
167 * acceptable request -1 will be returned.
169 public Status modifyOrAddFlowEntryAsync(FlowEntry newone);
172 * Requests ForwardingRulesManager to solicit the network node to inform us
173 * about the status of its execution on the asynchronous requests that were
174 * sent to it so far. It is a way for an application to poke the network
175 * node in order to get a feedback asap on the asynchronous requests
176 * generated by the application. The caller may decide if this is a blocking
177 * or non-blocking operation. If blocking is set to true, the caller will be
178 * blocked until the solicitation response is received from the network node
179 * or receive timeout. Otherwise, it is a non-blocking call and does not
180 * guarantee the node will respond in any given time.
183 * The network node to solicit a response
186 * @return the status of this request containing the request id associated
187 * to this asynchronous request
189 public Status solicitStatusResponse(Node node, boolean blocking);
192 * Check whether the passed flow entry conflicts with the Container flows
195 * the flow entry to test
196 * @return true if conflicts, false otherwise
198 public boolean checkFlowEntryConflict(FlowEntry flow);
201 * Returns the list of Flow entries across network nodes which are part of
202 * the same flow group, policy. This list contains the flows as they were
203 * requested to be installed by the applications, before any merging with
204 * container flow is done.
208 * @return the original list of flow entries belonging to the specified group
210 public List<FlowEntry> getFlowEntriesForGroup(String group);
213 * Returns the list of Flow entries installed in network nodes which are part of
214 * the same flow group, policy. This list contains the effective flows installed
215 * on the nodes after the merging with any possible container flow was performed.
216 * If no container flow are specified, this method returns the same list returned
217 * by getFlowEntriesForGroup(String group).
221 * @return the list of container flow merged flow entries belonging to the specified group
223 public List<FlowEntry> getInstalledFlowEntriesForGroup(String policyName);
226 * Add a list of output port to the flow with the specified name on the
227 * specified network node
234 * the list of ports to be added to the flow output actions
236 public void addOutputPort(Node node, String flowName, List<NodeConnector> dstPort);
239 * Remove a list of output port from the flow with the specified name on the
240 * specified network node
247 * list of ports to be removed from the flow output actions
249 public void removeOutputPort(Node node, String flowName, List<NodeConnector> dstPort);
252 * Replace the current output port in the specified flow with the specified
262 * the new output action port
264 public void replaceOutputPort(Node node, String flowName, NodeConnector outPort);
267 * Returns the output port configured on the specified flow
273 * @return the output action port for the specified flow
275 public NodeConnector getOutputPort(Node node, String flowName);
278 * Returns all the troubleshooting information that applications have set
279 * along with the policy they have configured through forwarding rules
282 * @return the collection of troubleshooting objects
284 public Map<String, Object> getTSPolicyData();
287 * Set the troubleshooting information for the policy
290 * the flow group name
292 * the object containing the troubleshooting information
294 * true for adding, false for removing
296 public void setTSPolicyData(String policyName, Object o, boolean add);
299 * Returns the troubleshooting information that was set for the specified
303 * the flows group name
304 * @return the troubleshooting info object
306 public Object getTSPolicyData(String policyName);
309 * Returns the specifications of all the flows configured for all the
310 * switches on the current container
312 * @return the list of flow configurations present in the database
314 public List<FlowConfig> getStaticFlows();
317 * Returns the specifications of all the flows configured for the given
318 * switch on the current container
321 * the network node identifier
322 * @return the list of {@code FlowConfig} objects
324 public List<FlowConfig> getStaticFlows(Node node);
327 * Returns the specification of the flow configured for the given network
328 * node on the current container
333 * the network node identifier
334 * @return the {@code FlowConfig} object
336 public FlowConfig getStaticFlow(String name, Node n);
339 * Returns the list of names of flows configured for the given Network node
340 * on the current container
343 * the network node identifier
344 * @return the list of flow names
346 public List<String> getStaticFlowNamesForNode(Node node);
349 * Returns the list of Node(s) for which a static flow has been configured
351 * @return the list of network nodes
353 public List<Node> getListNodeWithConfiguredFlows();
356 * Save the flow configured so far to file
358 * @return the {@code Status} object indicating the result of this action.
360 public Status saveConfig();
363 * Add a flow specified by the {@code FlowConfig} object on the current
367 * the {@code FlowConfig} object representing the static flow
368 * @return the {@code Status} object indicating the result of this action.
370 public Status addStaticFlow(FlowConfig config);
373 * Remove a flow specified by the {@code FlowConfig} object on the current
377 * the {@code FlowConfig} object representing the static flow
378 * @return the {@code Status} object indicating the result of this action
380 public Status removeStaticFlow(FlowConfig config);
383 * Replace the flow identified by the {@code FlowConfig.name} name for the
384 * {@code FlowConfig.node} network node with the new flow specified by
385 * {@code FlowConfig} object
388 * the {@code FlowConfig} object
389 * @returnthe {@code Status} object indicating the result of this action
391 public Status modifyStaticFlow(FlowConfig config);
394 * Remove the flow specified by name on the passed network node
397 * for the static flow
399 * on which the flow is attached
400 * @return the {@code Status} object indicating the result of this action
402 public Status removeStaticFlow(String name, Node node);
405 * Toggle the installation status of the specified configured flow If the
406 * flow configuration status is active, this call will change the flow
407 * status to inactive and vice-versa
409 * @param configObject
410 * the {@code FlowConfig} object
411 * @return the {@code Status} object indicating the result of this action
413 public Status toggleStaticFlowStatus(FlowConfig configObject);
416 * Toggle the installation status of the specified configured flow If the
417 * flow configuration status is active, this call will change the flow
418 * status to inactive and vice-versa
421 * for the static flow
423 * on which the flow is attached
424 * @return the {@code Status} object indicating the result of this action
426 public Status toggleStaticFlowStatus(String name, Node node);
428 public Map<String, PortGroupConfig> getPortGroupConfigs();
430 public boolean addPortGroupConfig(String name, String regex, boolean load);
432 public boolean delPortGroupConfig(String name);
434 public PortGroupProvider getPortGroupProvider();