Jonathan Hart | aa38097 | 2014-04-03 10:24:46 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.intent.runtime; |
Toshio Koide | 27ffd41 | 2014-02-18 19:15:27 -0800 | [diff] [blame] | 2 | |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 3 | import java.util.Collection; |
| 4 | |
Toshio Koide | 27ffd41 | 2014-02-18 19:15:27 -0800 | [diff] [blame] | 5 | import net.floodlightcontroller.core.module.IFloodlightService; |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 6 | import net.onrc.onos.api.intent.ApplicationIntent; |
Jonathan Hart | aa38097 | 2014-04-03 10:24:46 -0700 | [diff] [blame] | 7 | import net.onrc.onos.core.intent.IntentMap; |
| 8 | import net.onrc.onos.core.intent.IntentOperationList; |
Toshio Koide | 27ffd41 | 2014-02-18 19:15:27 -0800 | [diff] [blame] | 9 | |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 10 | /** |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 11 | * Interface class used by PathCalcRuntimeModule class to operate intents. |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 12 | */ |
Toshio Koide | 27ffd41 | 2014-02-18 19:15:27 -0800 | [diff] [blame] | 13 | public interface IPathCalcRuntimeService extends IFloodlightService { |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 14 | /** |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 15 | * Adds Application Intents. |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 16 | * |
| 17 | * @param appId the Application ID to use. |
| 18 | * @param appIntents the Application Intents to add. |
| 19 | * @return true on success, otherwise false. |
| 20 | */ |
| 21 | public boolean addApplicationIntents( |
| 22 | final String appId, |
| 23 | Collection<ApplicationIntent> appIntents); |
| 24 | |
| 25 | /** |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 26 | * Removes Application Intents. |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 27 | * |
| 28 | * @param appId the Application ID to use. |
| 29 | * @param intentIds the Application Intent IDs to remove. |
| 30 | * @return true on success, otherwise false. |
| 31 | */ |
| 32 | public boolean removeApplicationIntents(final String appId, |
| 33 | Collection<String> intentIds); |
| 34 | |
| 35 | /** |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 36 | * Removes all Application Intents. |
Pavlin Radoslavov | e2238bc | 2014-06-09 18:05:23 -0700 | [diff] [blame] | 37 | * |
| 38 | * @param appId the Application ID to use. |
| 39 | * @return true on success, otherwise false. |
| 40 | */ |
| 41 | public boolean removeAllApplicationIntents(final String appId); |
| 42 | |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 43 | /** |
| 44 | * Executes Application-level Intent operations. |
| 45 | * <p> |
| 46 | * IntentOperationList accepts ADD and REMOVE operations at the same time |
| 47 | * in order to update intents in one shot. It converts application-level |
| 48 | * intent operations into path-level intent operations, and send them to |
| 49 | * PlanCalcModule. |
| 50 | * |
| 51 | * @param list a list of intent operations |
| 52 | * @return the converted path-level intent operations |
| 53 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 54 | public IntentOperationList executeIntentOperations(IntentOperationList list); |
| 55 | |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 56 | /** |
| 57 | * Retrieves application-level intents. |
| 58 | * <p> |
| 59 | * It returns IntentMap object. This object has listener to listen the |
| 60 | * additions, the removals and the status changes of intents. |
| 61 | * |
| 62 | * @return application-level intents. |
| 63 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 64 | public IntentMap getHighLevelIntents(); |
| 65 | |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 66 | /** |
| 67 | * Retrieves path-level intents. |
| 68 | * <p> |
| 69 | * It returns IntentMap object. This object has listener to listen the |
| 70 | * additions, the removals and the status changes of intents. |
| 71 | * |
| 72 | * @return path-level intents. |
| 73 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 74 | public IntentMap getPathIntents(); |
| 75 | |
Toshio Koide | fdb7593 | 2014-06-16 17:59:24 -0700 | [diff] [blame^] | 76 | /** |
| 77 | * Purges invalid intents. |
| 78 | * <p> |
| 79 | * It removes all uninstalled or failed application/path level intents. |
| 80 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 81 | public void purgeIntents(); |
Toshio Koide | 27ffd41 | 2014-02-18 19:15:27 -0800 | [diff] [blame] | 82 | } |