Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.util; |
| 2 | |
| 3 | import net.floodlightcontroller.util.CallerId; |
| 4 | import net.floodlightcontroller.util.DataPath; |
| 5 | import net.floodlightcontroller.util.FlowId; |
Pavlin Radoslavov | ad008e0 | 2013-02-21 18:42:42 -0800 | [diff] [blame] | 6 | |
| 7 | import org.codehaus.jackson.annotate.JsonProperty; |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 8 | |
| 9 | /** |
| 10 | * The class representing the Flow Path. |
| 11 | */ |
| 12 | public 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 28 | @JsonProperty("flowId") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 29 | 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 36 | @JsonProperty("flowId") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 37 | 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 46 | @JsonProperty("installerId") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 47 | 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 54 | @JsonProperty("installerId") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 55 | 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 64 | @JsonProperty("dataPath") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 65 | 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 Radoslavov | 2013cbb | 2013-02-26 10:15:18 -0800 | [diff] [blame] | 72 | @JsonProperty("dataPath") |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 73 | public void setDataPath(DataPath dataPath) { |
| 74 | this.dataPath = dataPath; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Convert the flow path to a string. |
| 79 | * |
Pavlin Radoslavov | a10a9a8 | 2013-02-22 11:47:54 -0800 | [diff] [blame] | 80 | * The string has the following form: |
| 81 | * [flowId=XXX installerId=XXX dataPath=XXX] |
| 82 | * |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 83 | * @return the flow path as a string. |
| 84 | */ |
| 85 | @Override |
| 86 | public String toString() { |
Pavlin Radoslavov | a10a9a8 | 2013-02-22 11:47:54 -0800 | [diff] [blame] | 87 | String ret = "[flowId=" + this.flowId.toString(); |
| 88 | ret += " installerId=" + this.installerId.toString(); |
| 89 | ret += " dataPath=" + this.dataPath.toString(); |
| 90 | ret += "]"; |
Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 91 | return ret; |
| 92 | } |
| 93 | } |