blob: f3d04e7e9b09b0438936fc56f8fbd7bac031eb83 [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001/*
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
17package org.onosproject.xran.entities;
18
slowrc153ad92017-08-16 19:47:52 -070019import com.fasterxml.jackson.annotation.*;
slowr8ddc2b12017-08-14 14:13:38 -070020import com.fasterxml.jackson.databind.JsonNode;
slowr89c2ac12017-08-15 16:20:06 -070021import com.google.common.collect.Lists;
slowrc153ad92017-08-16 19:47:52 -070022import org.onosproject.store.service.WallClockTimestamp;
slowr13fa5b02017-08-08 16:32:31 -070023import org.onosproject.xran.codecs.api.*;
slowrc153ad92017-08-16 19:47:52 -070024import org.onosproject.xran.codecs.ber.types.BerInteger;
slowr13fa5b02017-08-08 16:32:31 -070025import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
26import org.onosproject.xran.codecs.pdu.RRMConfig;
27import org.onosproject.xran.identifiers.LinkId;
slowr13fa5b02017-08-08 16:32:31 -070028
slowr67d05e42017-08-11 20:37:22 -070029import java.util.Arrays;
slowr8ddc2b12017-08-14 14:13:38 -070030import java.util.List;
slowr67d05e42017-08-11 20:37:22 -070031import java.util.Optional;
slowr13fa5b02017-08-08 16:32:31 -070032import java.util.Timer;
33
34/**
35 * Created by dimitris on 7/22/17.
36 */
slowr60d4d102017-08-16 18:33:58 -070037@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)
slowr13fa5b02017-08-08 16:32:31 -070049public class RnibLink {
slowr60d4d102017-08-16 18:33:58 -070050 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -070051 private LinkId linkId;
slowr60d4d102017-08-16 18:33:58 -070052 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -070053 private RRMConfig rrmParameters;
slowr60d4d102017-08-16 18:33:58 -070054 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -070055 private TrafficSplitPercentage trafficPercent;
slowr60d4d102017-08-16 18:33:58 -070056 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -070057 private ERABParams bearerParameters;
slowr60d4d102017-08-16 18:33:58 -070058 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -070059 private LinkQuality quality;
slowr60d4d102017-08-16 18:33:58 -070060 @JsonProperty("PDCP-Throughput")
slowr13fa5b02017-08-08 16:32:31 -070061 private PDCPThroughput pdcpThroughput;
slowr60d4d102017-08-16 18:33:58 -070062 @JsonProperty("PDCP-Packet-Delay")
slowr13fa5b02017-08-08 16:32:31 -070063 private PDCPPacketDelay pdcpPackDelay;
slowr60d4d102017-08-16 18:33:58 -070064 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -070065 private ResourceUsage resourceUsage;
slowr60d4d102017-08-16 18:33:58 -070066 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -070067 private Type type;
slowr60d4d102017-08-16 18:33:58 -070068 @JsonIgnore
slowr13fa5b02017-08-08 16:32:31 -070069 private Timer timer;
70
slowr67d05e42017-08-11 20:37:22 -070071 public RnibLink(RnibCell cell, RnibUe ue) {
slowr13fa5b02017-08-08 16:32:31 -070072 trafficPercent = new TrafficSplitPercentage();
slowr67d05e42017-08-11 20:37:22 -070073 trafficPercent.setEcgi(cell.getEcgi());
slowr13fa5b02017-08-08 16:32:31 -070074 trafficPercent.setTrafficPercentDl(new BerInteger(100));
75 trafficPercent.setTrafficPercentUl(new BerInteger(100));
76
slowr13fa5b02017-08-08 16:32:31 -070077 timer = new Timer();
slowr67d05e42017-08-11 20:37:22 -070078
79 type = Type.NON_SERVING;
80
81 linkId = LinkId.valueOf(cell, ue);
slowr8ddc2b12017-08-14 14:13:38 -070082
slowrc153ad92017-08-16 19:47:52 -070083 quality = new LinkQuality();
84
slowr89c2ac12017-08-15 16:20:06 -070085 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());
slowr13fa5b02017-08-08 16:32:31 -070090 }
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
slowr60d4d102017-08-16 18:33:58 -0700102 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -0700103 public LinkId getLinkId() {
104 return linkId;
105 }
106
slowr60d4d102017-08-16 18:33:58 -0700107 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -0700108 public void setLinkId(LinkId linkId) {
109 this.linkId = linkId;
110 }
111
112 public void setLinkId(RnibCell cell, RnibUe ue) {
slowr67d05e42017-08-11 20:37:22 -0700113 this.linkId = LinkId.valueOf(cell, ue);
slowr13fa5b02017-08-08 16:32:31 -0700114 trafficPercent.setEcgi(cell.getEcgi());
115 }
116
slowr60d4d102017-08-16 18:33:58 -0700117 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -0700118 public Type getType() {
119 return type;
120 }
121
slowr60d4d102017-08-16 18:33:58 -0700122 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -0700123 public void setType(Type type) {
124 this.type = type;
125 }
126
slowr60d4d102017-08-16 18:33:58 -0700127 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -0700128 public TrafficSplitPercentage getTrafficPercent() {
129 return trafficPercent;
130 }
131
slowr60d4d102017-08-16 18:33:58 -0700132 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -0700133 public void setTrafficPercent(TrafficSplitPercentage trafficPercent) {
134 this.trafficPercent = trafficPercent;
135 }
136
slowr60d4d102017-08-16 18:33:58 -0700137 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -0700138 public ERABParams getBearerParameters() {
139 return bearerParameters;
140 }
141
slowr60d4d102017-08-16 18:33:58 -0700142 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -0700143 public void setBearerParameters(ERABParams bearerParameters) {
144 this.bearerParameters = bearerParameters;
145 }
146
slowr60d4d102017-08-16 18:33:58 -0700147 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -0700148 public LinkQuality getQuality() {
149 return quality;
150 }
151
slowr60d4d102017-08-16 18:33:58 -0700152 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -0700153 public void setQuality(LinkQuality quality) {
154 this.quality = quality;
155 }
156
slowr60d4d102017-08-16 18:33:58 -0700157 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -0700158 public RRMConfig getRrmParameters() {
159 return rrmParameters;
160 }
161
slowr60d4d102017-08-16 18:33:58 -0700162 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -0700163 public void setRrmParameters(RRMConfig rrmParameters) {
164 this.rrmParameters = rrmParameters;
165 }
166
slowr8ddc2b12017-08-14 14:13:38 -0700167 public void modifyRrmParameters(JsonNode rrmConfigNode) {
168 {
slowr89c2ac12017-08-15 16:20:06 -0700169 JsonNode start_prb_dl = rrmConfigNode.path("start_prb_dl");
170 if (!start_prb_dl.isMissingNode()) {
slowr8ddc2b12017-08-14 14:13:38 -0700171 RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
slowr89c2ac12017-08-15 16:20:06 -0700172
173 List<BerInteger> collect = Lists.newArrayList();
174 collect.add(new BerInteger(start_prb_dl.asInt()));
175 startPrbDl.setSeqOf(collect);
176
slowr8ddc2b12017-08-14 14:13:38 -0700177 rrmParameters.setStartPrbDl(startPrbDl);
178 }
179 }
180
181 {
slowr60d4d102017-08-16 18:33:58 -0700182 JsonNode end_prb_dl = rrmConfigNode.path("end_prb_dl");
slowr89c2ac12017-08-15 16:20:06 -0700183 if (!end_prb_dl.isMissingNode()) {
slowr8ddc2b12017-08-14 14:13:38 -0700184 RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
slowr89c2ac12017-08-15 16:20:06 -0700185
186 List<BerInteger> collect = Lists.newArrayList();
187 collect.add(new BerInteger(end_prb_dl.asInt()));
188 endPrbDl.setSeqOf(collect);
189
slowr8ddc2b12017-08-14 14:13:38 -0700190 rrmParameters.setEndPrbDl(endPrbDl);
191 }
192 }
193
194 {
slowr60d4d102017-08-16 18:33:58 -0700195 JsonNode start_prb_ul = rrmConfigNode.path("start_prb_ul");
slowr89c2ac12017-08-15 16:20:06 -0700196 if (!start_prb_ul.isMissingNode()) {
slowr8ddc2b12017-08-14 14:13:38 -0700197 RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
slowr89c2ac12017-08-15 16:20:06 -0700198
199 List<BerInteger> collect = Lists.newArrayList();
200 collect.add(new BerInteger(start_prb_ul.asInt()));
201 startPrbUl.setSeqOf(collect);
202
slowr8ddc2b12017-08-14 14:13:38 -0700203 rrmParameters.setStartPrbUl(startPrbUl);
204 }
205 }
206
207 {
slowr60d4d102017-08-16 18:33:58 -0700208 JsonNode end_prb_ul = rrmConfigNode.path("end_prb_ul");
slowr89c2ac12017-08-15 16:20:06 -0700209 if (!end_prb_ul.isMissingNode()) {
slowr8ddc2b12017-08-14 14:13:38 -0700210 RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl();
slowr89c2ac12017-08-15 16:20:06 -0700211
212 List<BerInteger> collect = Lists.newArrayList();
213 collect.add(new BerInteger(end_prb_ul.asInt()));
214 endPrbUl.setSeqOf(collect);
215
slowr8ddc2b12017-08-14 14:13:38 -0700216 rrmParameters.setEndPrbUl(endPrbUl);
217 }
218 }
slowr8ddc2b12017-08-14 14:13:38 -0700219 }
220
slowr60d4d102017-08-16 18:33:58 -0700221 @JsonProperty("PDCP-Throughput")
slowr13fa5b02017-08-08 16:32:31 -0700222 public PDCPThroughput getPdcpThroughput() {
223 return pdcpThroughput;
224 }
225
slowr60d4d102017-08-16 18:33:58 -0700226 @JsonProperty("PDCP-Throughput")
slowr13fa5b02017-08-08 16:32:31 -0700227 public void setPdcpThroughput(PDCPThroughput pdcpThroughput) {
228 this.pdcpThroughput = pdcpThroughput;
229 }
230
slowr60d4d102017-08-16 18:33:58 -0700231 @JsonProperty("PDCP-Packet-Delay")
slowr13fa5b02017-08-08 16:32:31 -0700232 public PDCPPacketDelay getPdcpPackDelay() {
233 return pdcpPackDelay;
234 }
235
slowr60d4d102017-08-16 18:33:58 -0700236 @JsonProperty("PDCP-Packet-Delay")
slowr13fa5b02017-08-08 16:32:31 -0700237 public void setPdcpPackDelay(PDCPPacketDelay pdcpPackDelay) {
238 this.pdcpPackDelay = pdcpPackDelay;
239 }
240
slowr60d4d102017-08-16 18:33:58 -0700241 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -0700242 public ResourceUsage getResourceUsage() {
243 return resourceUsage;
244 }
245
slowr60d4d102017-08-16 18:33:58 -0700246 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -0700247 public void setResourceUsage(ResourceUsage resourceUsage) {
248 this.resourceUsage = resourceUsage;
249 }
250
251 @Override
252 public String toString() {
slowr60d4d102017-08-16 18:33:58 -0700253 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 '}';
slowr13fa5b02017-08-08 16:32:31 -0700265 }
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 {
slowr67d05e42017-08-11 20:37:22 -0700283 SERVING_PRIMARY("serving/primary") {
slowr13fa5b02017-08-08 16:32:31 -0700284 @Override
285 public String toString() {
286 return "\"serving/primary\"";
287 }
288 },
289 // TODO: Add CA/DC
slowr89c2ac12017-08-15 16:20:06 -0700290 SERVING_SECONDARY_CA("serving/secondary/ca") {
slowr13fa5b02017-08-08 16:32:31 -0700291 @Override
292 public String toString() {
slowr89c2ac12017-08-15 16:20:06 -0700293 return "\"serving/secondary/ca\"";
294 }
295 },
296 SERVING_SECONDARY_DC("serving/secondary/dc") {
297 @Override
298 public String toString() {
299 return "\"serving/secondary/dc\"";
slowr13fa5b02017-08-08 16:32:31 -0700300 }
301 },
slowr67d05e42017-08-11 20:37:22 -0700302 NON_SERVING("non-serving") {
slowr13fa5b02017-08-08 16:32:31 -0700303 @Override
304 public String toString() {
305 return "\"non-serving\"";
306 }
slowr67d05e42017-08-11 20:37:22 -0700307 };
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);
slowr13fa5b02017-08-08 16:32:31 -0700321 }
322 }
323
slowr60d4d102017-08-16 18:33:58 -0700324 @JsonPropertyOrder({
slowrc153ad92017-08-16 19:47:52 -0700325 "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() {
slowr7bebd7b2017-08-17 11:46:11 -0700394 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700395 }
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 +
slowr7bebd7b2017-08-17 11:46:11 -0700406 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700407 '}';
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() {
slowr7bebd7b2017-08-17 11:46:11 -0700457 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700458 }
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 +
slowr7bebd7b2017-08-17 11:46:11 -0700470 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700471 '}';
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() {
slowr7bebd7b2017-08-17 11:46:11 -0700510 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700511 }
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 +
slowr7bebd7b2017-08-17 11:46:11 -0700522 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700523 '}';
524 }
525 }
526
527 }
528
529 @JsonPropertyOrder({
slowr60d4d102017-08-16 18:33:58 -0700530 "dl",
531 "ul"
532 })
533 @JsonIgnoreProperties(ignoreUnknown = true)
slowrc153ad92017-08-16 19:47:52 -0700534 public static class PDCPThroughput {
535 WallClockTimestamp timesincelastupdate;
slowr13fa5b02017-08-08 16:32:31 -0700536 private PDCPMeasReportPerUe.ThroughputDl dl;
537 private PDCPMeasReportPerUe.ThroughputUl ul;
538
slowrc153ad92017-08-16 19:47:52 -0700539 @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
slowr13fa5b02017-08-08 16:32:31 -0700546 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
slowrc153ad92017-08-16 19:47:52 -0700562 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700563 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700564 }
565
566 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
567 this.timesincelastupdate = timesincelastupdate;
568 }
569
slowr13fa5b02017-08-08 16:32:31 -0700570 @Override
slowrc153ad92017-08-16 19:47:52 -0700571 public String
572 toString() {
slowr60d4d102017-08-16 18:33:58 -0700573 return "PDCPThroughput{" +
574 "dl=" + dl +
575 ", ul=" + ul +
slowr7bebd7b2017-08-17 11:46:11 -0700576 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -0700577 '}';
slowr13fa5b02017-08-08 16:32:31 -0700578 }
579 }
580
slowr60d4d102017-08-16 18:33:58 -0700581 @JsonPropertyOrder({
582 "dl",
583 "ul"
584 })
585 @JsonIgnoreProperties(ignoreUnknown = true)
slowrc153ad92017-08-16 19:47:52 -0700586 public static class PDCPPacketDelay {
slowr13fa5b02017-08-08 16:32:31 -0700587 PDCPMeasReportPerUe.PktDelayDl dl;
588 PDCPMeasReportPerUe.PktDelayUl ul;
slowrc153ad92017-08-16 19:47:52 -0700589 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 }
slowr13fa5b02017-08-08 16:32:31 -0700597
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
slowrc153ad92017-08-16 19:47:52 -0700614 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700615 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700616 }
617
618 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
619 this.timesincelastupdate = timesincelastupdate;
620 }
621
slowr13fa5b02017-08-08 16:32:31 -0700622 @Override
623 public String toString() {
slowr60d4d102017-08-16 18:33:58 -0700624 return "PDCPPacketDelay{" +
625 "dl=" + dl +
626 ", ul=" + ul +
slowr7bebd7b2017-08-17 11:46:11 -0700627 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -0700628 '}';
slowr13fa5b02017-08-08 16:32:31 -0700629 }
630 }
631
slowr60d4d102017-08-16 18:33:58 -0700632 @JsonPropertyOrder({
633 "dl",
634 "ul"
635 })
636 @JsonIgnoreProperties(ignoreUnknown = true)
slowrc153ad92017-08-16 19:47:52 -0700637 public static class ResourceUsage {
slowr13fa5b02017-08-08 16:32:31 -0700638 PRBUsage.PrbUsageDl dl;
639 PRBUsage.PrbUsageUl ul;
slowrc153ad92017-08-16 19:47:52 -0700640 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 }
slowr13fa5b02017-08-08 16:32:31 -0700648
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
slowrc153ad92017-08-16 19:47:52 -0700665 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700666 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700667 }
668
669 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
670 this.timesincelastupdate = timesincelastupdate;
671 }
672
slowr13fa5b02017-08-08 16:32:31 -0700673 @Override
674 public String toString() {
slowr60d4d102017-08-16 18:33:58 -0700675 return "ResourceUsage{" +
676 "dl=" + dl +
677 ", ul=" + ul +
slowr7bebd7b2017-08-17 11:46:11 -0700678 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -0700679 '}';
slowr13fa5b02017-08-08 16:32:31 -0700680 }
681 }
682}