blob: 00507186608e0513d36b304bb2f7c4df5a6ff621 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorb876bf12014-10-02 14:59:37 -070016package org.onlab.onos.net.intent;
17
18/**
tom85258ee2014-10-07 00:10:02 -070019 * Representation of the phases an intent may attain during its lifecycle.
Brian O'Connorb876bf12014-10-02 14:59:37 -070020 */
21public enum IntentState {
tom85258ee2014-10-07 00:10:02 -070022
Brian O'Connorb876bf12014-10-02 14:59:37 -070023 /**
tom85258ee2014-10-07 00:10:02 -070024 * Signifies that the intent has been submitted and will start compiling
25 * shortly. However, this compilation may not necessarily occur on the
26 * local controller instance.
27 * <p/>
Brian O'Connorb876bf12014-10-02 14:59:37 -070028 * All intent in the runtime take this state first.
29 */
30 SUBMITTED,
31
32 /**
tom85258ee2014-10-07 00:10:02 -070033 * Signifies that the intent is being compiled into installable intents.
34 * This is a transitional state after which the intent will enter either
35 * {@link #FAILED} state or {@link #INSTALLING} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070036 */
tom85258ee2014-10-07 00:10:02 -070037 COMPILING,
Brian O'Connorb876bf12014-10-02 14:59:37 -070038
39 /**
tom85258ee2014-10-07 00:10:02 -070040 * Signifies that the resulting installable intents are being installed
41 * into the network environment. This is a transitional state after which
42 * the intent will enter either {@link #INSTALLED} state or
43 * {@link #RECOMPILING} state.
44 */
45 INSTALLING,
46
47 /**
48 * The intent has been successfully installed. This is a state where the
49 * intent may remain parked until it is withdrawn by the application or
50 * until the network environment changes in some way to make the original
51 * set of installable intents untenable.
Brian O'Connorb876bf12014-10-02 14:59:37 -070052 */
53 INSTALLED,
54
55 /**
tom85258ee2014-10-07 00:10:02 -070056 * Signifies that the intent is being recompiled into installable intents
57 * as an attempt to adapt to an anomaly in the network environment.
58 * This is a transitional state after which the intent will enter either
59 * {@link #FAILED} state or {@link #INSTALLING} state.
60 * <p/>
61 * Exit to the {@link #FAILED} state may be caused by failure to compile
62 * or by compiling into the same set of installable intents which have
63 * previously failed to be installed.
64 */
65 RECOMPILING,
66
67 /**
68 * Indicates that the intent is being withdrawn. This is a transitional
69 * state, triggered by invocation of the
70 * {@link IntentService#withdraw(Intent)} but one with only one outcome,
71 * which is the the intent being placed in the {@link #WITHDRAWN} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070072 */
73 WITHDRAWING,
74
75 /**
tom85258ee2014-10-07 00:10:02 -070076 * Indicates that the intent has been successfully withdrawn.
Brian O'Connorb876bf12014-10-02 14:59:37 -070077 */
78 WITHDRAWN,
79
80 /**
tom85258ee2014-10-07 00:10:02 -070081 * Signifies that the intent has failed compiling, installing or
82 * recompiling states.
Brian O'Connorb876bf12014-10-02 14:59:37 -070083 */
tom85258ee2014-10-07 00:10:02 -070084 FAILED
Brian O'Connorb876bf12014-10-02 14:59:37 -070085}