blob: 5a57b8814788d1be638603f6231f7f2eb0f13e5f [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.net.flow;
2
alshabiba68eb962014-09-24 20:34:13 -07003import org.onlab.onos.ApplicationId;
alshabib902d41b2014-10-07 16:52:05 -07004import org.onlab.onos.net.intent.BatchOperation;
tomc1a38d32014-08-25 23:01:32 -07005import org.onlab.onos.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -07006
Madan Jampani117aaae2014-10-23 10:04:05 -07007import com.google.common.util.concurrent.ListenableFuture;
8
tom0eb04ca2014-08-25 14:34:51 -07009/**
10 * Abstraction of a flow rule provider.
11 */
12public interface FlowRuleProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070013
alshabibba5ac482014-10-02 17:15:20 -070014 static final int POLL_INTERVAL = 5;
15
tom8bb16062014-09-12 14:47:46 -070016 /**
17 * Instructs the provider to apply the specified flow rules to their
18 * respective devices.
19 * @param flowRules one or more flow rules
20 * throws SomeKindOfException that indicates which ones were applied and
21 * which ones failed
22 */
23 void applyFlowRule(FlowRule... flowRules);
24
alshabib57044ba2014-09-16 15:58:01 -070025 /**
26 * Instructs the provider to remove the specified flow rules to their
27 * respective devices.
28 * @param flowRules one or more flow rules
29 * throws SomeKindOfException that indicates which ones were applied and
30 * which ones failed
31 */
32 void removeFlowRule(FlowRule... flowRules);
33
alshabiba68eb962014-09-24 20:34:13 -070034 /**
35 * Removes rules by their id.
36 * @param id the id to remove
37 */
38 void removeRulesById(ApplicationId id, FlowRule... flowRules);
39
alshabib193525b2014-10-08 18:58:03 -070040 /**
41 * Installs a batch of flow rules. Each flowrule is associated to an
42 * operation which results in either addition, removal or modification.
43 * @param batch a batch of flow rules
44 * @return a future indicating the status of this execution
45 */
Madan Jampani117aaae2014-10-23 10:04:05 -070046 ListenableFuture<CompletedBatchOperation> executeBatch(BatchOperation<FlowRuleBatchEntry> batch);
alshabib902d41b2014-10-07 16:52:05 -070047
tom0eb04ca2014-08-25 14:34:51 -070048}