blob: 5b3bbd1bfd43537f94d5aad998ce9e2985f20e3d [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
3import net.floodlightcontroller.util.CallerId;
4import net.floodlightcontroller.util.DataPath;
5import net.floodlightcontroller.util.FlowId;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -08006
7import org.codehaus.jackson.annotate.JsonProperty;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08008
9/**
10 * The class representing the Flow Path.
11 */
12public class FlowPath {
13 private FlowId flowId; // The Flow ID
14 private CallerId installerId; // The Caller ID of the path installer
15 private DataPath dataPath; // The data path
16
17 /**
18 * Default constructor.
19 */
20 public FlowPath() {
21 }
22
23 /**
24 * Get the flow path Flow ID.
25 *
26 * @return the flow path Flow ID.
27 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080028 @JsonProperty("flowId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080029 public FlowId flowId() { return flowId; }
30
31 /**
32 * Set the flow path Flow ID.
33 *
34 * @param flowId the flow path Flow ID to set.
35 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080036 @JsonProperty("flowId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080037 public void setFlowId(FlowId flowId) {
38 this.flowId = flowId;
39 }
40
41 /**
42 * Get the Caller ID of the flow path installer.
43 *
44 * @return the Caller ID of the flow path installer.
45 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080046 @JsonProperty("installerId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080047 public CallerId installerId() { return installerId; }
48
49 /**
50 * Set the Caller ID of the flow path installer.
51 *
52 * @param installerId the Caller ID of the flow path installer.
53 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080054 @JsonProperty("installerId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080055 public void setInstallerId(CallerId installerId) {
56 this.installerId = installerId;
57 }
58
59 /**
60 * Get the flow path's data path.
61 *
62 * @return the flow path's data path.
63 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080064 @JsonProperty("dataPath")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080065 public DataPath dataPath() { return dataPath; }
66
67 /**
68 * Set the flow path's data path.
69 *
70 * @param dataPath the flow path's data path to set.
71 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -080072 @JsonProperty("dataPath")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080073 public void setDataPath(DataPath dataPath) {
74 this.dataPath = dataPath;
75 }
76
77 /**
78 * Convert the flow path to a string.
79 *
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -080080 * The string has the following form:
81 * [flowId=XXX installerId=XXX dataPath=XXX]
82 *
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080083 * @return the flow path as a string.
84 */
85 @Override
86 public String toString() {
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -080087 String ret = "[flowId=" + this.flowId.toString();
88 ret += " installerId=" + this.installerId.toString();
89 ret += " dataPath=" + this.dataPath.toString();
90 ret += "]";
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080091 return ret;
92 }
93}