Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 1 | package net.onrc.onos.intent; |
| 2 | |
| 3 | /** |
| 4 | * @author Toshio Koide (t-koide@onlab.us) |
| 5 | */ |
| 6 | public class IntentOperation { |
| 7 | public enum Operator { |
| 8 | /** |
Toshio Koide | df2eab9 | 2014-02-20 11:24:59 -0800 | [diff] [blame] | 9 | * Add new intent specified by intent field. |
Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 10 | */ |
| 11 | ADD, |
| 12 | |
| 13 | /** |
| 14 | * Remove existing intent specified by intent field. |
Toshio Koide | df2eab9 | 2014-02-20 11:24:59 -0800 | [diff] [blame] | 15 | * The instance of intent field should be an instance of Intent class (not a child class) |
Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 16 | */ |
| 17 | REMOVE, |
Toshio Koide | df2eab9 | 2014-02-20 11:24:59 -0800 | [diff] [blame] | 18 | |
| 19 | /** |
| 20 | * Do error handling. |
| 21 | * The instance of intent field should be an instance of ErrorIntent |
| 22 | */ |
| 23 | ERROR, |
Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 24 | } |
| 25 | |
Toshio Koide | a10c037 | 2014-02-20 17:28:10 -0800 | [diff] [blame] | 26 | public Operator operator; |
| 27 | public Intent intent; |
| 28 | |
| 29 | protected IntentOperation() {} |
Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 30 | |
| 31 | public IntentOperation(Operator operator, Intent intent) { |
| 32 | this.operator = operator; |
| 33 | this.intent = intent; |
| 34 | } |
| 35 | |
Toshio Koide | 0c9106d | 2014-02-19 15:26:38 -0800 | [diff] [blame] | 36 | @Override |
| 37 | public String toString() { |
| 38 | return operator.toString() + ", (" + intent.toString() + ")"; |
| 39 | } |
Toshio Koide | b609b3b | 2014-02-14 18:25:52 -0800 | [diff] [blame] | 40 | } |