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