Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 1 | package net.onrc.onos.intent; |
| 2 | |
| 3 | import net.onrc.onos.ofcontroller.networkgraph.Path; |
| 4 | |
| 5 | /** |
| 6 | * @author Toshio Koide (t-koide@onlab.us) |
| 7 | */ |
| 8 | public class PathIntent extends Intent { |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 9 | protected Path path; |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 10 | protected double bandwidth; |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 11 | protected Intent parentIntent; |
Toshio Koide | c406e79 | 2014-02-14 16:52:42 -0800 | [diff] [blame] | 12 | |
| 13 | /** |
| 14 | * Default constructor for Kryo deserialization |
| 15 | */ |
| 16 | protected PathIntent() { |
| 17 | } |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 18 | |
| 19 | /** |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 20 | * |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 21 | * @param graph |
| 22 | * @param path |
| 23 | * @param bandwidth bandwidth which should be allocated for the path. |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 24 | * If 0, no intent for bandwidth allocation (best effort). |
| 25 | * @param parentIntent parent intent. If null, this is root intent. |
Toshio Koide | 13986d1 | 2014-02-11 20:25:32 -0800 | [diff] [blame] | 26 | * @param id |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 27 | */ |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 28 | public PathIntent(String id, Path path, double bandwidth, Intent parentIntent) { |
Toshio Koide | 13986d1 | 2014-02-11 20:25:32 -0800 | [diff] [blame] | 29 | super(id); |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 30 | this.path = path; |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 31 | this.bandwidth = bandwidth; |
| 32 | this.parentIntent = parentIntent; |
| 33 | } |
| 34 | |
Toshio Koide | c406e79 | 2014-02-14 16:52:42 -0800 | [diff] [blame] | 35 | public double getBandwidth() { |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 36 | return bandwidth; |
| 37 | } |
| 38 | |
Toshio Koide | d9fa2a8 | 2014-02-19 17:35:18 -0800 | [diff] [blame] | 39 | public Path getPath() { |
Toshio Koide | 0c9106d | 2014-02-19 15:26:38 -0800 | [diff] [blame] | 40 | return path; |
Toshio Koide | c406e79 | 2014-02-14 16:52:42 -0800 | [diff] [blame] | 41 | } |
| 42 | |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 43 | public Intent getParentIntent() { |
| 44 | return parentIntent; |
| 45 | } |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 46 | } |