tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame^] | 3 | import org.onlab.onos.ApplicationId; |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 4 | import org.onlab.onos.net.DeviceId; |
| 5 | |
| 6 | /** |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 7 | * Manages inventory of flow rules; not intended for direct use. |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 8 | */ |
| 9 | public interface FlowRuleStore { |
| 10 | |
| 11 | /** |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame^] | 12 | * 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 | /** |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 19 | * 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 | /** |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame^] | 27 | * 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 | /** |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 35 | * Stores a new flow rule without generating events. |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 36 | * |
| 37 | * @param rule the flow rule to add |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 38 | */ |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 39 | 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); |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 47 | |
| 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 | } |