blob: efd7b98f99c5ef6ce9172305a949fbc9ce4a2427 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.Collection;
4import java.util.EventListener;
5
Toshio Koidea03915e2014-07-01 18:39:52 -07006/**
7 * An interface class for flow manager. The role of the flow manager is to
8 * manage a set of Match-Action entries based on the specified IFlow objects.
9 * <p>
10 * It compiles accepted IFlow objects to Match-Action entries by calculating the
11 * match-action operation phases and allocating resources based on the
12 * constrains described in the IFlow objects, and executes calculated phases
13 * using Match-Action Service.
14 * <p>
15 * TODO: add more getter with filter for IFlow objects.
16 */
17public interface IFlowManagerService {
18 /**
19 * Adds IFlow object, calculates match-action plan and executes it.
20 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070021 * @param flow IFlow object to be added
22 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070023 */
24 boolean addFlow(IFlow flow);
25
26 /**
27 * Removes IFlow object, calculates match-action plan and executes it.
28 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070029 * @param id ID for IFlow object to be removed
30 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070031 */
Toshio Koide025a9152014-07-21 11:00:34 -070032 boolean removeFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070033
34 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070035 * Gets IFlow object.
36 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070037 * @param id ID of IFlow object
38 * @return IFlow object if found, null otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070039 */
Toshio Koide025a9152014-07-21 11:00:34 -070040 IFlow getFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070041
42 /**
43 * Gets All IFlow objects.
44 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070045 * @return the collection of IFlow objects
Toshio Koidea03915e2014-07-01 18:39:52 -070046 */
47 Collection<IFlow> getFlows();
48
49 /**
50 * Executes batch operation of IFlow object.
51 *
Toshio Koide4ea84192014-07-31 12:10:12 -070052 * @param ops flow operations to be executed
Toshio Koidea8e8c542014-07-31 12:10:12 -070053 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070054 */
Toshio Koide4ea84192014-07-31 12:10:12 -070055 boolean executeBatch(FlowBatchOperation ops);
Toshio Koidea03915e2014-07-01 18:39:52 -070056
57 /**
58 * Sets a conflict detection policy.
59 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070060 * @param policy ConflictDetectionPolicy object to be set
Toshio Koidea03915e2014-07-01 18:39:52 -070061 */
62 void setConflictDetectionPolicy(ConflictDetectionPolicy policy);
63
64 /**
65 * Gets the conflict detection policy.
66 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070067 * @return ConflictDetectionPolicy object being applied currently
Toshio Koidea03915e2014-07-01 18:39:52 -070068 */
69 ConflictDetectionPolicy getConflictDetectionPolicy();
70
71 /**
72 * Adds event listener to this service.
73 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070074 * @param listener EventListener to be added
Toshio Koidea03915e2014-07-01 18:39:52 -070075 */
76 void addEventListener(EventListener listener);
77
78 /**
79 * Removes event listener from this service.
80 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070081 * @param listener EventListener to be removed
Toshio Koidea03915e2014-07-01 18:39:52 -070082 */
83 void removeEventListener(EventListener listener);
84}