slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015-present Open Networking Laboratory |
| 3 | * |
| 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 |
| 7 | * |
| 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. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.xran.entities; |
| 18 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 19 | import com.fasterxml.jackson.annotation.*; |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 20 | import com.fasterxml.jackson.databind.JsonNode; |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 21 | import com.google.common.collect.Lists; |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 22 | import org.onosproject.store.service.WallClockTimestamp; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 23 | import org.onosproject.xran.codecs.api.*; |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 24 | import org.onosproject.xran.codecs.ber.types.BerInteger; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 25 | import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe; |
| 26 | import org.onosproject.xran.codecs.pdu.RRMConfig; |
| 27 | import org.onosproject.xran.identifiers.LinkId; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 28 | |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 29 | import java.util.Arrays; |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 30 | import java.util.List; |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 31 | import java.util.Optional; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 32 | import java.util.Timer; |
| 33 | |
| 34 | /** |
| 35 | * Created by dimitris on 7/22/17. |
| 36 | */ |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 37 | @JsonPropertyOrder({ |
| 38 | "Link-ID", |
| 39 | "Type", |
| 40 | "RRMConfiguration", |
| 41 | "TrafficPercent", |
| 42 | "BearerParameters", |
| 43 | "Quality", |
| 44 | "PDCP-Throughput", |
| 45 | "PDCP-Packet-Delay", |
| 46 | "Resource-Usage" |
| 47 | }) |
| 48 | @JsonIgnoreProperties(ignoreUnknown = true) |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 49 | public class RnibLink { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 50 | @JsonProperty("Link-ID") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 51 | private LinkId linkId; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 52 | @JsonProperty("RRMConfiguration") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 53 | private RRMConfig rrmParameters; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 54 | @JsonProperty("TrafficPercent") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 55 | private TrafficSplitPercentage trafficPercent; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 56 | @JsonProperty("BearerParameters") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 57 | private ERABParams bearerParameters; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 58 | @JsonProperty("Quality") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 59 | private LinkQuality quality; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 60 | @JsonProperty("PDCP-Throughput") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 61 | private PDCPThroughput pdcpThroughput; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 62 | @JsonProperty("PDCP-Packet-Delay") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 63 | private PDCPPacketDelay pdcpPackDelay; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 64 | @JsonProperty("Resource-Usage") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 65 | private ResourceUsage resourceUsage; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 66 | @JsonProperty("Type") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 67 | private Type type; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 68 | @JsonIgnore |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 69 | private Timer timer; |
| 70 | |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 71 | public RnibLink(RnibCell cell, RnibUe ue) { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 72 | trafficPercent = new TrafficSplitPercentage(); |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 73 | trafficPercent.setEcgi(cell.getEcgi()); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 74 | trafficPercent.setTrafficPercentDl(new BerInteger(100)); |
| 75 | trafficPercent.setTrafficPercentUl(new BerInteger(100)); |
| 76 | |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 77 | timer = new Timer(); |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 78 | |
| 79 | type = Type.NON_SERVING; |
| 80 | |
| 81 | linkId = LinkId.valueOf(cell, ue); |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 82 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 83 | quality = new LinkQuality(); |
| 84 | |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 85 | rrmParameters = new RRMConfig(); |
| 86 | RRMConfig.Crnti crnti = new RRMConfig.Crnti(); |
| 87 | crnti.addCRNTI(linkId.getUe().getRanId()); |
| 88 | rrmParameters.setCrnti(crnti); |
| 89 | rrmParameters.setEcgi(linkId.getEcgi()); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | public Timer getTimer() { |
| 93 | return timer; |
| 94 | } |
| 95 | |
| 96 | public void setTimer(Timer timer) { |
| 97 | this.timer.cancel(); |
| 98 | this.timer.purge(); |
| 99 | this.timer = timer; |
| 100 | } |
| 101 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 102 | @JsonProperty("Link-ID") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 103 | public LinkId getLinkId() { |
| 104 | return linkId; |
| 105 | } |
| 106 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 107 | @JsonProperty("Link-ID") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 108 | public void setLinkId(LinkId linkId) { |
| 109 | this.linkId = linkId; |
| 110 | } |
| 111 | |
| 112 | public void setLinkId(RnibCell cell, RnibUe ue) { |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 113 | this.linkId = LinkId.valueOf(cell, ue); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 114 | trafficPercent.setEcgi(cell.getEcgi()); |
| 115 | } |
| 116 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 117 | @JsonProperty("Type") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 118 | public Type getType() { |
| 119 | return type; |
| 120 | } |
| 121 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 122 | @JsonProperty("Type") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 123 | public void setType(Type type) { |
| 124 | this.type = type; |
| 125 | } |
| 126 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 127 | @JsonProperty("TrafficPercent") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 128 | public TrafficSplitPercentage getTrafficPercent() { |
| 129 | return trafficPercent; |
| 130 | } |
| 131 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 132 | @JsonProperty("TrafficPercent") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 133 | public void setTrafficPercent(TrafficSplitPercentage trafficPercent) { |
| 134 | this.trafficPercent = trafficPercent; |
| 135 | } |
| 136 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 137 | @JsonProperty("BearerParameters") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 138 | public ERABParams getBearerParameters() { |
| 139 | return bearerParameters; |
| 140 | } |
| 141 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 142 | @JsonProperty("BearerParameters") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 143 | public void setBearerParameters(ERABParams bearerParameters) { |
| 144 | this.bearerParameters = bearerParameters; |
| 145 | } |
| 146 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 147 | @JsonProperty("Quality") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 148 | public LinkQuality getQuality() { |
| 149 | return quality; |
| 150 | } |
| 151 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 152 | @JsonProperty("Quality") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 153 | public void setQuality(LinkQuality quality) { |
| 154 | this.quality = quality; |
| 155 | } |
| 156 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 157 | @JsonProperty("RRMConfiguration") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 158 | public RRMConfig getRrmParameters() { |
| 159 | return rrmParameters; |
| 160 | } |
| 161 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 162 | @JsonProperty("RRMConfiguration") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 163 | public void setRrmParameters(RRMConfig rrmParameters) { |
| 164 | this.rrmParameters = rrmParameters; |
| 165 | } |
| 166 | |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 167 | public void modifyRrmParameters(JsonNode rrmConfigNode) { |
| 168 | { |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 169 | JsonNode start_prb_dl = rrmConfigNode.path("start_prb_dl"); |
| 170 | if (!start_prb_dl.isMissingNode()) { |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 171 | RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl(); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 172 | |
| 173 | List<BerInteger> collect = Lists.newArrayList(); |
| 174 | collect.add(new BerInteger(start_prb_dl.asInt())); |
| 175 | startPrbDl.setSeqOf(collect); |
| 176 | |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 177 | rrmParameters.setStartPrbDl(startPrbDl); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 182 | JsonNode end_prb_dl = rrmConfigNode.path("end_prb_dl"); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 183 | if (!end_prb_dl.isMissingNode()) { |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 184 | RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl(); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 185 | |
| 186 | List<BerInteger> collect = Lists.newArrayList(); |
| 187 | collect.add(new BerInteger(end_prb_dl.asInt())); |
| 188 | endPrbDl.setSeqOf(collect); |
| 189 | |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 190 | rrmParameters.setEndPrbDl(endPrbDl); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 195 | JsonNode start_prb_ul = rrmConfigNode.path("start_prb_ul"); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 196 | if (!start_prb_ul.isMissingNode()) { |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 197 | RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl(); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 198 | |
| 199 | List<BerInteger> collect = Lists.newArrayList(); |
| 200 | collect.add(new BerInteger(start_prb_ul.asInt())); |
| 201 | startPrbUl.setSeqOf(collect); |
| 202 | |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 203 | rrmParameters.setStartPrbUl(startPrbUl); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 208 | JsonNode end_prb_ul = rrmConfigNode.path("end_prb_ul"); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 209 | if (!end_prb_ul.isMissingNode()) { |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 210 | RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl(); |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 211 | |
| 212 | List<BerInteger> collect = Lists.newArrayList(); |
| 213 | collect.add(new BerInteger(end_prb_ul.asInt())); |
| 214 | endPrbUl.setSeqOf(collect); |
| 215 | |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 216 | rrmParameters.setEndPrbUl(endPrbUl); |
| 217 | } |
| 218 | } |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 219 | } |
| 220 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 221 | @JsonProperty("PDCP-Throughput") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 222 | public PDCPThroughput getPdcpThroughput() { |
| 223 | return pdcpThroughput; |
| 224 | } |
| 225 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 226 | @JsonProperty("PDCP-Throughput") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 227 | public void setPdcpThroughput(PDCPThroughput pdcpThroughput) { |
| 228 | this.pdcpThroughput = pdcpThroughput; |
| 229 | } |
| 230 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 231 | @JsonProperty("PDCP-Packet-Delay") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 232 | public PDCPPacketDelay getPdcpPackDelay() { |
| 233 | return pdcpPackDelay; |
| 234 | } |
| 235 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 236 | @JsonProperty("PDCP-Packet-Delay") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 237 | public void setPdcpPackDelay(PDCPPacketDelay pdcpPackDelay) { |
| 238 | this.pdcpPackDelay = pdcpPackDelay; |
| 239 | } |
| 240 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 241 | @JsonProperty("Resource-Usage") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 242 | public ResourceUsage getResourceUsage() { |
| 243 | return resourceUsage; |
| 244 | } |
| 245 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 246 | @JsonProperty("Resource-Usage") |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 247 | public void setResourceUsage(ResourceUsage resourceUsage) { |
| 248 | this.resourceUsage = resourceUsage; |
| 249 | } |
| 250 | |
| 251 | @Override |
| 252 | public String toString() { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 253 | return "RnibLink{" + |
| 254 | "linkId=" + linkId + |
| 255 | ", rrmParameters=" + rrmParameters + |
| 256 | ", trafficPercent=" + trafficPercent + |
| 257 | ", bearerParameters=" + bearerParameters + |
| 258 | ", quality=" + quality + |
| 259 | ", pdcpThroughput=" + pdcpThroughput + |
| 260 | ", pdcpPackDelay=" + pdcpPackDelay + |
| 261 | ", resourceUsage=" + resourceUsage + |
| 262 | ", type=" + type + |
| 263 | ", timer=" + timer + |
| 264 | '}'; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | @Override |
| 268 | public boolean equals(Object o) { |
| 269 | if (this == o) return true; |
| 270 | if (o == null || getClass() != o.getClass()) return false; |
| 271 | |
| 272 | RnibLink link = (RnibLink) o; |
| 273 | |
| 274 | return linkId.equals(link.linkId); |
| 275 | } |
| 276 | |
| 277 | @Override |
| 278 | public int hashCode() { |
| 279 | return linkId.hashCode(); |
| 280 | } |
| 281 | |
| 282 | public enum Type { |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 283 | SERVING_PRIMARY("serving/primary") { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 284 | @Override |
| 285 | public String toString() { |
| 286 | return "\"serving/primary\""; |
| 287 | } |
| 288 | }, |
| 289 | // TODO: Add CA/DC |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 290 | SERVING_SECONDARY_CA("serving/secondary/ca") { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 291 | @Override |
| 292 | public String toString() { |
slowr | 89c2ac1 | 2017-08-15 16:20:06 -0700 | [diff] [blame] | 293 | return "\"serving/secondary/ca\""; |
| 294 | } |
| 295 | }, |
| 296 | SERVING_SECONDARY_DC("serving/secondary/dc") { |
| 297 | @Override |
| 298 | public String toString() { |
| 299 | return "\"serving/secondary/dc\""; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 300 | } |
| 301 | }, |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 302 | NON_SERVING("non-serving") { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 303 | @Override |
| 304 | public String toString() { |
| 305 | return "\"non-serving\""; |
| 306 | } |
slowr | 67d05e4 | 2017-08-11 20:37:22 -0700 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | private String name; |
| 310 | |
| 311 | Type(String name) { |
| 312 | this.name = name; |
| 313 | } |
| 314 | |
| 315 | public static Type getEnum(String name) { |
| 316 | Optional<Type> any = Arrays.stream(Type.values()).filter(typeStr -> typeStr.name.equals(name)).findAny(); |
| 317 | if (any.isPresent()) { |
| 318 | return any.get(); |
| 319 | } |
| 320 | throw new IllegalArgumentException("No enum defined for string: " + name); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 321 | } |
| 322 | } |
| 323 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 324 | @JsonPropertyOrder({ |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 325 | "RX", |
| 326 | "CQI", |
| 327 | "MCS" |
| 328 | }) |
| 329 | @JsonIgnoreProperties(ignoreUnknown = true) |
| 330 | public static class LinkQuality { |
| 331 | RX RX = null; |
| 332 | CQI CQI = null; |
| 333 | MCS MCS = null; |
| 334 | |
| 335 | public LinkQuality.RX getRX() { |
| 336 | return RX; |
| 337 | } |
| 338 | |
| 339 | public void setRX(LinkQuality.RX RX) { |
| 340 | this.RX = RX; |
| 341 | } |
| 342 | |
| 343 | public LinkQuality.CQI getCQI() { |
| 344 | return CQI; |
| 345 | } |
| 346 | |
| 347 | public void setCQI(LinkQuality.CQI CQI) { |
| 348 | this.CQI = CQI; |
| 349 | } |
| 350 | |
| 351 | public LinkQuality.MCS getMCS() { |
| 352 | return MCS; |
| 353 | } |
| 354 | |
| 355 | public void setMCS(LinkQuality.MCS MCS) { |
| 356 | this.MCS = MCS; |
| 357 | } |
| 358 | |
| 359 | @JsonPropertyOrder({ |
| 360 | "RSRP", |
| 361 | "RSRQ", |
| 362 | "timesincelastupdate" |
| 363 | }) |
| 364 | @JsonIgnoreProperties(ignoreUnknown = true) |
| 365 | public static class RX { |
| 366 | double RSRP; |
| 367 | double RSRQ; |
| 368 | WallClockTimestamp timesincelastupdate; |
| 369 | |
| 370 | @JsonCreator |
| 371 | public RX(@JsonProperty("RSRP") double RSRP, @JsonProperty("RSRQ") double RSRQ) { |
| 372 | this.RSRP = RSRP; |
| 373 | this.RSRQ = RSRQ; |
| 374 | this.timesincelastupdate = new WallClockTimestamp(); |
| 375 | } |
| 376 | |
| 377 | public double getRSRP() { |
| 378 | return RSRP; |
| 379 | } |
| 380 | |
| 381 | public void setRSRP(double RSRP) { |
| 382 | this.RSRP = RSRP; |
| 383 | } |
| 384 | |
| 385 | public double getRSRQ() { |
| 386 | return RSRQ; |
| 387 | } |
| 388 | |
| 389 | public void setRSRQ(double RSRQ) { |
| 390 | this.RSRQ = RSRQ; |
| 391 | } |
| 392 | |
| 393 | public long getTimesincelastupdate() { |
| 394 | return timesincelastupdate.unixTimestamp(); |
| 395 | } |
| 396 | |
| 397 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 398 | this.timesincelastupdate = timesincelastupdate; |
| 399 | } |
| 400 | |
| 401 | @Override |
| 402 | public String toString() { |
| 403 | return "RX{" + |
| 404 | "RSRP=" + RSRP + |
| 405 | ", RSRQ=" + RSRQ + |
| 406 | ", timesincelastupdate=" + timesincelastupdate + |
| 407 | '}'; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | @JsonPropertyOrder({ |
| 412 | "Hist", |
| 413 | "Mode", |
| 414 | "Mean", |
| 415 | "timesincelastupdate" |
| 416 | }) |
| 417 | @JsonIgnoreProperties(ignoreUnknown = true) |
| 418 | public static class CQI { |
| 419 | RadioRepPerServCell.CqiHist Hist; |
| 420 | double Mode; |
| 421 | double Mean; |
| 422 | WallClockTimestamp timesincelastupdate; |
| 423 | |
| 424 | @JsonCreator |
| 425 | public CQI(@JsonProperty("Hist") RadioRepPerServCell.CqiHist hist, @JsonProperty("Mode") double mode, @JsonProperty("Mean") double mean) { |
| 426 | Hist = hist; |
| 427 | Mode = mode; |
| 428 | Mean = mean; |
| 429 | this.timesincelastupdate = new WallClockTimestamp(); |
| 430 | } |
| 431 | |
| 432 | public RadioRepPerServCell.CqiHist getHist() { |
| 433 | return Hist; |
| 434 | } |
| 435 | |
| 436 | public void setHist(RadioRepPerServCell.CqiHist hist) { |
| 437 | Hist = hist; |
| 438 | } |
| 439 | |
| 440 | public double getMode() { |
| 441 | return Mode; |
| 442 | } |
| 443 | |
| 444 | public void setMode(double mode) { |
| 445 | Mode = mode; |
| 446 | } |
| 447 | |
| 448 | public double getMean() { |
| 449 | return Mean; |
| 450 | } |
| 451 | |
| 452 | public void setMean(double mean) { |
| 453 | Mean = mean; |
| 454 | } |
| 455 | |
| 456 | public long getTimesincelastupdate() { |
| 457 | return timesincelastupdate.unixTimestamp(); |
| 458 | } |
| 459 | |
| 460 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 461 | this.timesincelastupdate = timesincelastupdate; |
| 462 | } |
| 463 | |
| 464 | @Override |
| 465 | public String toString() { |
| 466 | return "CQI{" + |
| 467 | "Hist=" + Hist + |
| 468 | ", Mode=" + Mode + |
| 469 | ", Mean=" + Mean + |
| 470 | ", timesincelastupdate=" + timesincelastupdate + |
| 471 | '}'; |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | @JsonPropertyOrder({ |
| 476 | "dl", |
| 477 | "ul", |
| 478 | "timesincelastupdate" |
| 479 | }) |
| 480 | @JsonIgnoreProperties(ignoreUnknown = true) |
| 481 | public static class MCS { |
| 482 | SchedMeasRepPerServCell.McsDl dl; |
| 483 | SchedMeasRepPerServCell.McsUl ul; |
| 484 | WallClockTimestamp timesincelastupdate; |
| 485 | |
| 486 | @JsonCreator |
| 487 | public MCS(@JsonProperty("dl") SchedMeasRepPerServCell.McsDl dl, @JsonProperty("ul") SchedMeasRepPerServCell.McsUl ul) { |
| 488 | this.dl = dl; |
| 489 | this.ul = ul; |
| 490 | this.timesincelastupdate = new WallClockTimestamp(); |
| 491 | } |
| 492 | |
| 493 | public SchedMeasRepPerServCell.McsDl getDl() { |
| 494 | return dl; |
| 495 | } |
| 496 | |
| 497 | public void setDl(SchedMeasRepPerServCell.McsDl dl) { |
| 498 | this.dl = dl; |
| 499 | } |
| 500 | |
| 501 | public SchedMeasRepPerServCell.McsUl getUl() { |
| 502 | return ul; |
| 503 | } |
| 504 | |
| 505 | public void setUl(SchedMeasRepPerServCell.McsUl ul) { |
| 506 | this.ul = ul; |
| 507 | } |
| 508 | |
| 509 | public long getTimesincelastupdate() { |
| 510 | return timesincelastupdate.unixTimestamp(); |
| 511 | } |
| 512 | |
| 513 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 514 | this.timesincelastupdate = timesincelastupdate; |
| 515 | } |
| 516 | |
| 517 | @Override |
| 518 | public String toString() { |
| 519 | return "MCS{" + |
| 520 | "dl=" + dl + |
| 521 | ", ul=" + ul + |
| 522 | ", timesincelastupdate=" + timesincelastupdate + |
| 523 | '}'; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | } |
| 528 | |
| 529 | @JsonPropertyOrder({ |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 530 | "dl", |
| 531 | "ul" |
| 532 | }) |
| 533 | @JsonIgnoreProperties(ignoreUnknown = true) |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 534 | public static class PDCPThroughput { |
| 535 | WallClockTimestamp timesincelastupdate; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 536 | private PDCPMeasReportPerUe.ThroughputDl dl; |
| 537 | private PDCPMeasReportPerUe.ThroughputUl ul; |
| 538 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 539 | @JsonCreator |
| 540 | public PDCPThroughput(@JsonProperty("dl") PDCPMeasReportPerUe.ThroughputDl dl, @JsonProperty("ul") PDCPMeasReportPerUe.ThroughputUl ul) { |
| 541 | this.dl = dl; |
| 542 | this.ul = ul; |
| 543 | this.timesincelastupdate = new WallClockTimestamp(); |
| 544 | } |
| 545 | |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 546 | public PDCPMeasReportPerUe.ThroughputDl getDl() { |
| 547 | return dl; |
| 548 | } |
| 549 | |
| 550 | public void setDl(PDCPMeasReportPerUe.ThroughputDl dl) { |
| 551 | this.dl = dl; |
| 552 | } |
| 553 | |
| 554 | public PDCPMeasReportPerUe.ThroughputUl getUl() { |
| 555 | return ul; |
| 556 | } |
| 557 | |
| 558 | public void setUl(PDCPMeasReportPerUe.ThroughputUl ul) { |
| 559 | this.ul = ul; |
| 560 | } |
| 561 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 562 | public long getTimesincelastupdate() { |
| 563 | return timesincelastupdate.unixTimestamp(); |
| 564 | } |
| 565 | |
| 566 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 567 | this.timesincelastupdate = timesincelastupdate; |
| 568 | } |
| 569 | |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 570 | @Override |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 571 | public String |
| 572 | toString() { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 573 | return "PDCPThroughput{" + |
| 574 | "dl=" + dl + |
| 575 | ", ul=" + ul + |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 576 | ", timesincelastupdate=" + timesincelastupdate + |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 577 | '}'; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 578 | } |
| 579 | } |
| 580 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 581 | @JsonPropertyOrder({ |
| 582 | "dl", |
| 583 | "ul" |
| 584 | }) |
| 585 | @JsonIgnoreProperties(ignoreUnknown = true) |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 586 | public static class PDCPPacketDelay { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 587 | PDCPMeasReportPerUe.PktDelayDl dl; |
| 588 | PDCPMeasReportPerUe.PktDelayUl ul; |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 589 | WallClockTimestamp timesincelastupdate; |
| 590 | |
| 591 | @JsonCreator |
| 592 | public PDCPPacketDelay(@JsonProperty("dl") PDCPMeasReportPerUe.PktDelayDl dl, @JsonProperty("ul") PDCPMeasReportPerUe.PktDelayUl ul) { |
| 593 | this.dl = dl; |
| 594 | this.ul = ul; |
| 595 | this.timesincelastupdate = new WallClockTimestamp(); |
| 596 | } |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 597 | |
| 598 | public PDCPMeasReportPerUe.PktDelayDl getDl() { |
| 599 | return dl; |
| 600 | } |
| 601 | |
| 602 | public void setDl(PDCPMeasReportPerUe.PktDelayDl dl) { |
| 603 | this.dl = dl; |
| 604 | } |
| 605 | |
| 606 | public PDCPMeasReportPerUe.PktDelayUl getUl() { |
| 607 | return ul; |
| 608 | } |
| 609 | |
| 610 | public void setUl(PDCPMeasReportPerUe.PktDelayUl ul) { |
| 611 | this.ul = ul; |
| 612 | } |
| 613 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 614 | public long getTimesincelastupdate() { |
| 615 | return timesincelastupdate.unixTimestamp(); |
| 616 | } |
| 617 | |
| 618 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 619 | this.timesincelastupdate = timesincelastupdate; |
| 620 | } |
| 621 | |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 622 | @Override |
| 623 | public String toString() { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 624 | return "PDCPPacketDelay{" + |
| 625 | "dl=" + dl + |
| 626 | ", ul=" + ul + |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 627 | ", timesincelastupdate=" + timesincelastupdate + |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 628 | '}'; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 629 | } |
| 630 | } |
| 631 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 632 | @JsonPropertyOrder({ |
| 633 | "dl", |
| 634 | "ul" |
| 635 | }) |
| 636 | @JsonIgnoreProperties(ignoreUnknown = true) |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 637 | public static class ResourceUsage { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 638 | PRBUsage.PrbUsageDl dl; |
| 639 | PRBUsage.PrbUsageUl ul; |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 640 | WallClockTimestamp timesincelastupdate; |
| 641 | |
| 642 | @JsonCreator |
| 643 | public ResourceUsage(@JsonProperty("dl") PRBUsage.PrbUsageDl dl, @JsonProperty("ul") PRBUsage.PrbUsageUl ul) { |
| 644 | this.dl = dl; |
| 645 | this.ul = ul; |
| 646 | this.timesincelastupdate = new WallClockTimestamp(); |
| 647 | } |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 648 | |
| 649 | public PRBUsage.PrbUsageDl getDl() { |
| 650 | return dl; |
| 651 | } |
| 652 | |
| 653 | public void setDl(PRBUsage.PrbUsageDl dl) { |
| 654 | this.dl = dl; |
| 655 | } |
| 656 | |
| 657 | public PRBUsage.PrbUsageUl getUl() { |
| 658 | return ul; |
| 659 | } |
| 660 | |
| 661 | public void setUl(PRBUsage.PrbUsageUl ul) { |
| 662 | this.ul = ul; |
| 663 | } |
| 664 | |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 665 | public long getTimesincelastupdate() { |
| 666 | return timesincelastupdate.unixTimestamp(); |
| 667 | } |
| 668 | |
| 669 | public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) { |
| 670 | this.timesincelastupdate = timesincelastupdate; |
| 671 | } |
| 672 | |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 673 | @Override |
| 674 | public String toString() { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 675 | return "ResourceUsage{" + |
| 676 | "dl=" + dl + |
| 677 | ", ul=" + ul + |
slowr | c153ad9 | 2017-08-16 19:47:52 -0700 | [diff] [blame] | 678 | ", timesincelastupdate=" + timesincelastupdate + |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 679 | '}'; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 680 | } |
| 681 | } |
| 682 | } |