blob: 0deabad34be897a32c71dfc332a9ebc5ba93bf2c [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'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.intent;
Brian O'Connorb876bf12014-10-02 14:59:37 -070017
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.
Brian O'Connor7a71d5d2014-12-02 00:12:27 -080029 * </p><p>
30 * Intents will also pass through this state when they are updated.
Thomas Vachuska4b420772014-10-30 16:46:17 -070031 * </p>
Brian O'Connorb876bf12014-10-02 14:59:37 -070032 */
Brian O'Connor7a71d5d2014-12-02 00:12:27 -080033 INSTALL_REQ,
Brian O'Connorb876bf12014-10-02 14:59:37 -070034
35 /**
tom85258ee2014-10-07 00:10:02 -070036 * Signifies that the intent is being compiled into installable intents.
37 * This is a transitional state after which the intent will enter either
38 * {@link #FAILED} state or {@link #INSTALLING} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070039 */
tom85258ee2014-10-07 00:10:02 -070040 COMPILING,
Brian O'Connorb876bf12014-10-02 14:59:37 -070041
42 /**
tom85258ee2014-10-07 00:10:02 -070043 * Signifies that the resulting installable intents are being installed
44 * into the network environment. This is a transitional state after which
45 * the intent will enter either {@link #INSTALLED} state or
46 * {@link #RECOMPILING} state.
47 */
48 INSTALLING,
49
50 /**
51 * The intent has been successfully installed. This is a state where the
52 * intent may remain parked until it is withdrawn by the application or
53 * until the network environment changes in some way to make the original
54 * set of installable intents untenable.
Brian O'Connorb876bf12014-10-02 14:59:37 -070055 */
56 INSTALLED,
57
58 /**
tom85258ee2014-10-07 00:10:02 -070059 * Signifies that the intent is being recompiled into installable intents
60 * as an attempt to adapt to an anomaly in the network environment.
61 * This is a transitional state after which the intent will enter either
62 * {@link #FAILED} state or {@link #INSTALLING} state.
Thomas Vachuska4b420772014-10-30 16:46:17 -070063 * <p>
tom85258ee2014-10-07 00:10:02 -070064 * Exit to the {@link #FAILED} state may be caused by failure to compile
65 * or by compiling into the same set of installable intents which have
66 * previously failed to be installed.
Thomas Vachuska4b420772014-10-30 16:46:17 -070067 * </p>
tom85258ee2014-10-07 00:10:02 -070068 */
69 RECOMPILING,
70
71 /**
Brian O'Connor427a1762014-11-19 18:40:32 -080072 * Indicates that an application has requested that an intent be withdrawn.
Brian O'Connor7a71d5d2014-12-02 00:12:27 -080073 * It will start withdrawing shortly, but not necessarily on this instance.
74 * Intents can also be parked here if it is impossible to withdraw them.
Brian O'Connor427a1762014-11-19 18:40:32 -080075 */
Brian O'Connor7a71d5d2014-12-02 00:12:27 -080076 WITHDRAW_REQ,
Brian O'Connor427a1762014-11-19 18:40:32 -080077
78 /**
tom85258ee2014-10-07 00:10:02 -070079 * Indicates that the intent is being withdrawn. This is a transitional
80 * state, triggered by invocation of the
81 * {@link IntentService#withdraw(Intent)} but one with only one outcome,
82 * which is the the intent being placed in the {@link #WITHDRAWN} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070083 */
84 WITHDRAWING,
85
86 /**
tom85258ee2014-10-07 00:10:02 -070087 * Indicates that the intent has been successfully withdrawn.
Brian O'Connorb876bf12014-10-02 14:59:37 -070088 */
89 WITHDRAWN,
90
91 /**
tom85258ee2014-10-07 00:10:02 -070092 * Signifies that the intent has failed compiling, installing or
93 * recompiling states.
Brian O'Connorb876bf12014-10-02 14:59:37 -070094 */
tom85258ee2014-10-07 00:10:02 -070095 FAILED
Brian O'Connorb876bf12014-10-02 14:59:37 -070096}