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
206 * @return the list of flow entries belonging to the specified group
208 public List<FlowEntry> getFlowEntriesForGroup(String group);
211 * Add a list of output port to the flow with the specified name on the
212 * specified network node
219 * the list of ports to be added to the flow output actions
221 public void addOutputPort(Node node, String flowName, List<NodeConnector> dstPort);
224 * Remove a list of output port from the flow with the specified name on the
225 * specified network node
232 * list of ports to be removed from the flow output actions
234 public void removeOutputPort(Node node, String flowName, List<NodeConnector> dstPort);
237 * Replace the current output port in the specified flow with the specified
247 * the new output action port
249 public void replaceOutputPort(Node node, String flowName, NodeConnector outPort);
252 * Returns the output port configured on the specified flow
258 * @return the output action port for the specified flow
260 public NodeConnector getOutputPort(Node node, String flowName);
263 * Returns all the troubleshooting information that applications have set
264 * along with the policy they have configured through forwarding rules
267 * @return the collection of troubleshooting objects
269 public Map<String, Object> getTSPolicyData();
272 * Set the troubleshooting information for the policy
275 * the flow group name
277 * the object containing the troubleshooting information
279 * true for adding, false for removing
281 public void setTSPolicyData(String policyName, Object o, boolean add);
284 * Returns the troubleshooting information that was set for the specified
288 * the flows group name
289 * @return the troubleshooting info object
291 public Object getTSPolicyData(String policyName);
294 * Returns the specifications of all the flows configured for all the
295 * switches on the current container
297 * @return the list of flow configurations present in the database
299 public List<FlowConfig> getStaticFlows();
302 * Returns the specifications of all the flows configured for the given
303 * switch on the current container
306 * the network node identifier
307 * @return the list of {@code FlowConfig} objects
309 public List<FlowConfig> getStaticFlows(Node node);
312 * Returns the specification of the flow configured for the given network
313 * node on the current container
318 * the network node identifier
319 * @return the {@code FlowConfig} object
321 public FlowConfig getStaticFlow(String name, Node n);
324 * Returns the list of names of flows configured for the given Network node
325 * on the current container
328 * the network node identifier
329 * @return the list of flow names
331 public List<String> getStaticFlowNamesForNode(Node node);
334 * Returns the list of Node(s) for which a static flow has been configured
336 * @return the list of network nodes
338 public List<Node> getListNodeWithConfiguredFlows();
341 * Save the flow configured so far to file
343 * @return the {@code Status} object indicating the result of this action.
345 public Status saveConfig();
348 * Add a flow specified by the {@code FlowConfig} object on the current
352 * the {@code FlowConfig} object representing the static flow
354 * if set to true, the config object validation will be skipped.
355 * Used only internally, always set it to false.
356 * @return the {@code Status} object indicating the result of this action.
358 public Status addStaticFlow(FlowConfig config, boolean restore);
361 * Remove a flow specified by the {@code FlowConfig} object on the current
365 * the {@code FlowConfig} object representing the static flow
366 * @return the {@code Status} object indicating the result of this action
368 public Status removeStaticFlow(FlowConfig config);
371 * Replace the flow identified by the {@code FlowConfig.name} name for the
372 * {@code FlowConfig.node} network node with the new flow specified by
373 * {@code FlowConfig} object
376 * the {@code FlowConfig} object
377 * @returnthe {@code Status} object indicating the result of this action
379 public Status modifyStaticFlow(FlowConfig config);
382 * Remove the flow specified by name on the passed network node
385 * for the static flow
387 * on which the flow is attached
388 * @return the {@code Status} object indicating the result of this action
390 public Status removeStaticFlow(String name, Node node);
393 * Toggle the installation status of the specified configured flow If the
394 * flow configuration status is active, this call will change the flow
395 * status to inactive and vice-versa
397 * @param configObject
398 * the {@code FlowConfig} object
399 * @return the {@code Status} object indicating the result of this action
401 public Status toggleStaticFlowStatus(FlowConfig configObject);
404 * Toggle the installation status of the specified configured flow If the
405 * flow configuration status is active, this call will change the flow
406 * status to inactive and vice-versa
409 * for the static flow
411 * on which the flow is attached
412 * @return the {@code Status} object indicating the result of this action
414 public Status toggleStaticFlowStatus(String name, Node node);
416 public Map<String, PortGroupConfig> getPortGroupConfigs();
418 public boolean addPortGroupConfig(String name, String regex, boolean load);
420 public boolean delPortGroupConfig(String name);
422 public PortGroupProvider getPortGroupProvider();