blob: b8e14f437d94c5b87daebdeaaaa60d5f82eaaa0c [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
Toshio Koide7894ca02014-08-15 14:30:13 -07008 * manage a set of Match-Action entries based on the specified Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -07009 * <p>
Toshio Koide7894ca02014-08-15 14:30:13 -070010 * It compiles accepted Flow objects to Match-Action entries by calculating the
Toshio Koidea03915e2014-07-01 18:39:52 -070011 * match-action operation phases and allocating resources based on the
Toshio Koide7894ca02014-08-15 14:30:13 -070012 * constrains described in the Flow objects, and executes calculated phases
Toshio Koidea03915e2014-07-01 18:39:52 -070013 * using Match-Action Service.
14 * <p>
Toshio Koide7894ca02014-08-15 14:30:13 -070015 * TODO: add more getter with filter for Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -070016 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070017public interface FlowManagerService {
Toshio Koidea03915e2014-07-01 18:39:52 -070018 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070019 * Adds Flow object, calculates match-action plan and executes it.
Toshio Koidea03915e2014-07-01 18:39:52 -070020 *
Toshio Koide7894ca02014-08-15 14:30:13 -070021 * @param flow Flow object to be added
Toshio Koidea8e8c542014-07-31 12:10:12 -070022 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070023 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070024 boolean addFlow(Flow flow);
Toshio Koidea03915e2014-07-01 18:39:52 -070025
26 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070027 * Removes Flow object, calculates match-action plan and executes it.
Toshio Koidea03915e2014-07-01 18:39:52 -070028 *
Toshio Koide7894ca02014-08-15 14:30:13 -070029 * @param id ID for Flow object to be removed
Toshio Koidea8e8c542014-07-31 12:10:12 -070030 * @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 Koide7894ca02014-08-15 14:30:13 -070035 * Gets Flow object.
Toshio Koidea03915e2014-07-01 18:39:52 -070036 *
Toshio Koide7894ca02014-08-15 14:30:13 -070037 * @param id ID of Flow object
38 * @return Flow object if found, null otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070039 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070040 Flow getFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070041
42 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070043 * Gets All Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -070044 *
Toshio Koide7894ca02014-08-15 14:30:13 -070045 * @return the collection of Flow objects
Toshio Koidea03915e2014-07-01 18:39:52 -070046 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070047 Collection<Flow> getFlows();
Toshio Koidea03915e2014-07-01 18:39:52 -070048
49 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070050 * Executes batch operation of Flow object.
Toshio Koidea03915e2014-07-01 18:39:52 -070051 *
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}