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