blob: 38662d20a915866b4ad0ef87f70292fc06de5be1 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Brian O'Connorb876bf12014-10-02 14:59:37 -070019package org.onlab.onos.net.intent;
20
21/**
tom85258ee2014-10-07 00:10:02 -070022 * Representation of the phases an intent may attain during its lifecycle.
Brian O'Connorb876bf12014-10-02 14:59:37 -070023 */
24public enum IntentState {
tom85258ee2014-10-07 00:10:02 -070025
Brian O'Connorb876bf12014-10-02 14:59:37 -070026 /**
tom85258ee2014-10-07 00:10:02 -070027 * Signifies that the intent has been submitted and will start compiling
28 * shortly. However, this compilation may not necessarily occur on the
29 * local controller instance.
30 * <p/>
Brian O'Connorb876bf12014-10-02 14:59:37 -070031 * All intent in the runtime take this state first.
32 */
33 SUBMITTED,
34
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.
63 * <p/>
64 * 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.
67 */
68 RECOMPILING,
69
70 /**
71 * Indicates that the intent is being withdrawn. This is a transitional
72 * state, triggered by invocation of the
73 * {@link IntentService#withdraw(Intent)} but one with only one outcome,
74 * which is the the intent being placed in the {@link #WITHDRAWN} state.
Brian O'Connorb876bf12014-10-02 14:59:37 -070075 */
76 WITHDRAWING,
77
78 /**
tom85258ee2014-10-07 00:10:02 -070079 * Indicates that the intent has been successfully withdrawn.
Brian O'Connorb876bf12014-10-02 14:59:37 -070080 */
81 WITHDRAWN,
82
83 /**
tom85258ee2014-10-07 00:10:02 -070084 * Signifies that the intent has failed compiling, installing or
85 * recompiling states.
Brian O'Connorb876bf12014-10-02 14:59:37 -070086 */
tom85258ee2014-10-07 00:10:02 -070087 FAILED
Brian O'Connorb876bf12014-10-02 14:59:37 -070088}