Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
weibit | 38c42ed | 2014-10-09 19:03:54 -0700 | [diff] [blame] | 19 | package org.onlab.onos.optical.cfg; |
| 20 | |
| 21 | import java.util.Map; |
| 22 | import org.codehaus.jackson.JsonNode; |
| 23 | import org.codehaus.jackson.annotate.JsonProperty; |
| 24 | import org.onlab.util.HexString; |
| 25 | |
| 26 | /** |
| 27 | * Public class corresponding to JSON described data model. |
| 28 | */ |
| 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 | } |