blob: 4812de2e3c6aa2d0a10151857c7e3b3329dd0598 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.Collection;
Toshio Koidea03915e2014-07-01 18:39:52 -07004
Toshio Koidea03915e2014-07-01 18:39:52 -07005/**
6 * An interface class for flow manager. The role of the flow manager is to
Toshio Koide7894ca02014-08-15 14:30:13 -07007 * manage a set of Match-Action entries based on the specified Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -07008 * <p>
Toshio Koide7894ca02014-08-15 14:30:13 -07009 * It compiles accepted Flow objects to Match-Action entries by calculating the
Toshio Koidea03915e2014-07-01 18:39:52 -070010 * match-action operation phases and allocating resources based on the
Toshio Koide7894ca02014-08-15 14:30:13 -070011 * constrains described in the Flow objects, and executes calculated phases
Toshio Koidea03915e2014-07-01 18:39:52 -070012 * using Match-Action Service.
13 * <p>
Toshio Koide7894ca02014-08-15 14:30:13 -070014 * TODO: add more getter with filter for Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -070015 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070016public interface FlowManagerService {
Toshio Koidea03915e2014-07-01 18:39:52 -070017 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070018 * Adds Flow object, calculates match-action plan and executes it.
Toshio Koidea03915e2014-07-01 18:39:52 -070019 *
Toshio Koide7894ca02014-08-15 14:30:13 -070020 * @param flow Flow object to be added
Toshio Koidea8e8c542014-07-31 12:10:12 -070021 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070022 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070023 boolean addFlow(Flow flow);
Toshio Koidea03915e2014-07-01 18:39:52 -070024
25 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070026 * Removes Flow object, calculates match-action plan and executes it.
Toshio Koidea03915e2014-07-01 18:39:52 -070027 *
Toshio Koide7894ca02014-08-15 14:30:13 -070028 * @param id ID for Flow object to be removed
Toshio Koidea8e8c542014-07-31 12:10:12 -070029 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070030 */
Toshio Koide025a9152014-07-21 11:00:34 -070031 boolean removeFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070032
33 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070034 * Gets Flow object.
Toshio Koidea03915e2014-07-01 18:39:52 -070035 *
Toshio Koide7894ca02014-08-15 14:30:13 -070036 * @param id ID of Flow object
37 * @return Flow object if found, null otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070038 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070039 Flow getFlow(FlowId id);
Toshio Koidea03915e2014-07-01 18:39:52 -070040
41 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070042 * Gets All Flow objects.
Toshio Koidea03915e2014-07-01 18:39:52 -070043 *
Toshio Koide7894ca02014-08-15 14:30:13 -070044 * @return the collection of Flow objects
Toshio Koidea03915e2014-07-01 18:39:52 -070045 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070046 Collection<Flow> getFlows();
Toshio Koidea03915e2014-07-01 18:39:52 -070047
48 /**
Toshio Koide7894ca02014-08-15 14:30:13 -070049 * Executes batch operation of Flow object.
Toshio Koidea03915e2014-07-01 18:39:52 -070050 *
Toshio Koide4ea84192014-07-31 12:10:12 -070051 * @param ops flow operations to be executed
Toshio Koidea8e8c542014-07-31 12:10:12 -070052 * @return true if succeeded, false otherwise
Toshio Koidea03915e2014-07-01 18:39:52 -070053 */
Toshio Koide4ea84192014-07-31 12:10:12 -070054 boolean executeBatch(FlowBatchOperation ops);
Toshio Koidea03915e2014-07-01 18:39:52 -070055
56 /**
57 * Sets a conflict detection policy.
58 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070059 * @param policy ConflictDetectionPolicy object to be set
Toshio Koidea03915e2014-07-01 18:39:52 -070060 */
61 void setConflictDetectionPolicy(ConflictDetectionPolicy policy);
62
63 /**
64 * Gets the conflict detection policy.
65 *
Toshio Koidea8e8c542014-07-31 12:10:12 -070066 * @return ConflictDetectionPolicy object being applied currently
Toshio Koidea03915e2014-07-01 18:39:52 -070067 */
68 ConflictDetectionPolicy getConflictDetectionPolicy();
69
70 /**
71 * Adds event listener to this service.
72 *
Toshio Koideb8cea262014-08-12 18:45:46 -070073 * @param listener the listener to be added
Toshio Koidea03915e2014-07-01 18:39:52 -070074 */
Toshio Koideb8cea262014-08-12 18:45:46 -070075 void addListener(FlowManagerListener listener);
Toshio Koidea03915e2014-07-01 18:39:52 -070076
77 /**
78 * Removes event listener from this service.
79 *
Toshio Koideb8cea262014-08-12 18:45:46 -070080 * @param listener the listener to be removed
Toshio Koidea03915e2014-07-01 18:39:52 -070081 */
Toshio Koideb8cea262014-08-12 18:45:46 -070082 void removeListener(FlowManagerListener listener);
Toshio Koidea03915e2014-07-01 18:39:52 -070083}