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 | |
| 26 | public IntentOperation() {} |
| 27 | |
| 28 | public IntentOperation(Operator operator, Intent intent) { |
| 29 | this.operator = operator; |
| 30 | this.intent = intent; |
| 31 | } |
| 32 | |
| 33 | public Operator operator; |
| 34 | public Intent intent; |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 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 | } |