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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.optical.cfg; |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 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. |
Sho SHIMIZU | be63b23 | 2015-06-30 10:57:58 -0700 | [diff] [blame] | 25 | * |
| 26 | * @deprecated in Cardinal Release |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 27 | */ |
Thomas Vachuska | 112c703 | 2014-11-16 11:05:14 -0800 | [diff] [blame] | 28 | @Deprecated |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 29 | public class OpticalSwitchDescription { |
| 30 | protected String name; |
| 31 | protected long dpid; |
| 32 | protected String nodeDpid; |
| 33 | protected String type; |
| 34 | protected double latitude; |
| 35 | protected double longitude; |
| 36 | protected boolean allowed; |
| 37 | protected Map<String, JsonNode> params; |
| 38 | protected Map<String, String> publishAttributes; |
| 39 | |
| 40 | public String getName() { |
| 41 | return name; |
| 42 | } |
| 43 | @JsonProperty("name") |
| 44 | public void setName(String name) { |
| 45 | this.name = name; |
| 46 | } |
| 47 | |
| 48 | public long getDpid() { |
| 49 | return dpid; |
| 50 | } |
| 51 | @JsonProperty("dpid") |
| 52 | public void setDpid(long dpid) { |
| 53 | this.dpid = dpid; |
| 54 | this.nodeDpid = HexString.toHexString(dpid); |
| 55 | } |
| 56 | |
| 57 | public String getNodeDpid() { |
| 58 | return nodeDpid; |
| 59 | } |
| 60 | |
| 61 | public String getHexDpid() { |
| 62 | return nodeDpid; |
| 63 | } |
| 64 | |
| 65 | public void setNodeDpid(String nodeDpid) { |
| 66 | this.nodeDpid = nodeDpid; |
| 67 | this.dpid = HexString.toLong(nodeDpid); |
| 68 | } |
| 69 | |
| 70 | public String getType() { |
| 71 | return type; |
| 72 | } |
| 73 | |
| 74 | public void setType(String type) { |
| 75 | this.type = type; |
| 76 | } |
| 77 | |
| 78 | public double getLatitude() { |
| 79 | return latitude; |
| 80 | } |
| 81 | |
| 82 | public void setLatitude(double latitude) { |
| 83 | this.latitude = latitude; |
| 84 | } |
| 85 | |
| 86 | public double getLongitude() { |
| 87 | return longitude; |
| 88 | } |
| 89 | |
| 90 | public void setLongitude(double longitude) { |
| 91 | this.longitude = longitude; |
| 92 | } |
| 93 | |
| 94 | public boolean isAllowed() { |
| 95 | return allowed; |
| 96 | } |
| 97 | |
| 98 | public void setAllowed(boolean allowed) { |
| 99 | this.allowed = allowed; |
| 100 | } |
| 101 | |
| 102 | public Map<String, JsonNode> getParams() { |
| 103 | return params; |
| 104 | } |
| 105 | |
| 106 | public void setParams(Map<String, JsonNode> params) { |
| 107 | this.params = params; |
| 108 | } |
| 109 | |
| 110 | public Map<String, String> getPublishAttributes() { |
| 111 | return publishAttributes; |
| 112 | } |
| 113 | |
| 114 | public void setPublishAttributes(Map<String, String> publishAttributes) { |
| 115 | this.publishAttributes = publishAttributes; |
| 116 | } |
| 117 | |
| 118 | } |