tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
| 3 | import org.onlab.onos.net.DeviceId; |
| 4 | |
| 5 | /** |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 6 | * Manages inventory of flow rules; not intended for direct use. |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 7 | */ |
| 8 | public interface FlowRuleStore { |
| 9 | |
| 10 | /** |
| 11 | * Returns the flow entries associated with a device. |
| 12 | * |
| 13 | * @param deviceId the device ID |
| 14 | * @return the flow entries |
| 15 | */ |
| 16 | Iterable<FlowRule> getFlowEntries(DeviceId deviceId); |
| 17 | |
| 18 | /** |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 19 | * Stores a new flow rule without generating events. |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 20 | * |
| 21 | * @param rule the flow rule to add |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 22 | */ |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 23 | void storeFlowRule(FlowRule rule); |
| 24 | |
| 25 | /** |
| 26 | * Deletes a flow rule without generating events. |
| 27 | * |
| 28 | * @param rule the flow rule to delete |
| 29 | */ |
| 30 | void deleteFlowRule(FlowRule rule); |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Stores a new flow rule, or updates an existing entry. |
| 34 | * |
| 35 | * @param rule the flow rule to add or update |
| 36 | * @return flow_added event, or null if just an update |
| 37 | */ |
| 38 | FlowRuleEvent addOrUpdateFlowRule(FlowRule rule); |
| 39 | |
| 40 | /** |
| 41 | * @param rule the flow rule to remove |
| 42 | * @return flow_removed event, or null if nothing removed |
| 43 | */ |
| 44 | FlowRuleEvent removeFlowRule(FlowRule rule); |
| 45 | |
| 46 | } |