blob: 0cb42ffc6464f3d4c64851fb620576061d49737a [file] [log] [blame]
Jonathan Hartaa380972014-04-03 10:24:46 -07001package net.onrc.onos.core.intent;
Toshio Koideb609b3b2014-02-14 18:25:52 -08002
3/**
4 * @author Toshio Koide (t-koide@onlab.us)
5 */
6public class IntentOperation {
Ray Milkey269ffb92014-04-03 14:43:30 -07007 public enum Operator {
8 /**
9 * Add new intent specified by intent field.
10 */
11 ADD,
Toshio Koideb609b3b2014-02-14 18:25:52 -080012
Ray Milkey269ffb92014-04-03 14:43:30 -070013 /**
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 Koidedf2eab92014-02-20 11:24:59 -080018
Ray Milkey269ffb92014-04-03 14:43:30 -070019 /**
20 * Do error handling.
21 * The instance of intent field should be an instance of ErrorIntent
22 */
23 ERROR,
24 }
Toshio Koideb609b3b2014-02-14 18:25:52 -080025
Ray Milkey269ffb92014-04-03 14:43:30 -070026 public Operator operator;
27 public Intent intent;
Toshio Koidea10c0372014-02-20 17:28:10 -080028
Ray Milkey269ffb92014-04-03 14:43:30 -070029 protected IntentOperation() {
30 }
Toshio Koideb609b3b2014-02-14 18:25:52 -080031
Ray Milkey269ffb92014-04-03 14:43:30 -070032 public IntentOperation(Operator operator, Intent intent) {
33 this.operator = operator;
34 this.intent = intent;
35 }
Toshio Koideb609b3b2014-02-14 18:25:52 -080036
Ray Milkey269ffb92014-04-03 14:43:30 -070037 @Override
38 public String toString() {
39 return operator.toString() + ", (" + intent.toString() + ")";
40 }
Toshio Koideb609b3b2014-02-14 18:25:52 -080041}