blob: 4d68e74464c1cd09eeb9743c165d5e706c24b402 [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;
tomc78acee2014-09-24 15:16:55 -07005import org.onlab.onos.store.Store;
tombe988312014-09-19 18:38:47 -07006
7/**
tome4729872014-09-23 00:37:37 -07008 * Manages inventory of flow rules; not intended for direct use.
tombe988312014-09-19 18:38:47 -07009 */
tomc78acee2014-09-24 15:16:55 -070010public interface FlowRuleStore extends Store<FlowRuleEvent, FlowRuleStoreDelegate> {
tombe988312014-09-19 18:38:47 -070011
12 /**
alshabiba68eb962014-09-24 20:34:13 -070013 * Returns the stored flow.
14 * @param rule the rule to look for
15 * @return a flow rule
16 */
alshabib1c319ff2014-10-04 20:29:09 -070017 FlowEntry getFlowEntry(FlowRule rule);
alshabiba68eb962014-09-24 20:34:13 -070018
19 /**
tombe988312014-09-19 18:38:47 -070020 * Returns the flow entries associated with a device.
21 *
22 * @param deviceId the device ID
23 * @return the flow entries
24 */
alshabib1c319ff2014-10-04 20:29:09 -070025 Iterable<FlowEntry> getFlowEntries(DeviceId deviceId);
tombe988312014-09-19 18:38:47 -070026
27 /**
alshabiba68eb962014-09-24 20:34:13 -070028 * Returns the flow entries associated with an application.
29 *
30 * @param appId the application id
31 * @return the flow entries
32 */
alshabib1c319ff2014-10-04 20:29:09 -070033 Iterable<FlowRule> getFlowRulesByAppId(ApplicationId appId);
alshabiba68eb962014-09-24 20:34:13 -070034
35 /**
alshabib219ebaa2014-09-22 15:41:24 -070036 * Stores a new flow rule without generating events.
tombe988312014-09-19 18:38:47 -070037 *
38 * @param rule the flow rule to add
tombe988312014-09-19 18:38:47 -070039 */
alshabib219ebaa2014-09-22 15:41:24 -070040 void storeFlowRule(FlowRule rule);
41
42 /**
alshabib1c319ff2014-10-04 20:29:09 -070043 * Marks a flow rule for deletion. Actual deletion will occur
44 * when the provider indicates that the flow has been removed.
alshabib219ebaa2014-09-22 15:41:24 -070045 *
46 * @param rule the flow rule to delete
47 */
48 void deleteFlowRule(FlowRule rule);
tombe988312014-09-19 18:38:47 -070049
50 /**
51 * Stores a new flow rule, or updates an existing entry.
52 *
53 * @param rule the flow rule to add or update
54 * @return flow_added event, or null if just an update
55 */
alshabib1c319ff2014-10-04 20:29:09 -070056 FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule);
tombe988312014-09-19 18:38:47 -070057
58 /**
alshabib1c319ff2014-10-04 20:29:09 -070059 * @param rule the flow entry to remove
tombe988312014-09-19 18:38:47 -070060 * @return flow_removed event, or null if nothing removed
61 */
alshabib1c319ff2014-10-04 20:29:09 -070062 FlowRuleEvent removeFlowRule(FlowEntry rule);
tombe988312014-09-19 18:38:47 -070063
64}