Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 15 | */ |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 16 | package org.onlab.onos.optical.cfg; |
| 17 | |
| 18 | import java.util.Map; |
| 19 | import org.codehaus.jackson.JsonNode; |
| 20 | import org.codehaus.jackson.annotate.JsonProperty; |
| 21 | import org.onlab.util.HexString; |
| 22 | |
| 23 | /** |
| 24 | * Public class corresponding to JSON described data model. |
| 25 | */ |
Thomas Vachuska | 112c703 | 2014-11-16 11:05:14 -0800 | [diff] [blame] | 26 | @Deprecated |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 27 | public class OpticalSwitchDescription { |
| 28 | protected String name; |
| 29 | protected long dpid; |
| 30 | protected String nodeDpid; |
| 31 | protected String type; |
| 32 | protected double latitude; |
| 33 | protected double longitude; |
| 34 | protected boolean allowed; |
| 35 | protected Map<String, JsonNode> params; |
| 36 | protected Map<String, String> publishAttributes; |
| 37 | |
| 38 | public String getName() { |
| 39 | return name; |
| 40 | } |
| 41 | @JsonProperty("name") |
| 42 | public void setName(String name) { |
| 43 | this.name = name; |
| 44 | } |
| 45 | |
| 46 | public long getDpid() { |
| 47 | return dpid; |
| 48 | } |
| 49 | @JsonProperty("dpid") |
| 50 | public void setDpid(long dpid) { |
| 51 | this.dpid = dpid; |
| 52 | this.nodeDpid = HexString.toHexString(dpid); |
| 53 | } |
| 54 | |
| 55 | public String getNodeDpid() { |
| 56 | return nodeDpid; |
| 57 | } |
| 58 | |
| 59 | public String getHexDpid() { |
| 60 | return nodeDpid; |
| 61 | } |
| 62 | |
| 63 | public void setNodeDpid(String nodeDpid) { |
| 64 | this.nodeDpid = nodeDpid; |
| 65 | this.dpid = HexString.toLong(nodeDpid); |
| 66 | } |
| 67 | |
| 68 | public String getType() { |
| 69 | return type; |
| 70 | } |
| 71 | |
| 72 | public void setType(String type) { |
| 73 | this.type = type; |
| 74 | } |
| 75 | |
| 76 | public double getLatitude() { |
| 77 | return latitude; |
| 78 | } |
| 79 | |
| 80 | public void setLatitude(double latitude) { |
| 81 | this.latitude = latitude; |
| 82 | } |
| 83 | |
| 84 | public double getLongitude() { |
| 85 | return longitude; |
| 86 | } |
| 87 | |
| 88 | public void setLongitude(double longitude) { |
| 89 | this.longitude = longitude; |
| 90 | } |
| 91 | |
| 92 | public boolean isAllowed() { |
| 93 | return allowed; |
| 94 | } |
| 95 | |
| 96 | public void setAllowed(boolean allowed) { |
| 97 | this.allowed = allowed; |
| 98 | } |
| 99 | |
| 100 | public Map<String, JsonNode> getParams() { |
| 101 | return params; |
| 102 | } |
| 103 | |
| 104 | public void setParams(Map<String, JsonNode> params) { |
| 105 | this.params = params; |
| 106 | } |
| 107 | |
| 108 | public Map<String, String> getPublishAttributes() { |
| 109 | return publishAttributes; |
| 110 | } |
| 111 | |
| 112 | public void setPublishAttributes(Map<String, String> publishAttributes) { |
| 113 | this.publishAttributes = publishAttributes; |
| 114 | } |
| 115 | |
| 116 | } |