Sho SHIMIZU | 15ed4fd | 2014-08-05 14:40:42 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.newintent; |
| 2 | |
| 3 | /** |
| 4 | * This class represents the states of an intent. |
| 5 | * |
| 6 | * <p> |
| 7 | * Note: The state is expressed as enum, but there is possibility |
| 8 | * in the future that we define specific class instead of enum to improve |
| 9 | * the extensibility of state definition. |
| 10 | * </p> |
| 11 | */ |
| 12 | public enum IntentState { |
| 13 | // FIXME: requires discussion on State vs. EventType and a solid state-transition diagram |
| 14 | // TODO: consider the impact of conflict detection |
| 15 | // TODO: consider the impact that external events affect an installed intent |
| 16 | /** |
| 17 | * The beginning state. |
| 18 | * |
| 19 | * All intent in the runtime take this state first. |
| 20 | */ |
| 21 | SUBMITTED, |
| 22 | |
| 23 | /** |
| 24 | * The intent compilation has been completed. |
| 25 | * |
| 26 | * An intent translation graph (tree) is completely created. |
| 27 | * Leaves of the graph are installable intent type. |
| 28 | */ |
| 29 | COMPILED, |
| 30 | |
| 31 | /** |
| 32 | * The intent has been successfully installed. |
| 33 | */ |
| 34 | INSTALLED, |
| 35 | |
| 36 | /** |
| 37 | * The intent is being withdrawn. |
| 38 | * |
Sho SHIMIZU | 228140c | 2014-08-11 19:15:43 -0700 | [diff] [blame] | 39 | * When {@link IntentService#withdraw(Intent)} is called, |
Sho SHIMIZU | 15ed4fd | 2014-08-05 14:40:42 -0700 | [diff] [blame] | 40 | * the intent takes this state first. |
| 41 | */ |
| 42 | WITHDRAWING, |
| 43 | |
| 44 | /** |
| 45 | * The intent has been successfully withdrawn. |
| 46 | */ |
| 47 | WITHDRAWN, |
| 48 | |
| 49 | /** |
| 50 | * The intent has failed to be compiled, installed, or withdrawn. |
| 51 | * |
| 52 | * When the intent failed to be withdrawn, it is still, at least partially installed. |
| 53 | */ |
| 54 | FAILED, |
| 55 | } |