weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 1 | package org.onlab.onos.optical.cfg; |
| 2 | |
| 3 | import java.util.Map; |
| 4 | import org.codehaus.jackson.JsonNode; |
| 5 | import org.codehaus.jackson.annotate.JsonProperty; |
| 6 | import org.onlab.util.HexString; |
| 7 | |
| 8 | /** |
| 9 | * Public class corresponding to JSON described data model. |
| 10 | */ |
| 11 | public class OpticalSwitchDescription { |
| 12 | protected String name; |
| 13 | protected long dpid; |
| 14 | protected String nodeDpid; |
| 15 | protected String type; |
| 16 | protected double latitude; |
| 17 | protected double longitude; |
| 18 | protected boolean allowed; |
| 19 | protected Map<String, JsonNode> params; |
| 20 | protected Map<String, String> publishAttributes; |
| 21 | |
| 22 | public String getName() { |
| 23 | return name; |
| 24 | } |
| 25 | @JsonProperty("name") |
| 26 | public void setName(String name) { |
| 27 | this.name = name; |
| 28 | } |
| 29 | |
| 30 | public long getDpid() { |
| 31 | return dpid; |
| 32 | } |
| 33 | @JsonProperty("dpid") |
| 34 | public void setDpid(long dpid) { |
| 35 | this.dpid = dpid; |
| 36 | this.nodeDpid = HexString.toHexString(dpid); |
| 37 | } |
| 38 | |
| 39 | public String getNodeDpid() { |
| 40 | return nodeDpid; |
| 41 | } |
| 42 | |
| 43 | public String getHexDpid() { |
| 44 | return nodeDpid; |
| 45 | } |
| 46 | |
| 47 | public void setNodeDpid(String nodeDpid) { |
| 48 | this.nodeDpid = nodeDpid; |
| 49 | this.dpid = HexString.toLong(nodeDpid); |
| 50 | } |
| 51 | |
| 52 | public String getType() { |
| 53 | return type; |
| 54 | } |
| 55 | |
| 56 | public void setType(String type) { |
| 57 | this.type = type; |
| 58 | } |
| 59 | |
| 60 | public double getLatitude() { |
| 61 | return latitude; |
| 62 | } |
| 63 | |
| 64 | public void setLatitude(double latitude) { |
| 65 | this.latitude = latitude; |
| 66 | } |
| 67 | |
| 68 | public double getLongitude() { |
| 69 | return longitude; |
| 70 | } |
| 71 | |
| 72 | public void setLongitude(double longitude) { |
| 73 | this.longitude = longitude; |
| 74 | } |
| 75 | |
| 76 | public boolean isAllowed() { |
| 77 | return allowed; |
| 78 | } |
| 79 | |
| 80 | public void setAllowed(boolean allowed) { |
| 81 | this.allowed = allowed; |
| 82 | } |
| 83 | |
| 84 | public Map<String, JsonNode> getParams() { |
| 85 | return params; |
| 86 | } |
| 87 | |
| 88 | public void setParams(Map<String, JsonNode> params) { |
| 89 | this.params = params; |
| 90 | } |
| 91 | |
| 92 | public Map<String, String> getPublishAttributes() { |
| 93 | return publishAttributes; |
| 94 | } |
| 95 | |
| 96 | public void setPublishAttributes(Map<String, String> publishAttributes) { |
| 97 | this.publishAttributes = publishAttributes; |
| 98 | } |
| 99 | |
| 100 | } |