Brian O'Connor | 66630c8 | 2014-10-02 21:08:19 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | import org.onlab.onos.store.Store; |
| 6 | |
| 7 | /** |
| 8 | * Manages inventory of end-station intents; not intended for direct use. |
| 9 | */ |
| 10 | public interface IntentStore extends Store<IntentEvent, IntentStoreDelegate> { |
| 11 | |
| 12 | /** |
| 13 | * Creates a new intent. |
| 14 | * |
| 15 | * @param intent intent |
| 16 | * @return appropriate event or null if no change resulted |
| 17 | */ |
| 18 | IntentEvent createIntent(Intent intent); |
| 19 | |
| 20 | /** |
| 21 | * Removes the specified intent from the inventory. |
| 22 | * |
| 23 | * @param intentId intent identification |
| 24 | * @return remove event or null if intent was not found |
| 25 | */ |
| 26 | IntentEvent removeIntent(IntentId intent); |
| 27 | |
| 28 | /** |
| 29 | * Returns the number of intents in the store. |
| 30 | * |
| 31 | */ |
| 32 | long getIntentCount(); |
| 33 | |
| 34 | /** |
| 35 | * Returns a collection of all intents in the store. |
| 36 | * |
| 37 | * @return iterable collection of all intents |
| 38 | */ |
| 39 | Iterable<Intent> getIntents(); |
| 40 | |
| 41 | /** |
| 42 | * Returns the intent with the specified identifer. |
| 43 | * |
| 44 | * @param intentId intent identification |
| 45 | * @return intent or null if not found |
| 46 | */ |
| 47 | Intent getIntent(IntentId intentId); |
| 48 | |
| 49 | IntentState getIntentState(IntentId id); |
| 50 | |
| 51 | /** |
| 52 | * Sets the state of the specified intent to the new state. |
| 53 | * |
| 54 | * @param intent intent whose state is to be changed |
| 55 | * @param newState new state |
| 56 | */ |
| 57 | IntentEvent setState(Intent intent, IntentState newState); |
| 58 | |
| 59 | IntentEvent addInstallableIntents(IntentId intentId, List<InstallableIntent> result); |
| 60 | |
| 61 | List<InstallableIntent> getInstallableIntents(IntentId intentId); |
| 62 | |
| 63 | void removeInstalledIntents(IntentId intentId); |
| 64 | } |