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.
23 public interface IForwardingRulesManager {
26 * It requests FRM to install the passed Flow Entry. FRM will request the
27 * SDN protocol plugin to install the flow on the network node. Based on the
28 * result of this operation FRM will update its database accordingly and
29 * will return the proper {@code Status} code.
32 * the flow entry to install
33 * @return the {@code Status} object indicating the result of this action.
35 public Status installFlowEntry(FlowEntry flow);
38 * It requests FRM to remove the passed Flow Entry. FRM will request the SDN
39 * protocol plugin to uninstall the flow from the network node. Based on the
40 * result of this operation FRM will update its database accordingly and
41 * will return the proper {@code Status} code.
44 * the flow entry to uninstall
45 * @return the {@code Status} object indicating the result of this action
47 public Status uninstallFlowEntry(FlowEntry flow);
50 * It requests FRM to replace the currently installed Flow Entry with the
51 * new one. It is up to the SDN protocol plugin to decide how to convey this
52 * message to the network node. It could be a delete + add or a single
53 * modify message depending on the SDN protocol specifications If the
54 * current flow is equal to the new one it will be a no op and success code
58 * the current flow entry to modify
60 * the new flow entry which will replace the current one
61 * @return the {@code Status} object indicating the result of this action
63 public Status modifyFlowEntry(FlowEntry current, FlowEntry newone);
66 * It requests the FRM to replace the currently installed Flow Entry with
67 * the new one. The currently installed entry is derived by the Match
68 * portion of the passed Flow. FRM looks in its database for a previously
69 * installed FlowEntry which Match equals the Match of the passed Flow. If
70 * it finds it, it will request the SDN protocol plugin to replace the
71 * existing flow with the new one on the network node. If it does not find
72 * it, it will request plugin to add the new flow. If the passed entry is
73 * not valid an error code is returned. If the existing flow is equal to the
74 * passed one it will be a no op and success code is returned.
78 * the new flow entry to install
79 * @return the {@code Status} object indicating the result of this action
81 public Status modifyOrAddFlowEntry(FlowEntry newone);
84 * It requests FRM to install the passed Flow Entry through an asynchronous
85 * call. A unique request id is returned to the caller. FRM will request the
86 * SDN protocol plugin to install the flow on the network node. As immediate
87 * result of this asynchronous call, FRM will update its flow database as if
88 * the flow was successfully installed.
91 * the flow entry to install
92 * @return the status of this request containing the request id associated
93 * to this asynchronous request
95 public Status installFlowEntryAsync(FlowEntry flow);
98 * It requests FRM to remove the passed Flow Entry through an asynchronous
99 * call. A unique request id is returned to the caller. FRM will request the
100 * SDN protocol plugin to uninstall the flow from the network node. As
101 * immediate result of this asynchronous call, FRM will update its flow
102 * database as if the flow was successfully installed.
105 * the flow entry to uninstall
106 * @return the status of this request containing the unique id associated to
107 * this asynchronous request
109 public Status uninstallFlowEntryAsync(FlowEntry flow);
112 * It requests FRM to replace the currently installed Flow Entry with the
113 * new one through an asynchronous call. A unique request id is returned to
114 * the caller. It is up to the SDN protocol plugin to decide how to convey
115 * this message to the network node. It could be a delete + add or a single
116 * modify message depending on the SDN protocol specifications. If the
117 * current flow is equal to the new one it will be a no op.
120 * the current flow entry to modify
122 * the new flow entry which will replace the current one
123 * @return the status of this request containing the request id associated
124 * to this asynchronous request
126 public Status modifyFlowEntryAsync(FlowEntry current, FlowEntry newone);
129 * It requests the FRM to replace the currently installed Flow Entry with
130 * the new one through an asynchronous call. A unique request id is returned
131 * to the caller. The currently installed entry is derived by the Match
132 * portion of the passed Flow. FRM looks in its database for a previously
133 * installed FlowEntry which Match equals the Match of the passed Flow. If
134 * it finds it, it will request the SDN protocol plugin to replace the
135 * existing flow with the new one on the network node. If it does not find
136 * it, it will request plugin to add the new flow. If the passed entry is
137 * not valid a zero request id is returned. If the existing flow is equal to
138 * the passed one it will be a no op.
141 * the new flow entry to install
142 * @return the unique id associated to this request. In case of not
143 * acceptable request -1 will be returned.
145 public Status modifyOrAddFlowEntryAsync(FlowEntry newone);
148 * Requests ForwardingRulesManager to solicit the network node to inform us
149 * about the status of its execution on the asynchronous requests that were
150 * sent to it so far. It is a way for an application to poke the network
151 * node in order to get a feedback asap on the asynchronous requests
152 * generated by the application. The caller may decide if this is a blocking
153 * or non-blocking operation. If blocking is set to true, the caller will be
154 * blocked until the solicitation response is received from the network node
155 * or receive timeout. Otherwise, it is a non-blocking call and does not
156 * guarantee the node will respond in any given time.
159 * The network node to solicit a response
162 * @return the status of this request containing the request id associated
163 * to this asynchronous request
165 public Status solicitStatusResponse(Node node, boolean blocking);
168 * Check whether the passed flow entry conflicts with the Container flows
171 * the flow entry to test
172 * @return true if conflicts, false otherwise
174 public boolean checkFlowEntryConflict(FlowEntry flow);
177 * Returns the list of Flow entries across network nodes which are part of
178 * the same flow group, policy
182 * @return the list of flow entries belonging to the specified group
184 public List<FlowEntry> getFlowEntriesForGroup(String group);
187 * Add a list of output port to the flow with the specified name on the
188 * specified network node
195 * the list of ports to be added to the flow output actions
197 public void addOutputPort(Node node, String flowName,
198 List<NodeConnector> dstPort);
201 * Remove a list of output port from the flow with the specified name on the
202 * specified network node
209 * list of ports to be removed from the flow output actions
211 public void removeOutputPort(Node node, String flowName,
212 List<NodeConnector> dstPort);
215 * Replace the current output port in the specified flow with the specified
225 * the new output action port
227 public void replaceOutputPort(Node node, String flowName,
228 NodeConnector outPort);
231 * Returns the output port configured on the specified flow
237 * @return the output action port for the specified flow
239 public NodeConnector getOutputPort(Node node, String flowName);
242 * Returns all the troubleshooting information that applications have set
243 * along with the policy they have configured through forwarding rules
246 * @return the collection of troubleshooting objects
248 public Map<String, Object> getTSPolicyData();
251 * Set the troubleshooting information for the policy
254 * the flow group name
256 * the object containing the troubleshooting information
258 * true for adding, false for removing
260 public void setTSPolicyData(String policyName, Object o, boolean add);
263 * Returns the troubleshooting information that was set for the specified
267 * the flows group name
268 * @return the troubleshooting info object
270 public Object getTSPolicyData(String policyName);
273 * Returns the specifications of all the flows configured for all the
274 * switches on the current container
276 * @return the list of flow configurations present in the database
278 public List<FlowConfig> getStaticFlows();
281 * Returns the specifications of all the flows configured for the given
282 * switch on the current container
285 * the network node identifier
286 * @return the list of {@code FlowConfig} objects
288 public List<FlowConfig> getStaticFlows(Node node);
291 * Returns the specification of the flow configured for the given network
292 * node on the current container
297 * the network node identifier
298 * @return the {@code FlowConfig} object
300 public FlowConfig getStaticFlow(String name, Node n);
303 * Returns the list of names of flows configured for the given Network node
304 * on the current container
307 * the network node identifier
308 * @return the list of flow names
310 public List<String> getStaticFlowNamesForNode(Node node);
313 * Returns the list of Node(s) for which a static flow has been configured
315 * @return the list of network nodes
317 public List<Node> getListNodeWithConfiguredFlows();
320 * Save the flow configured so far to file
322 * @return the {@code Status} object indicating the result of this action.
324 public Status saveConfig();
327 * Add a flow specified by the {@code FlowConfig} object on the current
331 * the {@code FlowConfig} object representing the static flow
333 * if set to true, the config object validation will be skipped.
334 * Used only internally, always set it to false.
335 * @return the {@code Status} object indicating the result of this action.
337 public Status addStaticFlow(FlowConfig config, boolean restore);
340 * Remove a flow specified by the {@code FlowConfig} object on the current
344 * the {@code FlowConfig} object representing the static flow
345 * @return the {@code Status} object indicating the result of this action
347 public Status removeStaticFlow(FlowConfig config);
350 * Replace the flow identified by the {@code FlowConfig.name} name for the
351 * {@code FlowConfig.node} network node with the new flow specified by
352 * {@code FlowConfig} object
355 * the {@code FlowConfig} object
356 * @returnthe {@code Status} object indicating the result of this action
358 public Status modifyStaticFlow(FlowConfig config);
361 * Remove the flow specified by name on the passed network node
364 * for the static flow
366 * on which the flow is attached
367 * @return the {@code Status} object indicating the result of this action
369 public Status removeStaticFlow(String name, Node node);
372 * Toggle the installation status of the specified configured flow If the
373 * flow configuration status is active, this call will change the flow
374 * status to inactive and vice-versa
376 * @param configObject
377 * the {@code FlowConfig} object
378 * @return the {@code Status} object indicating the result of this action
380 public Status toggleStaticFlowStatus(FlowConfig configObject);
383 * Toggle the installation status of the specified configured flow If the
384 * flow configuration status is active, this call will change the flow
385 * status to inactive and vice-versa
388 * for the static flow
390 * on which the flow is attached
391 * @return the {@code Status} object indicating the result of this action
393 public Status toggleStaticFlowStatus(String name, Node node);
395 public Map<String, PortGroupConfig> getPortGroupConfigs();
397 public boolean addPortGroupConfig(String name, String regex, boolean load);
399 public boolean delPortGroupConfig(String name);
401 public PortGroupProvider getPortGroupProvider();