blob: 3fbe82d3b17312d199e175fd85a857f7dba0e18c [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.
Thomas Vachuska4b420772014-10-30 16:46:17 -070027 * <p>
Brian O'Connorb876bf12014-10-02 14:59:37 -070028 * All intent in the runtime take this state first.
Thomas Vachuska4b420772014-10-30 16:46:17 -070029 * </p>
Brian O'Connorb876bf12014-10-02 14:59:37 -070030 */
31 SUBMITTED,
32
33 /**
tom85258ee2014-10-07 00:10:02 -070034 * Signifies that the intent is being compiled into installable intents.
35 * This is a transitional state after which the intent will enter either
36 * {@link #FAILED} state or {@link #INSTALLING} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070037 */
tom85258ee2014-10-07 00:10:02 -070038 COMPILING,
Brian O'Connorb876bf12014-10-02 14:59:37 -070039
40 /**
tom85258ee2014-10-07 00:10:02 -070041 * Signifies that the resulting installable intents are being installed
42 * into the network environment. This is a transitional state after which
43 * the intent will enter either {@link #INSTALLED} state or
44 * {@link #RECOMPILING} state.
45 */
46 INSTALLING,
47
48 /**
49 * The intent has been successfully installed. This is a state where the
50 * intent may remain parked until it is withdrawn by the application or
51 * until the network environment changes in some way to make the original
52 * set of installable intents untenable.
Brian O'Connorb876bf12014-10-02 14:59:37 -070053 */
54 INSTALLED,
55
56 /**
tom85258ee2014-10-07 00:10:02 -070057 * Signifies that the intent is being recompiled into installable intents
58 * as an attempt to adapt to an anomaly in the network environment.
59 * This is a transitional state after which the intent will enter either
60 * {@link #FAILED} state or {@link #INSTALLING} state.
Thomas Vachuska4b420772014-10-30 16:46:17 -070061 * <p>
tom85258ee2014-10-07 00:10:02 -070062 * Exit to the {@link #FAILED} state may be caused by failure to compile
63 * or by compiling into the same set of installable intents which have
64 * previously failed to be installed.
Thomas Vachuska4b420772014-10-30 16:46:17 -070065 * </p>
tom85258ee2014-10-07 00:10:02 -070066 */
67 RECOMPILING,
68
69 /**
70 * Indicates that the intent is being withdrawn. This is a transitional
71 * state, triggered by invocation of the
72 * {@link IntentService#withdraw(Intent)} but one with only one outcome,
73 * which is the the intent being placed in the {@link #WITHDRAWN} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070074 */
75 WITHDRAWING,
76
77 /**
tom85258ee2014-10-07 00:10:02 -070078 * Indicates that the intent has been successfully withdrawn.
Brian O'Connorb876bf12014-10-02 14:59:37 -070079 */
80 WITHDRAWN,
81
82 /**
tom85258ee2014-10-07 00:10:02 -070083 * Signifies that the intent has failed compiling, installing or
84 * recompiling states.
Brian O'Connorb876bf12014-10-02 14:59:37 -070085 */
tom85258ee2014-10-07 00:10:02 -070086 FAILED
Brian O'Connorb876bf12014-10-02 14:59:37 -070087}