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