blob: 724051f684f0b3c01db7cb3ade12e700622c64fb [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
3import org.onlab.onos.net.DeviceId;
4
5/**
6 * Service for injecting flow rules into the environment and for obtaining
7 * information about flow rules already in the environment.
8 */
9public interface FlowRuleService {
10
11 /**
12 * Returns the collection of flow entries applied on the specified device.
13 *
14 * @param deviceId device identifier
15 * @return collection of flow rules
16 */
17 Iterable<FlowEntry> getFlowEntries(DeviceId deviceId);
18
19 /**
20 * Applies the specified flow rules onto their respective devices.
21 *
22 * @param flowRules one or more flow rules
23 * throws SomeKindOfException that indicates which ones were applied and
24 * which ones failed
25 */
26 void applyFlowRules(FlowRule... flowRules);
27
28 /**
alshabib369d2942014-09-12 17:59:35 -070029 * Removes the specified flow rules from their respective devices.
30 *
31 * @param flowRules one or more flow rules
32 * throws SomeKindOfException that indicates which ones were removed and
33 * which ones failed
34 */
35 void removeFlowRules(FlowRule... flowRules);
36
37 /**
tom8bb16062014-09-12 14:47:46 -070038 * Adds the specified flow rule listener.
39 *
40 * @param listener flow rule listener
41 */
42 void addListener(FlowRuleListener listener);
43
44 /**
45 * Removes the specified flow rule listener.
46 *
47 * @param listener flow rule listener
48 */
49 void removeListener(FlowRuleListener listener);
50
51}