Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 4 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 8 | * 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 Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.intent; |
| 17 | |
| 18 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 19 | * Representation of the phases an intent may attain during its lifecycle. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 20 | */ |
| 21 | public enum IntentState { |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 22 | |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 23 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 24 | * 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'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 28 | * All intent in the runtime take this state first. |
| 29 | */ |
| 30 | SUBMITTED, |
| 31 | |
| 32 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 33 | * 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'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 36 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 37 | COMPILING, |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 38 | |
| 39 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 40 | * 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'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 52 | */ |
| 53 | INSTALLED, |
| 54 | |
| 55 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 56 | * 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'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 72 | */ |
| 73 | WITHDRAWING, |
| 74 | |
| 75 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 76 | * Indicates that the intent has been successfully withdrawn. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 77 | */ |
| 78 | WITHDRAWN, |
| 79 | |
| 80 | /** |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 81 | * Signifies that the intent has failed compiling, installing or |
| 82 | * recompiling states. |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 83 | */ |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 84 | FAILED |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 85 | } |