blob: 066ac686d647e3b13b531747e023a0edd7e4ec9f [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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.flow;
tom0eb04ca2014-08-25 14:34:51 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.core.ApplicationId;
19import org.onosproject.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -070020
21/**
22 * Abstraction of a flow rule provider.
23 */
24public interface FlowRuleProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070025
alshabib0ad84ec2014-12-03 22:48:01 -080026 static final int POLL_INTERVAL = 10;
alshabibba5ac482014-10-02 17:15:20 -070027
tom8bb16062014-09-12 14:47:46 -070028 /**
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
alshabib57044ba2014-09-16 15:58:01 -070037 /**
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
alshabiba68eb962014-09-24 20:34:13 -070046 /**
47 * Removes rules by their id.
48 * @param id the id to remove
Yuta HIGUCHI5c947272014-11-03 21:39:21 -080049 * @param flowRules one or more flow rules
alshabiba68eb962014-09-24 20:34:13 -070050 */
51 void removeRulesById(ApplicationId id, FlowRule... flowRules);
52
alshabib193525b2014-10-08 18:58:03 -070053 /**
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
alshabib193525b2014-10-08 18:58:03 -070057 */
Brian O'Connor72cb19a2015-01-16 16:14:41 -080058 void executeBatch(FlowRuleBatchOperation batch);
alshabib902d41b2014-10-07 16:52:05 -070059
tom0eb04ca2014-08-25 14:34:51 -070060}