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