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