Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 3 | import java.util.EventListener; |
Brian O'Connor | dee2e6b | 2014-08-12 11:34:51 -0700 | [diff] [blame] | 4 | import java.util.Set; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 5 | |
| 6 | import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy; |
| 7 | |
| 8 | /** |
| 9 | * An interface for the match-action service. |
| 10 | */ |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 11 | public interface MatchActionService { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 12 | /** |
| 13 | * Adds a new match-action entry. |
| 14 | * |
| 15 | * @param matchAction MatchAction object to be added. |
| 16 | * @return true if succeeded, false otherwise. |
| 17 | */ |
| 18 | boolean addMatchAction(MatchAction matchAction); |
| 19 | |
| 20 | /** |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 21 | * Gets the set of match-action entries. |
| 22 | * |
| 23 | * @return The set of match-action entries. |
| 24 | */ |
Brian O'Connor | dee2e6b | 2014-08-12 11:34:51 -0700 | [diff] [blame] | 25 | Set<MatchAction> getMatchActions(); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Executes match-action operation plan. |
| 29 | * |
Brian O'Connor | dee2e6b | 2014-08-12 11:34:51 -0700 | [diff] [blame] | 30 | * @param operations Operations to be executed. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 31 | * @return true if succeeded, false otherwise. |
| 32 | */ |
Brian O'Connor | dee2e6b | 2014-08-12 11:34:51 -0700 | [diff] [blame] | 33 | boolean executeOperations(MatchActionOperations operations); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Sets a conflict detection policy. |
| 37 | * |
| 38 | * @param policy ConflictDetectionPolicy object to be set. |
| 39 | */ |
| 40 | void setConflictDetectionPolicy(ConflictDetectionPolicy policy); |
| 41 | |
| 42 | /** |
| 43 | * Gets the conflict detection policy. |
| 44 | * |
| 45 | * @return ConflictDetectionPolicy object being applied currently. |
| 46 | */ |
| 47 | ConflictDetectionPolicy getConflictDetectionPolicy(); |
| 48 | |
| 49 | /** |
Toshio Koide | 77ec998 | 2014-08-27 16:57:43 -0700 | [diff] [blame] | 50 | * Gets the ID generator for MatchActionId. |
| 51 | * |
| 52 | * @return the ID generator for MatchActionId |
| 53 | */ |
| 54 | MatchActionIdGenerator getMatchActionIdGenerator(); |
| 55 | |
| 56 | /** |
| 57 | * Gets the ID generator for MatchActionOperationsId. |
| 58 | * |
| 59 | * @return the ID generator for MatchActionOperationsId |
| 60 | */ |
| 61 | MatchActionOperationsIdGenerator getMatchActionOperationsIdGenerator(); |
| 62 | |
| 63 | /** |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 64 | * Adds event listener to this service. |
| 65 | * |
| 66 | * @param listener EventListener to be added. |
| 67 | */ |
| 68 | void addEventListener(EventListener listener); |
| 69 | |
| 70 | /** |
| 71 | * Removes event listener from this service. |
| 72 | * |
| 73 | * @param listener EventListener to be removed. |
| 74 | */ |
| 75 | void removeEventListener(EventListener listener); |
| 76 | } |