blob: bd140af656258d77b983d453715a6b89c28b0b39 [file] [log] [blame]
Brian O'Connorb876bf12014-10-02 14:59:37 -07001package org.onlab.onos.net.intent;
2
3/**
tom85258ee2014-10-07 00:10:02 -07004 * Representation of the phases an intent may attain during its lifecycle.
Brian O'Connorb876bf12014-10-02 14:59:37 -07005 */
6public enum IntentState {
tom85258ee2014-10-07 00:10:02 -07007
Brian O'Connorb876bf12014-10-02 14:59:37 -07008 /**
tom85258ee2014-10-07 00:10:02 -07009 * 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'Connorb876bf12014-10-02 14:59:37 -070013 * All intent in the runtime take this state first.
14 */
15 SUBMITTED,
16
17 /**
tom85258ee2014-10-07 00:10:02 -070018 * 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'Connorb876bf12014-10-02 14:59:37 -070021 */
tom85258ee2014-10-07 00:10:02 -070022 COMPILING,
Brian O'Connorb876bf12014-10-02 14:59:37 -070023
24 /**
tom85258ee2014-10-07 00:10:02 -070025 * 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'Connorb876bf12014-10-02 14:59:37 -070037 */
38 INSTALLED,
39
40 /**
tom85258ee2014-10-07 00:10:02 -070041 * 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'Connorb876bf12014-10-02 14:59:37 -070057 */
58 WITHDRAWING,
59
60 /**
tom85258ee2014-10-07 00:10:02 -070061 * Indicates that the intent has been successfully withdrawn.
Brian O'Connorb876bf12014-10-02 14:59:37 -070062 */
63 WITHDRAWN,
64
65 /**
tom85258ee2014-10-07 00:10:02 -070066 * Signifies that the intent has failed compiling, installing or
67 * recompiling states.
Brian O'Connorb876bf12014-10-02 14:59:37 -070068 */
tom85258ee2014-10-07 00:10:02 -070069 FAILED
Brian O'Connorb876bf12014-10-02 14:59:37 -070070}