Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
| 3 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 4 | * Representation of the phases an intent may attain during its lifecycle. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 5 | */ |
| 6 | public enum IntentState { |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 7 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 8 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 9 | * Signifies that the intent has been submitted and will start compiling |
| 10 | * shortly. However, this compilation may not necessarily occur on the |
| 11 | * local controller instance. |
| 12 | * <p/> |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 13 | * All intent in the runtime take this state first. |
| 14 | */ |
| 15 | SUBMITTED, |
| 16 | |
| 17 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 18 | * Signifies that the intent is being compiled into installable intents. |
| 19 | * This is a transitional state after which the intent will enter either |
| 20 | * {@link #FAILED} state or {@link #INSTALLING} state. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 21 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 22 | COMPILING, |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 25 | * Signifies that the resulting installable intents are being installed |
| 26 | * into the network environment. This is a transitional state after which |
| 27 | * the intent will enter either {@link #INSTALLED} state or |
| 28 | * {@link #RECOMPILING} state. |
| 29 | */ |
| 30 | INSTALLING, |
| 31 | |
| 32 | /** |
| 33 | * The intent has been successfully installed. This is a state where the |
| 34 | * intent may remain parked until it is withdrawn by the application or |
| 35 | * until the network environment changes in some way to make the original |
| 36 | * set of installable intents untenable. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 37 | */ |
| 38 | INSTALLED, |
| 39 | |
| 40 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 41 | * Signifies that the intent is being recompiled into installable intents |
| 42 | * as an attempt to adapt to an anomaly in the network environment. |
| 43 | * This is a transitional state after which the intent will enter either |
| 44 | * {@link #FAILED} state or {@link #INSTALLING} state. |
| 45 | * <p/> |
| 46 | * Exit to the {@link #FAILED} state may be caused by failure to compile |
| 47 | * or by compiling into the same set of installable intents which have |
| 48 | * previously failed to be installed. |
| 49 | */ |
| 50 | RECOMPILING, |
| 51 | |
| 52 | /** |
| 53 | * Indicates that the intent is being withdrawn. This is a transitional |
| 54 | * state, triggered by invocation of the |
| 55 | * {@link IntentService#withdraw(Intent)} but one with only one outcome, |
| 56 | * which is the the intent being placed in the {@link #WITHDRAWN} state. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 57 | */ |
| 58 | WITHDRAWING, |
| 59 | |
| 60 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 61 | * Indicates that the intent has been successfully withdrawn. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 62 | */ |
| 63 | WITHDRAWN, |
| 64 | |
| 65 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 66 | * Signifies that the intent has failed compiling, installing or |
| 67 | * recompiling states. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 68 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame^] | 69 | FAILED |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 70 | } |