Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.flow; |
| 17 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 18 | import org.onlab.onos.core.ApplicationId; |
tom | c1a38d3 | 2014-08-25 23:01:32 -0700 | [diff] [blame] | 19 | import org.onlab.onos.net.provider.Provider; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 20 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 21 | import java.util.concurrent.Future; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 22 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 23 | /** |
| 24 | * Abstraction of a flow rule provider. |
| 25 | */ |
| 26 | public interface FlowRuleProvider extends Provider { |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 27 | |
Thomas Vachuska | f75b7ab | 2014-11-19 12:15:55 -0800 | [diff] [blame] | 28 | static final int POLL_INTERVAL = 2; |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 29 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Instructs the provider to apply the specified flow rules to their |
| 32 | * respective devices. |
| 33 | * @param flowRules one or more flow rules |
| 34 | * throws SomeKindOfException that indicates which ones were applied and |
| 35 | * which ones failed |
| 36 | */ |
| 37 | void applyFlowRule(FlowRule... flowRules); |
| 38 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 39 | /** |
| 40 | * Instructs the provider to remove the specified flow rules to their |
| 41 | * respective devices. |
| 42 | * @param flowRules one or more flow rules |
| 43 | * throws SomeKindOfException that indicates which ones were applied and |
| 44 | * which ones failed |
| 45 | */ |
| 46 | void removeFlowRule(FlowRule... flowRules); |
| 47 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 48 | /** |
| 49 | * Removes rules by their id. |
| 50 | * @param id the id to remove |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 51 | * @param flowRules one or more flow rules |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 52 | */ |
| 53 | void removeRulesById(ApplicationId id, FlowRule... flowRules); |
| 54 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 55 | /** |
| 56 | * Installs a batch of flow rules. Each flowrule is associated to an |
| 57 | * operation which results in either addition, removal or modification. |
| 58 | * @param batch a batch of flow rules |
| 59 | * @return a future indicating the status of this execution |
| 60 | */ |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 61 | Future<CompletedBatchOperation> executeBatch(BatchOperation<FlowRuleBatchEntry> batch); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 62 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 63 | } |