blob: 802f244e3a7c07f387012d590fb70b69bf8a69cd [file] [log] [blame]
Jonathan Hartaa380972014-04-03 10:24:46 -07001package net.onrc.onos.core.intent.runtime;
Toshio Koide27ffd412014-02-18 19:15:27 -08002
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -07003import java.util.Collection;
4
Toshio Koide27ffd412014-02-18 19:15:27 -08005import net.floodlightcontroller.core.module.IFloodlightService;
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -07006import net.onrc.onos.api.intent.ApplicationIntent;
Jonathan Hartaa380972014-04-03 10:24:46 -07007import net.onrc.onos.core.intent.IntentMap;
8import net.onrc.onos.core.intent.IntentOperationList;
Toshio Koide27ffd412014-02-18 19:15:27 -08009
Toshio Koided9fa2a82014-02-19 17:35:18 -080010/**
Toshio Koidefdb75932014-06-16 17:59:24 -070011 * Interface class used by PathCalcRuntimeModule class to operate intents.
Toshio Koided9fa2a82014-02-19 17:35:18 -080012 */
Toshio Koide27ffd412014-02-18 19:15:27 -080013public interface IPathCalcRuntimeService extends IFloodlightService {
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -070014 /**
Toshio Koidefdb75932014-06-16 17:59:24 -070015 * Adds Application Intents.
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -070016 *
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 Koidefdb75932014-06-16 17:59:24 -070026 * Removes Application Intents.
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -070027 *
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 Koidefdb75932014-06-16 17:59:24 -070036 * Removes all Application Intents.
Pavlin Radoslavove2238bc2014-06-09 18:05:23 -070037 *
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 Koidefdb75932014-06-16 17:59:24 -070043 /**
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 Milkey269ffb92014-04-03 14:43:30 -070054 public IntentOperationList executeIntentOperations(IntentOperationList list);
55
Toshio Koidefdb75932014-06-16 17:59:24 -070056 /**
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 Milkey269ffb92014-04-03 14:43:30 -070064 public IntentMap getHighLevelIntents();
65
Toshio Koidefdb75932014-06-16 17:59:24 -070066 /**
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 Milkey269ffb92014-04-03 14:43:30 -070074 public IntentMap getPathIntents();
75
Toshio Koidefdb75932014-06-16 17:59:24 -070076 /**
77 * Purges invalid intents.
78 * <p>
79 * It removes all uninstalled or failed application/path level intents.
80 */
Ray Milkey269ffb92014-04-03 14:43:30 -070081 public void purgeIntents();
Toshio Koide27ffd412014-02-18 19:15:27 -080082}