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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.flow; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.core.ApplicationId; |
| 19 | import org.onosproject.net.provider.Provider; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Abstraction of a flow rule provider. |
| 23 | */ |
| 24 | public interface FlowRuleProvider extends Provider { |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 25 | |
alshabib | 0ad84ec | 2014-12-03 22:48:01 -0800 | [diff] [blame] | 26 | static final int POLL_INTERVAL = 10; |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 27 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 28 | /** |
| 29 | * Instructs the provider to apply the specified flow rules to their |
| 30 | * respective devices. |
| 31 | * @param flowRules one or more flow rules |
| 32 | * throws SomeKindOfException that indicates which ones were applied and |
| 33 | * which ones failed |
| 34 | */ |
| 35 | void applyFlowRule(FlowRule... flowRules); |
| 36 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 37 | /** |
| 38 | * Instructs the provider to remove the specified flow rules to their |
| 39 | * respective devices. |
| 40 | * @param flowRules one or more flow rules |
| 41 | * throws SomeKindOfException that indicates which ones were applied and |
| 42 | * which ones failed |
| 43 | */ |
| 44 | void removeFlowRule(FlowRule... flowRules); |
| 45 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 46 | /** |
| 47 | * Removes rules by their id. |
| 48 | * @param id the id to remove |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 49 | * @param flowRules one or more flow rules |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 50 | */ |
| 51 | void removeRulesById(ApplicationId id, FlowRule... flowRules); |
| 52 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 53 | /** |
| 54 | * Installs a batch of flow rules. Each flowrule is associated to an |
| 55 | * operation which results in either addition, removal or modification. |
| 56 | * @param batch a batch of flow rules |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 57 | */ |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 58 | void executeBatch(FlowRuleBatchOperation batch); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 59 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 60 | } |