blob: fcfaacbf31a4b82a441acb95585356aaf8ec27a9 [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
6import net.onrc.onos.api.batchoperation.BatchOperation;
7
8/**
9 * An interface class for flow manager. The role of the flow manager is to
10 * manage a set of Match-Action entries based on the specified IFlow objects.
11 * <p>
12 * It compiles accepted IFlow objects to Match-Action entries by calculating the
13 * match-action operation phases and allocating resources based on the
14 * constrains described in the IFlow objects, and executes calculated phases
15 * using Match-Action Service.
16 * <p>
17 * TODO: add more getter with filter for IFlow objects.
18 */
19public interface IFlowManagerService {
20 /**
21 * Adds IFlow object, calculates match-action plan and executes it.
22 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070023 * @param flow IFlow object to be added
24 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070025 */
26 boolean addFlow(IFlow flow);
27
28 /**
29 * Removes IFlow object, calculates match-action plan and executes it.
30 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070031 * @param id ID for IFlow object to be removed
32 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070033 */
Toshio Koide025a9152014-07-21 11:00:34 -070034 boolean removeFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070035
36 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070037 * Gets IFlow object.
38 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070039 * @param id ID of IFlow object
40 * @return IFlow object if found, null otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070041 */
Toshio Koide025a9152014-07-21 11:00:34 -070042 IFlow getFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070043
44 /**
45 * Gets All IFlow objects.
46 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070047 * @return the collection of IFlow objects
Toshio Koidea03915e2014-07-01 18:39:52 -070048 */
49 Collection<IFlow> getFlows();
50
51 /**
52 * Executes batch operation of IFlow object.
53 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070054 * @param ops FlowOperations to be executed
55 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070056 */
57 boolean executeBatch(BatchOperation<IFlow> ops);
58
59 /**
60 * Sets a conflict detection policy.
61 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070062 * @param policy ConflictDetectionPolicy object to be set
Toshio Koidea03915e2014-07-01 18:39:52 -070063 */
64 void setConflictDetectionPolicy(ConflictDetectionPolicy policy);
65
66 /**
67 * Gets the conflict detection policy.
68 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070069 * @return ConflictDetectionPolicy object being applied currently
Toshio Koidea03915e2014-07-01 18:39:52 -070070 */
71 ConflictDetectionPolicy getConflictDetectionPolicy();
72
73 /**
74 * Adds event listener to this service.
75 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070076 * @param listener EventListener to be added
Toshio Koidea03915e2014-07-01 18:39:52 -070077 */
78 void addEventListener(EventListener listener);
79
80 /**
81 * Removes event listener from this service.
82 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070083 * @param listener EventListener to be removed
Toshio Koidea03915e2014-07-01 18:39:52 -070084 */
85 void removeEventListener(EventListener listener);
86}