blob: 28793e698560ec0fc24bd25b18f3878cc00283a1 [file] [log] [blame]
tombe988312014-09-19 18:38:47 -07001package org.onlab.onos.net.flow;
2
alshabiba68eb962014-09-24 20:34:13 -07003import org.onlab.onos.ApplicationId;
tombe988312014-09-19 18:38:47 -07004import org.onlab.onos.net.DeviceId;
5
6/**
tome4729872014-09-23 00:37:37 -07007 * Manages inventory of flow rules; not intended for direct use.
tombe988312014-09-19 18:38:47 -07008 */
9public interface FlowRuleStore {
10
11 /**
alshabiba68eb962014-09-24 20:34:13 -070012 * Returns the stored flow.
13 * @param rule the rule to look for
14 * @return a flow rule
15 */
16 FlowRule getFlowRule(FlowRule rule);
17
18 /**
tombe988312014-09-19 18:38:47 -070019 * Returns the flow entries associated with a device.
20 *
21 * @param deviceId the device ID
22 * @return the flow entries
23 */
24 Iterable<FlowRule> getFlowEntries(DeviceId deviceId);
25
26 /**
alshabiba68eb962014-09-24 20:34:13 -070027 * Returns the flow entries associated with an application.
28 *
29 * @param appId the application id
30 * @return the flow entries
31 */
32 Iterable<FlowRule> getFlowEntriesByAppId(ApplicationId appId);
33
34 /**
alshabib219ebaa2014-09-22 15:41:24 -070035 * Stores a new flow rule without generating events.
tombe988312014-09-19 18:38:47 -070036 *
37 * @param rule the flow rule to add
tombe988312014-09-19 18:38:47 -070038 */
alshabib219ebaa2014-09-22 15:41:24 -070039 void storeFlowRule(FlowRule rule);
40
41 /**
42 * Deletes a flow rule without generating events.
43 *
44 * @param rule the flow rule to delete
45 */
46 void deleteFlowRule(FlowRule rule);
tombe988312014-09-19 18:38:47 -070047
48 /**
49 * Stores a new flow rule, or updates an existing entry.
50 *
51 * @param rule the flow rule to add or update
52 * @return flow_added event, or null if just an update
53 */
54 FlowRuleEvent addOrUpdateFlowRule(FlowRule rule);
55
56 /**
57 * @param rule the flow rule to remove
58 * @return flow_removed event, or null if nothing removed
59 */
60 FlowRuleEvent removeFlowRule(FlowRule rule);
61
62}