blob: 05ecd6616282e9026eda8fbe5d50f5432b430021 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska83e090e2014-10-22 14:25:35 -070015 */
tom0eb04ca2014-08-25 14:34:51 -070016package org.onlab.onos.net.flow;
17
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070018import org.onlab.onos.core.ApplicationId;
tomc1a38d32014-08-25 23:01:32 -070019import org.onlab.onos.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -070020
Madan Jampani117aaae2014-10-23 10:04:05 -070021import com.google.common.util.concurrent.ListenableFuture;
22
tom0eb04ca2014-08-25 14:34:51 -070023/**
24 * Abstraction of a flow rule provider.
25 */
26public interface FlowRuleProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070027
alshabibba5ac482014-10-02 17:15:20 -070028 static final int POLL_INTERVAL = 5;
29
tom8bb16062014-09-12 14:47:46 -070030 /**
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
alshabib57044ba2014-09-16 15:58:01 -070039 /**
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
alshabiba68eb962014-09-24 20:34:13 -070048 /**
49 * Removes rules by their id.
50 * @param id the id to remove
51 */
52 void removeRulesById(ApplicationId id, FlowRule... flowRules);
53
alshabib193525b2014-10-08 18:58:03 -070054 /**
55 * Installs a batch of flow rules. Each flowrule is associated to an
56 * operation which results in either addition, removal or modification.
57 * @param batch a batch of flow rules
58 * @return a future indicating the status of this execution
59 */
Madan Jampani117aaae2014-10-23 10:04:05 -070060 ListenableFuture<CompletedBatchOperation> executeBatch(BatchOperation<FlowRuleBatchEntry> batch);
alshabib902d41b2014-10-07 16:52:05 -070061
tom0eb04ca2014-08-25 14:34:51 -070062}