blob: ce5a60ce7e8d111866f5380c6ae61fac26df5245 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.core.matchaction;
2
Toshio Koidea03915e2014-07-01 18:39:52 -07003import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -07004import net.onrc.onos.core.util.IdGenerator;
Toshio Koidea03915e2014-07-01 18:39:52 -07005
Ray Milkey18b44ac2014-08-22 08:29:47 -07006import java.util.EventListener;
7import java.util.Set;
8
Toshio Koidea03915e2014-07-01 18:39:52 -07009/**
10 * An interface for the match-action service.
11 */
Toshio Koided8b077a2014-08-13 10:47:21 -070012public interface MatchActionService {
Toshio Koidea03915e2014-07-01 18:39:52 -070013 /**
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 Koidea03915e2014-07-01 18:39:52 -070022 * Gets the set of match-action entries.
23 *
24 * @return The set of match-action entries.
25 */
Brian O'Connordee2e6b2014-08-12 11:34:51 -070026 Set<MatchAction> getMatchActions();
Toshio Koidea03915e2014-07-01 18:39:52 -070027
28 /**
29 * Executes match-action operation plan.
30 *
Brian O'Connordee2e6b2014-08-12 11:34:51 -070031 * @param operations Operations to be executed.
Toshio Koidea03915e2014-07-01 18:39:52 -070032 * @return true if succeeded, false otherwise.
33 */
Brian O'Connordee2e6b2014-08-12 11:34:51 -070034 boolean executeOperations(MatchActionOperations operations);
Toshio Koidea03915e2014-07-01 18:39:52 -070035
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 Koide77ec9982014-08-27 16:57:43 -070051 * Gets the ID generator for MatchActionId.
52 *
53 * @return the ID generator for MatchActionId
54 */
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -070055 IdGenerator<MatchActionId> getMatchActionIdGenerator();
Toshio Koide77ec9982014-08-27 16:57:43 -070056
57 /**
58 * Gets the ID generator for MatchActionOperationsId.
59 *
60 * @return the ID generator for MatchActionOperationsId
61 */
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -070062 IdGenerator<MatchActionOperationsId> getMatchActionOperationsIdGenerator();
Toshio Koide77ec9982014-08-27 16:57:43 -070063
64 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070065 * 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}