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