blob: d20f9aa0a48293853edc013e701e49e9ae3e58bb [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
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;
Ray Milkey7bf273c2017-09-27 16:15:15 -070019import org.onosproject.net.flow.oldbatch.FlowRuleBatchOperation;
Brian O'Connorabafb502014-12-02 22:26:20 -080020import org.onosproject.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -070021
22/**
23 * Abstraction of a flow rule provider.
24 */
25public interface FlowRuleProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070026
tom8bb16062014-09-12 14:47:46 -070027 /**
28 * Instructs the provider to apply the specified flow rules to their
29 * respective devices.
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080030 *
tom8bb16062014-09-12 14:47:46 -070031 * @param flowRules one or more flow rules
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080032 * throws SomeKindOfException that indicates which ones were applied and
tom8bb16062014-09-12 14:47:46 -070033 * 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.
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080040 *
alshabib57044ba2014-09-16 15:58:01 -070041 * @param flowRules one or more flow rules
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080042 * throws SomeKindOfException that indicates which ones were applied and
alshabib57044ba2014-09-16 15:58:01 -070043 * which ones failed
44 */
45 void removeFlowRule(FlowRule... flowRules);
46
alshabiba68eb962014-09-24 20:34:13 -070047 /**
48 * Removes rules by their id.
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080049 *
50 * @param id the id to remove
Yuta HIGUCHI5c947272014-11-03 21:39:21 -080051 * @param flowRules one or more flow rules
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080052 * @deprecated since 1.5.0 Falcon
alshabiba68eb962014-09-24 20:34:13 -070053 */
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080054 @Deprecated
alshabiba68eb962014-09-24 20:34:13 -070055 void removeRulesById(ApplicationId id, FlowRule... flowRules);
56
alshabib193525b2014-10-08 18:58:03 -070057 /**
58 * Installs a batch of flow rules. Each flowrule is associated to an
59 * operation which results in either addition, removal or modification.
Thomas Vachuskac4ee7372016-02-02 16:10:09 -080060 *
alshabib193525b2014-10-08 18:58:03 -070061 * @param batch a batch of flow rules
alshabib193525b2014-10-08 18:58:03 -070062 */
Brian O'Connor72cb19a2015-01-16 16:14:41 -080063 void executeBatch(FlowRuleBatchOperation batch);
alshabib902d41b2014-10-07 16:52:05 -070064
tom0eb04ca2014-08-25 14:34:51 -070065}