blob: 8c73e2d29af3af196be410e0749e624b3acb8d85 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska781d18b2014-10-27 10:31:25 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska781d18b2014-10-27 10:31:25 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska781d18b2014-10-27 10:31:25 -070015 */
weibit38c42ed2014-10-09 19:03:54 -070016package org.onlab.onos.optical.cfg;
17
18import java.util.Map;
19import org.codehaus.jackson.JsonNode;
20import org.codehaus.jackson.annotate.JsonProperty;
21import org.onlab.util.HexString;
22
23/**
24 * Public class corresponding to JSON described data model.
25 */
26public class OpticalSwitchDescription {
27 protected String name;
28 protected long dpid;
29 protected String nodeDpid;
30 protected String type;
31 protected double latitude;
32 protected double longitude;
33 protected boolean allowed;
34 protected Map<String, JsonNode> params;
35 protected Map<String, String> publishAttributes;
36
37 public String getName() {
38 return name;
39 }
40 @JsonProperty("name")
41 public void setName(String name) {
42 this.name = name;
43 }
44
45 public long getDpid() {
46 return dpid;
47 }
48 @JsonProperty("dpid")
49 public void setDpid(long dpid) {
50 this.dpid = dpid;
51 this.nodeDpid = HexString.toHexString(dpid);
52 }
53
54 public String getNodeDpid() {
55 return nodeDpid;
56 }
57
58 public String getHexDpid() {
59 return nodeDpid;
60 }
61
62 public void setNodeDpid(String nodeDpid) {
63 this.nodeDpid = nodeDpid;
64 this.dpid = HexString.toLong(nodeDpid);
65 }
66
67 public String getType() {
68 return type;
69 }
70
71 public void setType(String type) {
72 this.type = type;
73 }
74
75 public double getLatitude() {
76 return latitude;
77 }
78
79 public void setLatitude(double latitude) {
80 this.latitude = latitude;
81 }
82
83 public double getLongitude() {
84 return longitude;
85 }
86
87 public void setLongitude(double longitude) {
88 this.longitude = longitude;
89 }
90
91 public boolean isAllowed() {
92 return allowed;
93 }
94
95 public void setAllowed(boolean allowed) {
96 this.allowed = allowed;
97 }
98
99 public Map<String, JsonNode> getParams() {
100 return params;
101 }
102
103 public void setParams(Map<String, JsonNode> params) {
104 this.params = params;
105 }
106
107 public Map<String, String> getPublishAttributes() {
108 return publishAttributes;
109 }
110
111 public void setPublishAttributes(Map<String, String> publishAttributes) {
112 this.publishAttributes = publishAttributes;
113 }
114
115}