blob: 8748fe8ea051fa08b7b92d2f6de991b0b3aff5d7 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
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 */
tom0eb04ca2014-08-25 14:34:51 -070019package org.onlab.onos.net.flow;
20
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070021import org.onlab.onos.core.ApplicationId;
tomc1a38d32014-08-25 23:01:32 -070022import org.onlab.onos.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -070023
Madan Jampani117aaae2014-10-23 10:04:05 -070024import com.google.common.util.concurrent.ListenableFuture;
25
tom0eb04ca2014-08-25 14:34:51 -070026/**
27 * Abstraction of a flow rule provider.
28 */
29public interface FlowRuleProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070030
alshabibba5ac482014-10-02 17:15:20 -070031 static final int POLL_INTERVAL = 5;
32
tom8bb16062014-09-12 14:47:46 -070033 /**
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
alshabib57044ba2014-09-16 15:58:01 -070042 /**
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
alshabiba68eb962014-09-24 20:34:13 -070051 /**
52 * Removes rules by their id.
53 * @param id the id to remove
54 */
55 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.
60 * @param batch a batch of flow rules
61 * @return a future indicating the status of this execution
62 */
Madan Jampani117aaae2014-10-23 10:04:05 -070063 ListenableFuture<CompletedBatchOperation> executeBatch(BatchOperation<FlowRuleBatchEntry> batch);
alshabib902d41b2014-10-07 16:52:05 -070064
tom0eb04ca2014-08-25 14:34:51 -070065}