Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
| 3 | import java.util.Collection; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 4 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 5 | /** |
| 6 | * An interface class for flow manager. The role of the flow manager is to |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 7 | * manage a set of Match-Action entries based on the specified Flow objects. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 8 | * <p> |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 9 | * It compiles accepted Flow objects to Match-Action entries by calculating the |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 10 | * match-action operation phases and allocating resources based on the |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 11 | * constrains described in the Flow objects, and executes calculated phases |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 12 | * using Match-Action Service. |
| 13 | * <p> |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 14 | * TODO: add more getter with filter for Flow objects. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 15 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 16 | public interface FlowManagerService { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 17 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 18 | * Adds Flow object, calculates match-action plan and executes it. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 19 | * |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 20 | * @param flow Flow object to be added |
Toshio Koide | a8e8c54 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 21 | * @return true if succeeded, false otherwise |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 22 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 23 | boolean addFlow(Flow flow); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 26 | * Removes Flow object, calculates match-action plan and executes it. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 27 | * |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 28 | * @param id ID for Flow object to be removed |
Toshio Koide | a8e8c54 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 29 | * @return true if succeeded, false otherwise |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 30 | */ |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 31 | boolean removeFlow(FlowId id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 32 | |
| 33 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 34 | * Gets Flow object. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 35 | * |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 36 | * @param id ID of Flow object |
| 37 | * @return Flow object if found, null otherwise |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 38 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 39 | Flow getFlow(FlowId id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 42 | * Gets All Flow objects. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 43 | * |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 44 | * @return the collection of Flow objects |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 45 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 46 | Collection<Flow> getFlows(); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 47 | |
| 48 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 49 | * Executes batch operation of Flow object. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 50 | * |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 51 | * @param ops flow operations to be executed |
Toshio Koide | a8e8c54 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 52 | * @return true if succeeded, false otherwise |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 53 | */ |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 54 | boolean executeBatch(FlowBatchOperation ops); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * Sets a conflict detection policy. |
| 58 | * |
Toshio Koide | a8e8c54 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 59 | * @param policy ConflictDetectionPolicy object to be set |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 60 | */ |
| 61 | void setConflictDetectionPolicy(ConflictDetectionPolicy policy); |
| 62 | |
| 63 | /** |
| 64 | * Gets the conflict detection policy. |
| 65 | * |
Toshio Koide | a8e8c54 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 66 | * @return ConflictDetectionPolicy object being applied currently |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 67 | */ |
| 68 | ConflictDetectionPolicy getConflictDetectionPolicy(); |
| 69 | |
| 70 | /** |
| 71 | * Adds event listener to this service. |
| 72 | * |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame^] | 73 | * @param listener the listener to be added |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 74 | */ |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame^] | 75 | void addListener(FlowManagerListener listener); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 76 | |
| 77 | /** |
| 78 | * Removes event listener from this service. |
| 79 | * |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame^] | 80 | * @param listener the listener to be removed |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 81 | */ |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame^] | 82 | void removeListener(FlowManagerListener listener); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 83 | } |