tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 3 | import java.util.concurrent.Future; |
| 4 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 5 | import org.onlab.onos.ApplicationId; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 6 | import org.onlab.onos.net.intent.BatchOperation; |
tom | c1a38d3 | 2014-08-25 23:01:32 -0700 | [diff] [blame] | 7 | import org.onlab.onos.net.provider.Provider; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 8 | |
| 9 | /** |
| 10 | * Abstraction of a flow rule provider. |
| 11 | */ |
| 12 | public interface FlowRuleProvider extends Provider { |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 13 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 14 | static final int POLL_INTERVAL = 5; |
| 15 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 16 | /** |
| 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 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 25 | /** |
| 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 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 34 | /** |
| 35 | * Removes rules by their id. |
| 36 | * @param id the id to remove |
| 37 | */ |
| 38 | void removeRulesById(ApplicationId id, FlowRule... flowRules); |
| 39 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 40 | Future<Void> executeBatch(BatchOperation<FlowRuleBatchEntry> batch); |
| 41 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 42 | } |