blob: f91bb4a74c404ddcd9b2a706684a65be04468631 [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 -08006import net.floodlightcontroller.util.serializers.FlowPathSerializer;
7
8import org.codehaus.jackson.annotate.JsonProperty;
9import org.codehaus.jackson.map.annotate.JsonSerialize;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080010
11/**
12 * The class representing the Flow Path.
13 */
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080014@JsonSerialize(using=FlowPathSerializer.class)
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080015public class FlowPath {
16 private FlowId flowId; // The Flow ID
17 private CallerId installerId; // The Caller ID of the path installer
18 private DataPath dataPath; // The data path
19
20 /**
21 * Default constructor.
22 */
23 public FlowPath() {
24 }
25
26 /**
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -080027 * Constructor from a string.
28 */
29 public FlowPath(String str) {
30 // TODO: Implement it.
31 }
32
33 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080034 * Get the flow path Flow ID.
35 *
36 * @return the flow path Flow ID.
37 */
38 public FlowId flowId() { return flowId; }
39
40 /**
41 * Set the flow path Flow ID.
42 *
43 * @param flowId the flow path Flow ID to set.
44 */
45 public void setFlowId(FlowId flowId) {
46 this.flowId = flowId;
47 }
48
49 /**
50 * Get the Caller ID of the flow path installer.
51 *
52 * @return the Caller ID of the flow path installer.
53 */
54 public CallerId installerId() { return installerId; }
55
56 /**
57 * Set the Caller ID of the flow path installer.
58 *
59 * @param installerId the Caller ID of the flow path installer.
60 */
61 public void setInstallerId(CallerId installerId) {
62 this.installerId = installerId;
63 }
64
65 /**
66 * Get the flow path's data path.
67 *
68 * @return the flow path's data path.
69 */
70 public DataPath dataPath() { return dataPath; }
71
72 /**
73 * Set the flow path's data path.
74 *
75 * @param dataPath the flow path's data path to set.
76 */
77 public void setDataPath(DataPath dataPath) {
78 this.dataPath = dataPath;
79 }
80
81 /**
82 * Convert the flow path to a string.
83 *
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -080084 * The string has the following form:
85 * [flowId=XXX installerId=XXX dataPath=XXX]
86 *
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080087 * @return the flow path as a string.
88 */
89 @Override
90 public String toString() {
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -080091 String ret = "[flowId=" + this.flowId.toString();
92 ret += " installerId=" + this.installerId.toString();
93 ret += " dataPath=" + this.dataPath.toString();
94 ret += "]";
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080095 return ret;
96 }
97}