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 | /** |
| 6 | * Manages inventory of flow rules. |
| 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 | /** |
| 19 | * Stores a new flow rule, and generates a FlowRule for it. |
| 20 | * |
| 21 | * @param rule the flow rule to add |
| 22 | * @return a flow entry |
| 23 | */ |
| 24 | FlowRule storeFlowRule(FlowRule rule); |
| 25 | |
| 26 | /** |
| 27 | * Stores a new flow rule, or updates an existing entry. |
| 28 | * |
| 29 | * @param rule the flow rule to add or update |
| 30 | * @return flow_added event, or null if just an update |
| 31 | */ |
| 32 | FlowRuleEvent addOrUpdateFlowRule(FlowRule rule); |
| 33 | |
| 34 | /** |
| 35 | * @param rule the flow rule to remove |
| 36 | * @return flow_removed event, or null if nothing removed |
| 37 | */ |
| 38 | FlowRuleEvent removeFlowRule(FlowRule rule); |
| 39 | |
| 40 | } |