blob: 02a7ef395891476f5534e32c5fbf5ac394f4a323 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.core.matchaction;
2
3import java.util.Collection;
4import java.util.EventListener;
5
6import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
7
8/**
9 * An interface for the match-action service.
10 */
Toshio Koided8b077a2014-08-13 10:47:21 -070011public interface MatchActionService {
Toshio Koidea03915e2014-07-01 18:39:52 -070012 /**
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 Koide025a9152014-07-21 11:00:34 -070026 boolean removeMatchAction(MatchActionId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070027
28 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070029 * 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}