Open Kilda Java Documentation
IslLinkInfo.java
Go to the documentation of this file.
1 package org.openkilda.model;
2 
3 import com.fasterxml.jackson.annotation.JsonIgnore;
4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 import com.fasterxml.jackson.annotation.JsonInclude;
6 import com.fasterxml.jackson.annotation.JsonProperty;
7 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
8 
9 import java.io.Serializable;
10 
16 @JsonInclude(JsonInclude.Include.NON_NULL)
17 @JsonIgnoreProperties(ignoreUnknown = true)
18 @JsonPropertyOrder({"src_port", "latency", "source_switch", "available_bandwidth", "dst_port",
19  "target_switch", "speed", "state"})
20 public class IslLinkInfo implements Serializable {
21 
22  private final static long serialVersionUID = 8274573430947748236L;
23 
24  @JsonProperty("src_port")
25  private int srcPort;
26 
27  @JsonProperty("latency")
28  private int latency;
29 
30  @JsonProperty("source_switch")
31  private String srcSwitch;
32 
33  @JsonProperty("source_switch_name")
34  private String srcSwitchName;
35 
36  @JsonProperty("available_bandwidth")
37  private int availableBandwidth;
38 
39  @JsonProperty("dst_port")
40  private int dstPort;
41 
42  @JsonProperty("target_switch")
43  private String dstSwitch;
44 
45  @JsonProperty("target_switch_name")
46  private String dstSwitchName;
47 
48  @JsonProperty("speed")
49  private int speed;
50 
51  @JsonProperty("state")
52  private String state;
53 
54  @JsonProperty("state1")
55  private String state1;
56 
57  private boolean isUnidirectional;
58 
59  private String cost;
60 
61  @JsonProperty("affected")
62  private boolean affected;
63 
64  public String getCost() {
65  return cost;
66  }
67 
68  public void setCost(String cost) {
69  this.cost = cost;
70  }
71 
72 
73  public boolean isAffected() {
74  return affected;
75  }
76 
77  public void setAffected(boolean affected) {
78  this.affected = affected;
79  }
80 
87  public int getSrcPort() {
88  return srcPort;
89  }
90 
97  public void setSrcPort(final int srcPort) {
98  this.srcPort = srcPort;
99  }
100 
107  public int getLatency() {
108  return latency;
109  }
110 
117  public void setLatency(final int latency) {
118  this.latency = latency;
119  }
120 
126  public String getSrcSwitch() {
127  return srcSwitch;
128  }
129 
136  public void setSrcSwitch(final String srcSwitch) {
137  this.srcSwitch = srcSwitch;
138  }
139 
146  public int getAvailableBandwidth() {
147  return availableBandwidth;
148  }
149 
156  public void setAvailableBandwidth(final int availableBandwidth) {
157  this.availableBandwidth = availableBandwidth;
158  }
159 
166  public int getDstPort() {
167  return dstPort;
168  }
169 
176  public void setDstPort(final int dstPort) {
177  this.dstPort = dstPort;
178  }
179 
186  public String getDstSwitch() {
187  return dstSwitch;
188  }
189 
196  public void setDstSwitch(final String dstSwitch) {
197  this.dstSwitch = dstSwitch;
198  }
199 
206  public int getSpeed() {
207  return speed;
208  }
209 
216  public void setSpeed(final int speed) {
217  this.speed = speed;
218  }
219 
226  public String getState() {
227  return state;
228  }
229 
236  public void setState(final String state) {
237  this.state = state;
238  }
239 
240  public String getSrcSwitchName() {
241  return srcSwitchName;
242  }
243 
244  public void setSrcSwitchName(String srcSwitchName) {
245  this.srcSwitchName = srcSwitchName;
246  }
247 
248  public String getDstSwitchName() {
249  return dstSwitchName;
250  }
251 
252  public void setDstSwitchName(String dstSwitchName) {
253  this.dstSwitchName = dstSwitchName;
254  }
255 
256  public boolean isUnidirectional() {
257  return isUnidirectional;
258  }
259 
260  public void setUnidirectional(boolean isUnidirectional) {
261  this.isUnidirectional = isUnidirectional;
262  }
263  @JsonIgnore
264  public String getForwardKey() {
265  return this.srcSwitch + "-" + this.srcPort + "-" + this.dstSwitch + "-" + this.dstPort;
266  }
267  @JsonIgnore
268  public String getReverseKey() {
269  return this.dstSwitch + "-" + this.dstPort + "-" + this.srcSwitch + "-" + this.srcPort;
270  }
271 
272  public String getState1() {
273  return state1;
274  }
275 
276  public void setState1(String state1) {
277  this.state1 = state1;
278  }
279 
280 
281 }