Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
| 3 | import java.util.Collection; |
| 4 | import java.util.EventListener; |
| 5 | |
| 6 | import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy; |
| 7 | |
| 8 | /** |
| 9 | * An interface for the match-action service. |
| 10 | */ |
| 11 | public interface IMatchActionService { |
| 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 | /** |
| 21 | * Removes the existing match-action entry. |
| 22 | * |
| 23 | * @param id ID for MatchaAction object to be removed. |
| 24 | * @return true if succeeded, false otherwise. |
| 25 | */ |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 26 | boolean removeMatchAction(MatchActionId id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 27 | |
| 28 | /** |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 29 | * Gets the set of match-action entries. |
| 30 | * |
| 31 | * @return The set of match-action entries. |
| 32 | */ |
| 33 | Collection<MatchAction> getMatchActions(); |
| 34 | |
| 35 | /** |
| 36 | * Executes match-action operation plan. |
| 37 | * |
| 38 | * @param plan MatchActionPlan to be executed. |
| 39 | * @return true if succeeded, false otherwise. |
| 40 | */ |
| 41 | boolean executePlan(MatchActionPlan plan); |
| 42 | |
| 43 | /** |
| 44 | * Sets a conflict detection policy. |
| 45 | * |
| 46 | * @param policy ConflictDetectionPolicy object to be set. |
| 47 | */ |
| 48 | void setConflictDetectionPolicy(ConflictDetectionPolicy policy); |
| 49 | |
| 50 | /** |
| 51 | * Gets the conflict detection policy. |
| 52 | * |
| 53 | * @return ConflictDetectionPolicy object being applied currently. |
| 54 | */ |
| 55 | ConflictDetectionPolicy getConflictDetectionPolicy(); |
| 56 | |
| 57 | /** |
| 58 | * Adds event listener to this service. |
| 59 | * |
| 60 | * @param listener EventListener to be added. |
| 61 | */ |
| 62 | void addEventListener(EventListener listener); |
| 63 | |
| 64 | /** |
| 65 | * Removes event listener from this service. |
| 66 | * |
| 67 | * @param listener EventListener to be removed. |
| 68 | */ |
| 69 | void removeEventListener(EventListener listener); |
| 70 | } |