blob: e000828e51d04bb8e26e3036559ae47258c76333 [file] [log] [blame]
Toshio Koidead17d5e2014-02-11 11:36:02 -08001package net.onrc.onos.intent;
2
3import net.onrc.onos.ofcontroller.networkgraph.Path;
4
5/**
6 * @author Toshio Koide (t-koide@onlab.us)
7 */
8public class PathIntent extends Intent {
Toshio Koided9fa2a82014-02-19 17:35:18 -08009 protected Path path;
Toshio Koide0e4d8d22014-02-14 10:56:10 -080010 protected double bandwidth;
Toshio Koidead17d5e2014-02-11 11:36:02 -080011 protected Intent parentIntent;
Toshio Koidec406e792014-02-14 16:52:42 -080012
13 /**
14 * Default constructor for Kryo deserialization
15 */
16 protected PathIntent() {
17 }
Toshio Koidead17d5e2014-02-11 11:36:02 -080018
19 /**
Toshio Koided9fa2a82014-02-19 17:35:18 -080020 *
Toshio Koidead17d5e2014-02-11 11:36:02 -080021 * @param graph
22 * @param path
23 * @param bandwidth bandwidth which should be allocated for the path.
Toshio Koide0e4d8d22014-02-14 10:56:10 -080024 * If 0, no intent for bandwidth allocation (best effort).
25 * @param parentIntent parent intent. If null, this is root intent.
Toshio Koide13986d12014-02-11 20:25:32 -080026 * @param id
Toshio Koidead17d5e2014-02-11 11:36:02 -080027 */
Toshio Koide0e4d8d22014-02-14 10:56:10 -080028 public PathIntent(String id, Path path, double bandwidth, Intent parentIntent) {
Toshio Koide13986d12014-02-11 20:25:32 -080029 super(id);
Toshio Koided9fa2a82014-02-19 17:35:18 -080030 this.path = path;
Toshio Koidead17d5e2014-02-11 11:36:02 -080031 this.bandwidth = bandwidth;
32 this.parentIntent = parentIntent;
33 }
34
Toshio Koidec406e792014-02-14 16:52:42 -080035 public double getBandwidth() {
Toshio Koidead17d5e2014-02-11 11:36:02 -080036 return bandwidth;
37 }
38
Toshio Koided9fa2a82014-02-19 17:35:18 -080039 public Path getPath() {
Toshio Koide0c9106d2014-02-19 15:26:38 -080040 return path;
Toshio Koidec406e792014-02-14 16:52:42 -080041 }
42
Toshio Koidead17d5e2014-02-11 11:36:02 -080043 public Intent getParentIntent() {
44 return parentIntent;
45 }
Toshio Koidead17d5e2014-02-11 11:36:02 -080046}