blob: 4eb18a86b72a06321479411fc131c93e4401e7c9 [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001/*
slowr577f3222017-08-28 10:49:08 -07002 * Copyright 2015-present Open Networking Foundation
slowr13fa5b02017-08-08 16:32:31 -07003 *
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
slowr577f3222017-08-28 10:49:08 -070019import com.fasterxml.jackson.annotation.JsonCreator;
20import com.fasterxml.jackson.annotation.JsonIgnore;
21import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
22import com.fasterxml.jackson.annotation.JsonProperty;
23import com.fasterxml.jackson.annotation.JsonPropertyOrder;
slowr8ddc2b12017-08-14 14:13:38 -070024import com.fasterxml.jackson.databind.JsonNode;
slowr89c2ac12017-08-15 16:20:06 -070025import com.google.common.collect.Lists;
slowrc153ad92017-08-16 19:47:52 -070026import org.onosproject.store.service.WallClockTimestamp;
slowr577f3222017-08-28 10:49:08 -070027import org.onosproject.xran.codecs.api.ERABParams;
28import org.onosproject.xran.codecs.api.RadioRepPerServCell;
29import org.onosproject.xran.codecs.api.TrafficSplitPercentage;
30import org.onosproject.xran.codecs.api.XICICPA;
31import org.onosproject.xran.codecs.api.SchedMeasRepPerServCell;
32import org.onosproject.xran.codecs.api.PRBUsage;
slowr73b4eae2017-08-17 16:09:09 -070033import org.onosproject.xran.codecs.ber.types.BerBitString;
slowrc153ad92017-08-16 19:47:52 -070034import org.onosproject.xran.codecs.ber.types.BerInteger;
slowr13fa5b02017-08-08 16:32:31 -070035import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
36import org.onosproject.xran.codecs.pdu.RRMConfig;
37import org.onosproject.xran.identifiers.LinkId;
slowr73b4eae2017-08-17 16:09:09 -070038import org.slf4j.Logger;
39import org.slf4j.LoggerFactory;
slowr13fa5b02017-08-08 16:32:31 -070040
slowr73b4eae2017-08-17 16:09:09 -070041import javax.xml.bind.DatatypeConverter;
slowr67d05e42017-08-11 20:37:22 -070042import java.util.Arrays;
slowr8ddc2b12017-08-14 14:13:38 -070043import java.util.List;
slowr67d05e42017-08-11 20:37:22 -070044import java.util.Optional;
slowr13fa5b02017-08-08 16:32:31 -070045import java.util.Timer;
46
47/**
slowr577f3222017-08-28 10:49:08 -070048 * R-NIB Link and its properties.
slowr13fa5b02017-08-08 16:32:31 -070049 */
slowr60d4d102017-08-16 18:33:58 -070050@JsonPropertyOrder({
51 "Link-ID",
52 "Type",
53 "RRMConfiguration",
54 "TrafficPercent",
55 "BearerParameters",
56 "Quality",
57 "PDCP-Throughput",
58 "PDCP-Packet-Delay",
59 "Resource-Usage"
60})
61@JsonIgnoreProperties(ignoreUnknown = true)
slowr13fa5b02017-08-08 16:32:31 -070062public class RnibLink {
slowr73b4eae2017-08-17 16:09:09 -070063 @JsonIgnore
64 private static final Logger log =
65 LoggerFactory.getLogger(RnibLink.class);
66
slowr60d4d102017-08-16 18:33:58 -070067 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -070068 private LinkId linkId;
slowr60d4d102017-08-16 18:33:58 -070069 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -070070 private RRMConfig rrmParameters;
slowr60d4d102017-08-16 18:33:58 -070071 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -070072 private TrafficSplitPercentage trafficPercent;
slowr60d4d102017-08-16 18:33:58 -070073 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -070074 private ERABParams bearerParameters;
slowr60d4d102017-08-16 18:33:58 -070075 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -070076 private LinkQuality quality;
slowr60d4d102017-08-16 18:33:58 -070077 @JsonProperty("PDCP-Throughput")
slowr577f3222017-08-28 10:49:08 -070078 private PdcpThroughput pdcpThroughput;
slowr60d4d102017-08-16 18:33:58 -070079 @JsonProperty("PDCP-Packet-Delay")
slowr577f3222017-08-28 10:49:08 -070080 private PdcpPacketdelay pdcpPackDelay;
slowr60d4d102017-08-16 18:33:58 -070081 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -070082 private ResourceUsage resourceUsage;
slowr60d4d102017-08-16 18:33:58 -070083 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -070084 private Type type;
slowr60d4d102017-08-16 18:33:58 -070085 @JsonIgnore
slowr13fa5b02017-08-08 16:32:31 -070086 private Timer timer;
87
slowr67d05e42017-08-11 20:37:22 -070088 public RnibLink(RnibCell cell, RnibUe ue) {
slowr13fa5b02017-08-08 16:32:31 -070089 trafficPercent = new TrafficSplitPercentage();
slowr67d05e42017-08-11 20:37:22 -070090 trafficPercent.setEcgi(cell.getEcgi());
slowr13fa5b02017-08-08 16:32:31 -070091 trafficPercent.setTrafficPercentDl(new BerInteger(100));
92 trafficPercent.setTrafficPercentUl(new BerInteger(100));
93
slowr13fa5b02017-08-08 16:32:31 -070094 timer = new Timer();
slowr67d05e42017-08-11 20:37:22 -070095
96 type = Type.NON_SERVING;
97
98 linkId = LinkId.valueOf(cell, ue);
slowr8ddc2b12017-08-14 14:13:38 -070099
slowrc153ad92017-08-16 19:47:52 -0700100 quality = new LinkQuality();
101
slowr89c2ac12017-08-15 16:20:06 -0700102 rrmParameters = new RRMConfig();
103 RRMConfig.Crnti crnti = new RRMConfig.Crnti();
slowrc86750e2017-08-22 17:26:47 -0700104 crnti.addCRNTI(linkId.getUe().getCrnti());
slowr89c2ac12017-08-15 16:20:06 -0700105 rrmParameters.setCrnti(crnti);
106 rrmParameters.setEcgi(linkId.getEcgi());
slowr13fa5b02017-08-08 16:32:31 -0700107 }
108
slowr577f3222017-08-28 10:49:08 -0700109 /**
110 * Get timer.
111 *
112 * @return Timer
113 */
slowr13fa5b02017-08-08 16:32:31 -0700114 public Timer getTimer() {
115 return timer;
116 }
117
118 public void setTimer(Timer timer) {
119 this.timer.cancel();
120 this.timer.purge();
121 this.timer = timer;
122 }
123
slowr577f3222017-08-28 10:49:08 -0700124 /**
125 * Get Link ID.
126 * @return LinkID
127 */
slowr60d4d102017-08-16 18:33:58 -0700128 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -0700129 public LinkId getLinkId() {
130 return linkId;
131 }
132
slowr577f3222017-08-28 10:49:08 -0700133 /**
134 * Set the Link ID.
135 * @param linkId Link ID
136 */
slowr60d4d102017-08-16 18:33:58 -0700137 @JsonProperty("Link-ID")
slowr13fa5b02017-08-08 16:32:31 -0700138 public void setLinkId(LinkId linkId) {
139 this.linkId = linkId;
140 }
141
slowr577f3222017-08-28 10:49:08 -0700142 /**
143 * Set the LINK ID with cell and ue.
144 * @param cell Rnib CELL
145 * @param ue Rnib UE
146 */
slowr13fa5b02017-08-08 16:32:31 -0700147 public void setLinkId(RnibCell cell, RnibUe ue) {
slowr67d05e42017-08-11 20:37:22 -0700148 this.linkId = LinkId.valueOf(cell, ue);
slowr13fa5b02017-08-08 16:32:31 -0700149 trafficPercent.setEcgi(cell.getEcgi());
150 }
151
slowr577f3222017-08-28 10:49:08 -0700152 /**
153 * Get the link type.
154 *
155 * @return Link-type
156 */
slowr60d4d102017-08-16 18:33:58 -0700157 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -0700158 public Type getType() {
159 return type;
160 }
161
slowr577f3222017-08-28 10:49:08 -0700162 /**
163 * Set the link type.
164 * @param type Link-type
165 */
slowr60d4d102017-08-16 18:33:58 -0700166 @JsonProperty("Type")
slowr13fa5b02017-08-08 16:32:31 -0700167 public void setType(Type type) {
168 this.type = type;
169 }
170
slowr577f3222017-08-28 10:49:08 -0700171 /**
172 * Get traffic percent.
173 * @return TrafficSplitPercentage
174 */
slowr60d4d102017-08-16 18:33:58 -0700175 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -0700176 public TrafficSplitPercentage getTrafficPercent() {
177 return trafficPercent;
178 }
179
slowr577f3222017-08-28 10:49:08 -0700180 /**
181 * Set traffic percent.
182 * @param trafficPercent TrafficSplitPercentage
183 */
slowr60d4d102017-08-16 18:33:58 -0700184 @JsonProperty("TrafficPercent")
slowr13fa5b02017-08-08 16:32:31 -0700185 public void setTrafficPercent(TrafficSplitPercentage trafficPercent) {
186 this.trafficPercent = trafficPercent;
187 }
188
slowr577f3222017-08-28 10:49:08 -0700189 /**
190 * Get the Bearer Parameters.
191 * @return ERABParams
192 */
slowr60d4d102017-08-16 18:33:58 -0700193 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -0700194 public ERABParams getBearerParameters() {
195 return bearerParameters;
196 }
197
slowr577f3222017-08-28 10:49:08 -0700198 /**
199 * Set the Bearer Parameters.
200 * @param bearerParameters ERABParams
201 */
slowr60d4d102017-08-16 18:33:58 -0700202 @JsonProperty("BearerParameters")
slowr13fa5b02017-08-08 16:32:31 -0700203 public void setBearerParameters(ERABParams bearerParameters) {
204 this.bearerParameters = bearerParameters;
205 }
206
slowr577f3222017-08-28 10:49:08 -0700207 /**
208 * Get Quality.
209 * @return LinkQuality
210 */
slowr60d4d102017-08-16 18:33:58 -0700211 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -0700212 public LinkQuality getQuality() {
213 return quality;
214 }
215
slowr577f3222017-08-28 10:49:08 -0700216 /**
217 * Set Quality.
218 * @param quality LinkQuality
219 */
slowr60d4d102017-08-16 18:33:58 -0700220 @JsonProperty("Quality")
slowr13fa5b02017-08-08 16:32:31 -0700221 public void setQuality(LinkQuality quality) {
222 this.quality = quality;
223 }
224
slowr577f3222017-08-28 10:49:08 -0700225 /**
226 * Get RRM Configuration.
227 * @return RRMConfig
228 */
slowr60d4d102017-08-16 18:33:58 -0700229 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -0700230 public RRMConfig getRrmParameters() {
231 return rrmParameters;
232 }
233
slowr577f3222017-08-28 10:49:08 -0700234 /**
235 * Set RRM Configuration.
236 * @param rrmParameters RRMConfig
237 */
slowr60d4d102017-08-16 18:33:58 -0700238 @JsonProperty("RRMConfiguration")
slowr13fa5b02017-08-08 16:32:31 -0700239 public void setRrmParameters(RRMConfig rrmParameters) {
240 this.rrmParameters = rrmParameters;
241 }
242
slowr577f3222017-08-28 10:49:08 -0700243 /**
244 * Modify the RRM Config parameters of link.
245 *
246 * @param rrmConfigNode RRMConfig parameters to modify obtained from REST call
247 */
slowr8ddc2b12017-08-14 14:13:38 -0700248 public void modifyRrmParameters(JsonNode rrmConfigNode) {
slowr73b4eae2017-08-17 16:09:09 -0700249
slowr577f3222017-08-28 10:49:08 -0700250 JsonNode pA = rrmConfigNode.path("p_a");
251 if (!pA.isMissingNode()) {
252 RRMConfig.Pa pa = new RRMConfig.Pa();
253
254 List<XICICPA> collect = Lists.newArrayList();
255 collect.add(new XICICPA(pA.asInt()));
256 pa.setXICICPA(collect);
257 rrmParameters.setPa(pa);
slowr73b4eae2017-08-17 16:09:09 -0700258 }
259
slowr577f3222017-08-28 10:49:08 -0700260 JsonNode startPrbDl1 = rrmConfigNode.path("start_prb_dl");
261 if (!startPrbDl1.isMissingNode()) {
262 RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
slowr89c2ac12017-08-15 16:20:06 -0700263
slowr577f3222017-08-28 10:49:08 -0700264 List<BerInteger> collect = Lists.newArrayList();
265 collect.add(new BerInteger(startPrbDl1.asInt()));
266 startPrbDl.setSeqOf(collect);
slowr89c2ac12017-08-15 16:20:06 -0700267
slowr577f3222017-08-28 10:49:08 -0700268 rrmParameters.setStartPrbDl(startPrbDl);
slowr8ddc2b12017-08-14 14:13:38 -0700269 }
270
slowr577f3222017-08-28 10:49:08 -0700271 JsonNode endPrbDl1 = rrmConfigNode.path("end_prb_dl");
272 if (!endPrbDl1.isMissingNode()) {
273 RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
slowr89c2ac12017-08-15 16:20:06 -0700274
slowr577f3222017-08-28 10:49:08 -0700275 List<BerInteger> collect = Lists.newArrayList();
276 collect.add(new BerInteger(endPrbDl1.asInt()));
277 endPrbDl.setSeqOf(collect);
slowr89c2ac12017-08-15 16:20:06 -0700278
slowr577f3222017-08-28 10:49:08 -0700279 rrmParameters.setEndPrbDl(endPrbDl);
slowr8ddc2b12017-08-14 14:13:38 -0700280 }
281
slowr577f3222017-08-28 10:49:08 -0700282 JsonNode subFrameBitmaskDl = rrmConfigNode.path("sub_frame_bitmask_dl");
283 if (!subFrameBitmaskDl.isMissingNode()) {
284 RRMConfig.SubframeBitmaskDl subframeBitmaskDl = new RRMConfig.SubframeBitmaskDl();
285 List<BerBitString> collect = Lists.newArrayList();
286
287 byte[] hexString = DatatypeConverter.parseHexBinary(subFrameBitmaskDl.asText());
288 collect.add(new BerBitString(hexString, 10));
289 subframeBitmaskDl.setSeqOf(collect);
290 rrmParameters.setSubframeBitmaskDl(subframeBitmaskDl);
slowr73b4eae2017-08-17 16:09:09 -0700291 }
292
slowr577f3222017-08-28 10:49:08 -0700293 JsonNode startPrbUl1 = rrmConfigNode.path("start_prb_ul");
294 if (!startPrbUl1.isMissingNode()) {
295 RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
slowr89c2ac12017-08-15 16:20:06 -0700296
slowr577f3222017-08-28 10:49:08 -0700297 List<BerInteger> collect = Lists.newArrayList();
298 collect.add(new BerInteger(startPrbUl1.asInt()));
299 startPrbUl.setSeqOf(collect);
slowr89c2ac12017-08-15 16:20:06 -0700300
slowr577f3222017-08-28 10:49:08 -0700301 rrmParameters.setStartPrbUl(startPrbUl);
slowr8ddc2b12017-08-14 14:13:38 -0700302 }
303
slowr577f3222017-08-28 10:49:08 -0700304 JsonNode endPrbUl1 = rrmConfigNode.path("end_prb_ul");
305 if (!endPrbUl1.isMissingNode()) {
306 RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl();
slowr89c2ac12017-08-15 16:20:06 -0700307
slowr577f3222017-08-28 10:49:08 -0700308 List<BerInteger> collect = Lists.newArrayList();
309 collect.add(new BerInteger(endPrbUl1.asInt()));
310 endPrbUl.setSeqOf(collect);
slowr89c2ac12017-08-15 16:20:06 -0700311
slowr577f3222017-08-28 10:49:08 -0700312 rrmParameters.setEndPrbUl(endPrbUl);
slowr8ddc2b12017-08-14 14:13:38 -0700313 }
slowr73b4eae2017-08-17 16:09:09 -0700314
slowr73b4eae2017-08-17 16:09:09 -0700315
slowr577f3222017-08-28 10:49:08 -0700316 JsonNode p0UePusch1 = rrmConfigNode.path("p0_ue_pusch");
317 if (!p0UePusch1.isMissingNode()) {
318 RRMConfig.P0UePusch p0UePusch = new RRMConfig.P0UePusch();
slowr73b4eae2017-08-17 16:09:09 -0700319
slowr577f3222017-08-28 10:49:08 -0700320 List<BerInteger> collect = Lists.newArrayList();
321 collect.add(new BerInteger(p0UePusch1.asInt()));
322 p0UePusch.setSeqOf(collect);
323
324 rrmParameters.setP0UePusch(p0UePusch);
slowr73b4eae2017-08-17 16:09:09 -0700325 }
326
slowr577f3222017-08-28 10:49:08 -0700327 JsonNode subFrameBitmaskUl = rrmConfigNode.path("sub_frame_bitmask_ul");
328 if (!subFrameBitmaskUl.isMissingNode()) {
329 RRMConfig.SubframeBitmaskUl subframeBitmaskUl = new RRMConfig.SubframeBitmaskUl();
330 List<BerBitString> collect = Lists.newArrayList();
slowr73b4eae2017-08-17 16:09:09 -0700331
slowr577f3222017-08-28 10:49:08 -0700332 byte[] hexString = DatatypeConverter.parseHexBinary(subFrameBitmaskUl.asText());
333 collect.add(new BerBitString(hexString, 10));
334 subframeBitmaskUl.setSeqOf(collect);
335 rrmParameters.setSubframeBitmaskUl(subframeBitmaskUl);
slowr73b4eae2017-08-17 16:09:09 -0700336 }
slowr8ddc2b12017-08-14 14:13:38 -0700337 }
338
slowr577f3222017-08-28 10:49:08 -0700339 /**
340 * Get PDCP Throughput.
341 * @return PdcpThroughput
342 */
slowr60d4d102017-08-16 18:33:58 -0700343 @JsonProperty("PDCP-Throughput")
slowr577f3222017-08-28 10:49:08 -0700344 public PdcpThroughput getPdcpThroughput() {
slowr13fa5b02017-08-08 16:32:31 -0700345 return pdcpThroughput;
346 }
347
slowr577f3222017-08-28 10:49:08 -0700348 /**
349 * Set PDCP Throughput.
350 * @param pdcpThroughput PdcpThroughput
351 */
slowr60d4d102017-08-16 18:33:58 -0700352 @JsonProperty("PDCP-Throughput")
slowr577f3222017-08-28 10:49:08 -0700353 public void setPdcpThroughput(PdcpThroughput pdcpThroughput) {
slowr13fa5b02017-08-08 16:32:31 -0700354 this.pdcpThroughput = pdcpThroughput;
355 }
356
slowr577f3222017-08-28 10:49:08 -0700357 /**
358 * Get PdcpPackDelay.
359 * @return PdcpPacketdelay
360 */
slowr60d4d102017-08-16 18:33:58 -0700361 @JsonProperty("PDCP-Packet-Delay")
slowr577f3222017-08-28 10:49:08 -0700362 public PdcpPacketdelay getPdcpPackDelay() {
slowr13fa5b02017-08-08 16:32:31 -0700363 return pdcpPackDelay;
364 }
365
slowr577f3222017-08-28 10:49:08 -0700366 /**
367 * Set PdcpPackDelay.
368 * @param pdcpPackDelay PdcpPacketdelay
369 */
slowr60d4d102017-08-16 18:33:58 -0700370 @JsonProperty("PDCP-Packet-Delay")
slowr577f3222017-08-28 10:49:08 -0700371 public void setPdcpPackDelay(PdcpPacketdelay pdcpPackDelay) {
slowr13fa5b02017-08-08 16:32:31 -0700372 this.pdcpPackDelay = pdcpPackDelay;
373 }
374
slowr577f3222017-08-28 10:49:08 -0700375 /**
376 * Get ResourceUsage.
377 * @return ResourceUsage
378 */
slowr60d4d102017-08-16 18:33:58 -0700379 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -0700380 public ResourceUsage getResourceUsage() {
381 return resourceUsage;
382 }
383
slowr577f3222017-08-28 10:49:08 -0700384 /**
385 * Set ResourceUsage.
386 * @param resourceUsage ResourceUsage
387 */
slowr60d4d102017-08-16 18:33:58 -0700388 @JsonProperty("Resource-Usage")
slowr13fa5b02017-08-08 16:32:31 -0700389 public void setResourceUsage(ResourceUsage resourceUsage) {
390 this.resourceUsage = resourceUsage;
391 }
392
393 @Override
394 public String toString() {
slowr60d4d102017-08-16 18:33:58 -0700395 return "RnibLink{" +
396 "linkId=" + linkId +
397 ", rrmParameters=" + rrmParameters +
398 ", trafficPercent=" + trafficPercent +
399 ", bearerParameters=" + bearerParameters +
400 ", quality=" + quality +
401 ", pdcpThroughput=" + pdcpThroughput +
402 ", pdcpPackDelay=" + pdcpPackDelay +
403 ", resourceUsage=" + resourceUsage +
404 ", type=" + type +
405 ", timer=" + timer +
406 '}';
slowr13fa5b02017-08-08 16:32:31 -0700407 }
408
409 @Override
410 public boolean equals(Object o) {
slowr577f3222017-08-28 10:49:08 -0700411 if (this == o) {
412 return true;
413 }
414 if (o == null || getClass() != o.getClass()) {
415 return false;
416 }
slowr13fa5b02017-08-08 16:32:31 -0700417
418 RnibLink link = (RnibLink) o;
419
420 return linkId.equals(link.linkId);
421 }
422
423 @Override
424 public int hashCode() {
425 return linkId.hashCode();
426 }
427
slowr577f3222017-08-28 10:49:08 -0700428 /**
429 * Enum of Link-Type.
430 */
slowr13fa5b02017-08-08 16:32:31 -0700431 public enum Type {
slowr67d05e42017-08-11 20:37:22 -0700432 SERVING_PRIMARY("serving/primary") {
slowr13fa5b02017-08-08 16:32:31 -0700433 @Override
434 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700435 return "serving/primary";
slowr13fa5b02017-08-08 16:32:31 -0700436 }
437 },
slowr89c2ac12017-08-15 16:20:06 -0700438 SERVING_SECONDARY_CA("serving/secondary/ca") {
slowr13fa5b02017-08-08 16:32:31 -0700439 @Override
440 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700441 return "serving/secondary/ca";
slowr89c2ac12017-08-15 16:20:06 -0700442 }
443 },
444 SERVING_SECONDARY_DC("serving/secondary/dc") {
445 @Override
446 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700447 return "serving/secondary/dc";
slowr13fa5b02017-08-08 16:32:31 -0700448 }
449 },
slowr67d05e42017-08-11 20:37:22 -0700450 NON_SERVING("non-serving") {
slowr13fa5b02017-08-08 16:32:31 -0700451 @Override
452 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700453 return "non-serving";
slowr13fa5b02017-08-08 16:32:31 -0700454 }
slowr67d05e42017-08-11 20:37:22 -0700455 };
456
457 private String name;
458
459 Type(String name) {
460 this.name = name;
461 }
462
slowr577f3222017-08-28 10:49:08 -0700463 /**
464 * Get enum value of link-type.
465 * @param name String representation of Enum Type
466 * @return Type
467 */
slowr67d05e42017-08-11 20:37:22 -0700468 public static Type getEnum(String name) {
469 Optional<Type> any = Arrays.stream(Type.values()).filter(typeStr -> typeStr.name.equals(name)).findAny();
470 if (any.isPresent()) {
471 return any.get();
472 }
473 throw new IllegalArgumentException("No enum defined for string: " + name);
slowr13fa5b02017-08-08 16:32:31 -0700474 }
475 }
476
slowr577f3222017-08-28 10:49:08 -0700477 /**
478 * Quality of Link.
479 */
slowr60d4d102017-08-16 18:33:58 -0700480 @JsonPropertyOrder({
slowr577f3222017-08-28 10:49:08 -0700481 "rx",
482 "cqi",
483 "mcs"
slowrc153ad92017-08-16 19:47:52 -0700484 })
485 @JsonIgnoreProperties(ignoreUnknown = true)
486 public static class LinkQuality {
slowr577f3222017-08-28 10:49:08 -0700487 Rx rx = null;
488 Cqi cqi = null;
489 Mcs mcs = null;
slowrc153ad92017-08-16 19:47:52 -0700490
slowr577f3222017-08-28 10:49:08 -0700491 /**
492 * Get rx.
493 * @return rx
494 */
495 public Rx getRx() {
496 return rx;
slowrc153ad92017-08-16 19:47:52 -0700497 }
498
slowr577f3222017-08-28 10:49:08 -0700499 /**
500 * Set rx.
501 * @param rx rx
502 */
503 public void setRx(Rx rx) {
504 this.rx = rx;
slowrc153ad92017-08-16 19:47:52 -0700505 }
506
slowr577f3222017-08-28 10:49:08 -0700507 /**
508 * Get cqi.
509 * @return cqi
510 */
511 public Cqi getCqi() {
512 return cqi;
slowrc153ad92017-08-16 19:47:52 -0700513 }
514
slowr577f3222017-08-28 10:49:08 -0700515 /**
516 * Set cqi.
517 * @param cqi cqi
518 */
519 public void setCqi(Cqi cqi) {
520 this.cqi = cqi;
slowrc153ad92017-08-16 19:47:52 -0700521 }
522
slowr577f3222017-08-28 10:49:08 -0700523 /**
524 * Get mcs.
525 * @return mcs
526 */
527 public Mcs getMcs() {
528 return mcs;
slowrc153ad92017-08-16 19:47:52 -0700529 }
530
slowr577f3222017-08-28 10:49:08 -0700531 /**
532 * Set mcs.
533 * @param mcs mcs
534 */
535 public void setMcs(Mcs mcs) {
536 this.mcs = mcs;
slowrc153ad92017-08-16 19:47:52 -0700537 }
538
slowr577f3222017-08-28 10:49:08 -0700539 /**
540 * Class to represent rx.
541 */
slowrc153ad92017-08-16 19:47:52 -0700542 @JsonPropertyOrder({
slowr577f3222017-08-28 10:49:08 -0700543 "rsrp",
544 "rsrq",
slowrc153ad92017-08-16 19:47:52 -0700545 "timesincelastupdate"
546 })
547 @JsonIgnoreProperties(ignoreUnknown = true)
slowr577f3222017-08-28 10:49:08 -0700548 public static class Rx {
549 double rsrp;
550 double rsrq;
slowrc153ad92017-08-16 19:47:52 -0700551 WallClockTimestamp timesincelastupdate;
552
553 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700554 public Rx(@JsonProperty("rsrp") double rsrp, @JsonProperty("rsrq") double rsrq) {
555 this.rsrp = rsrp;
556 this.rsrq = rsrq;
slowrc153ad92017-08-16 19:47:52 -0700557 this.timesincelastupdate = new WallClockTimestamp();
558 }
559
slowr577f3222017-08-28 10:49:08 -0700560 /**
561 * Get rsrp.
562 * @return double rsrp
563 */
564 public double getRsrp() {
565 return rsrp;
slowrc153ad92017-08-16 19:47:52 -0700566 }
567
slowr577f3222017-08-28 10:49:08 -0700568 /**
569 * Set rsrp.
570 * @param rsrp rsrp
571 */
572 public void setRsrp(double rsrp) {
573 this.rsrp = rsrp;
slowrc153ad92017-08-16 19:47:52 -0700574 }
575
slowr577f3222017-08-28 10:49:08 -0700576 /**
577 * Get rsrq.
578 * @return double rsrq
579 */
580 public double getRsrq() {
581 return rsrq;
slowrc153ad92017-08-16 19:47:52 -0700582 }
583
slowr577f3222017-08-28 10:49:08 -0700584 /**
585 * Set rsrq.
586 * @param rsrq rsrq
587 */
588 public void setRsrq(double rsrq) {
589 this.rsrq = rsrq;
slowrc153ad92017-08-16 19:47:52 -0700590 }
591
slowr577f3222017-08-28 10:49:08 -0700592 /**
593 * Get time since last update.
594 *
595 * @return long Time
596 */
slowrc153ad92017-08-16 19:47:52 -0700597 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700598 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700599 }
600
slowr577f3222017-08-28 10:49:08 -0700601 /**
602 * Set time since last update.
603 *
604 * @param timesincelastupdate time since last update
605 */
slowrc153ad92017-08-16 19:47:52 -0700606 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
607 this.timesincelastupdate = timesincelastupdate;
608 }
609
610 @Override
611 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700612 return "rx{" +
613 "rsrp=" + rsrp +
614 ", rsrq=" + rsrq +
615 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
616 timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700617 '}';
618 }
619 }
620
621 @JsonPropertyOrder({
slowr577f3222017-08-28 10:49:08 -0700622 "hist",
623 "mode",
624 "mean",
slowrc153ad92017-08-16 19:47:52 -0700625 "timesincelastupdate"
626 })
627 @JsonIgnoreProperties(ignoreUnknown = true)
slowr577f3222017-08-28 10:49:08 -0700628 public static class Cqi {
629 RadioRepPerServCell.CqiHist hist;
630 double mode;
631 double mean;
slowrc153ad92017-08-16 19:47:52 -0700632 WallClockTimestamp timesincelastupdate;
633
634 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700635 public Cqi(@JsonProperty("hist") RadioRepPerServCell.CqiHist hist, @JsonProperty("mode") double mode,
636 @JsonProperty("mean") double mean) {
637 this.hist = hist;
638 this.mode = mode;
639 this.mean = mean;
slowrc153ad92017-08-16 19:47:52 -0700640 this.timesincelastupdate = new WallClockTimestamp();
641 }
642
slowr577f3222017-08-28 10:49:08 -0700643
644 /**
645 * Get CQIHist.
646 * @return CqiHist
647 */
slowrc153ad92017-08-16 19:47:52 -0700648 public RadioRepPerServCell.CqiHist getHist() {
slowr577f3222017-08-28 10:49:08 -0700649 return hist;
slowrc153ad92017-08-16 19:47:52 -0700650 }
651
slowr577f3222017-08-28 10:49:08 -0700652 /**
653 * Get CQIHist.
654 * @param hist CqiHist
655 */
slowrc153ad92017-08-16 19:47:52 -0700656 public void setHist(RadioRepPerServCell.CqiHist hist) {
slowr577f3222017-08-28 10:49:08 -0700657 this.hist = hist;
slowrc153ad92017-08-16 19:47:52 -0700658 }
659
slowr577f3222017-08-28 10:49:08 -0700660 /**
661 * Get mode.
662 * @return double mode
663 */
slowrc153ad92017-08-16 19:47:52 -0700664 public double getMode() {
slowr577f3222017-08-28 10:49:08 -0700665 return mode;
slowrc153ad92017-08-16 19:47:52 -0700666 }
667
slowr577f3222017-08-28 10:49:08 -0700668 /**
669 * Set mode.
670 * @param mode mode
671 */
slowrc153ad92017-08-16 19:47:52 -0700672 public void setMode(double mode) {
slowr577f3222017-08-28 10:49:08 -0700673 this.mode = mode;
slowrc153ad92017-08-16 19:47:52 -0700674 }
675
slowr577f3222017-08-28 10:49:08 -0700676 /**
677 * Get mean.
678 * @return double mean
679 */
slowrc153ad92017-08-16 19:47:52 -0700680 public double getMean() {
slowr577f3222017-08-28 10:49:08 -0700681 return mean;
slowrc153ad92017-08-16 19:47:52 -0700682 }
683
slowr577f3222017-08-28 10:49:08 -0700684 /**
685 * Set mean.
686 * @param mean mean
687 */
slowrc153ad92017-08-16 19:47:52 -0700688 public void setMean(double mean) {
slowr577f3222017-08-28 10:49:08 -0700689 this.mean = mean;
slowrc153ad92017-08-16 19:47:52 -0700690 }
691
slowr577f3222017-08-28 10:49:08 -0700692 /**
693 * Get time since last update.
694 *
695 * @return long Time
696 */
slowrc153ad92017-08-16 19:47:52 -0700697 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700698 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700699 }
700
slowr577f3222017-08-28 10:49:08 -0700701 /**
702 * Set time since last update.
703 *
704 * @param timesincelastupdate time since last update
705 */
slowrc153ad92017-08-16 19:47:52 -0700706 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
707 this.timesincelastupdate = timesincelastupdate;
708 }
709
710 @Override
711 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700712 return "cqi{" +
713 "hist=" + hist +
714 ", mode=" + mode +
715 ", mean=" + mean +
716 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
717 timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700718 '}';
719 }
720 }
721
722 @JsonPropertyOrder({
723 "dl",
724 "ul",
725 "timesincelastupdate"
726 })
727 @JsonIgnoreProperties(ignoreUnknown = true)
slowr577f3222017-08-28 10:49:08 -0700728 public static class Mcs {
slowrc153ad92017-08-16 19:47:52 -0700729 SchedMeasRepPerServCell.McsDl dl;
730 SchedMeasRepPerServCell.McsUl ul;
731 WallClockTimestamp timesincelastupdate;
732
733 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700734 public Mcs(@JsonProperty("dl") SchedMeasRepPerServCell.McsDl dl,
735 @JsonProperty("ul") SchedMeasRepPerServCell.McsUl ul) {
slowrc153ad92017-08-16 19:47:52 -0700736 this.dl = dl;
737 this.ul = ul;
738 this.timesincelastupdate = new WallClockTimestamp();
739 }
740
slowr577f3222017-08-28 10:49:08 -0700741 /**
742 * Get DL.
743 * @return Dl
744 */
slowrc153ad92017-08-16 19:47:52 -0700745 public SchedMeasRepPerServCell.McsDl getDl() {
746 return dl;
747 }
748
slowr577f3222017-08-28 10:49:08 -0700749 /**
750 * Set DL.
751 * @param dl DL
752 */
slowrc153ad92017-08-16 19:47:52 -0700753 public void setDl(SchedMeasRepPerServCell.McsDl dl) {
754 this.dl = dl;
755 }
756
slowr577f3222017-08-28 10:49:08 -0700757 /**
758 * Get UL.
759 * @return Ul
760 */
slowrc153ad92017-08-16 19:47:52 -0700761 public SchedMeasRepPerServCell.McsUl getUl() {
762 return ul;
763 }
764
slowr577f3222017-08-28 10:49:08 -0700765 /**
766 * Set UL.
767 * @param ul Ul
768 */
slowrc153ad92017-08-16 19:47:52 -0700769 public void setUl(SchedMeasRepPerServCell.McsUl ul) {
770 this.ul = ul;
771 }
772
slowr577f3222017-08-28 10:49:08 -0700773 /**
774 * Get time since last update.
775 *
776 * @return long Time
777 */
slowrc153ad92017-08-16 19:47:52 -0700778 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700779 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700780 }
781
slowr577f3222017-08-28 10:49:08 -0700782 /**
783 * Set time since last update.
784 *
785 * @param timesincelastupdate time since last update
786 */
slowrc153ad92017-08-16 19:47:52 -0700787 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
788 this.timesincelastupdate = timesincelastupdate;
789 }
790
791 @Override
792 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700793 return "mcs{" +
slowrc153ad92017-08-16 19:47:52 -0700794 "dl=" + dl +
795 ", ul=" + ul +
slowr577f3222017-08-28 10:49:08 -0700796 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
797 timesincelastupdate.unixTimestamp()) +
slowrc153ad92017-08-16 19:47:52 -0700798 '}';
799 }
800 }
801
802 }
803
804 @JsonPropertyOrder({
slowr60d4d102017-08-16 18:33:58 -0700805 "dl",
806 "ul"
807 })
808 @JsonIgnoreProperties(ignoreUnknown = true)
slowr577f3222017-08-28 10:49:08 -0700809 public static class PdcpThroughput {
slowrc153ad92017-08-16 19:47:52 -0700810 WallClockTimestamp timesincelastupdate;
slowr13fa5b02017-08-08 16:32:31 -0700811 private PDCPMeasReportPerUe.ThroughputDl dl;
812 private PDCPMeasReportPerUe.ThroughputUl ul;
813
slowrc153ad92017-08-16 19:47:52 -0700814 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700815 public PdcpThroughput(@JsonProperty("dl") PDCPMeasReportPerUe.ThroughputDl dl,
816 @JsonProperty("ul") PDCPMeasReportPerUe.ThroughputUl ul) {
slowrc153ad92017-08-16 19:47:52 -0700817 this.dl = dl;
818 this.ul = ul;
819 this.timesincelastupdate = new WallClockTimestamp();
820 }
821
slowr577f3222017-08-28 10:49:08 -0700822 /**
823 * Get DL.
824 * @return Dl
825 */
slowr13fa5b02017-08-08 16:32:31 -0700826 public PDCPMeasReportPerUe.ThroughputDl getDl() {
827 return dl;
828 }
829
slowr577f3222017-08-28 10:49:08 -0700830 /**
831 * Set DL.
832 * @param dl DL
833 */
slowr13fa5b02017-08-08 16:32:31 -0700834 public void setDl(PDCPMeasReportPerUe.ThroughputDl dl) {
835 this.dl = dl;
836 }
837
slowr577f3222017-08-28 10:49:08 -0700838 /**
839 * Get UL.
840 * @return Ul
841 */
slowr13fa5b02017-08-08 16:32:31 -0700842 public PDCPMeasReportPerUe.ThroughputUl getUl() {
843 return ul;
844 }
845
slowr577f3222017-08-28 10:49:08 -0700846 /**
847 * Set UL.
848 * @param ul Ul
849 */
slowr13fa5b02017-08-08 16:32:31 -0700850 public void setUl(PDCPMeasReportPerUe.ThroughputUl ul) {
851 this.ul = ul;
852 }
853
slowr577f3222017-08-28 10:49:08 -0700854 /**
855 * Get time since last update.
856 *
857 * @return long Time
858 */
slowrc153ad92017-08-16 19:47:52 -0700859 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700860 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700861 }
862
slowr577f3222017-08-28 10:49:08 -0700863 /**
864 * Set time since last update.
865 *
866 * @param timesincelastupdate time since last update
867 */
slowrc153ad92017-08-16 19:47:52 -0700868 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
869 this.timesincelastupdate = timesincelastupdate;
870 }
871
slowr13fa5b02017-08-08 16:32:31 -0700872 @Override
slowrc153ad92017-08-16 19:47:52 -0700873 public String
874 toString() {
slowr577f3222017-08-28 10:49:08 -0700875 return "PdcpThroughput{" +
slowr60d4d102017-08-16 18:33:58 -0700876 "dl=" + dl +
877 ", ul=" + ul +
slowr577f3222017-08-28 10:49:08 -0700878 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
879 timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -0700880 '}';
slowr13fa5b02017-08-08 16:32:31 -0700881 }
882 }
883
slowr60d4d102017-08-16 18:33:58 -0700884 @JsonPropertyOrder({
885 "dl",
886 "ul"
887 })
888 @JsonIgnoreProperties(ignoreUnknown = true)
slowr577f3222017-08-28 10:49:08 -0700889 public static class PdcpPacketdelay {
slowr13fa5b02017-08-08 16:32:31 -0700890 PDCPMeasReportPerUe.PktDelayDl dl;
891 PDCPMeasReportPerUe.PktDelayUl ul;
slowrc153ad92017-08-16 19:47:52 -0700892 WallClockTimestamp timesincelastupdate;
893
894 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700895 public PdcpPacketdelay(@JsonProperty("dl") PDCPMeasReportPerUe.PktDelayDl dl,
896 @JsonProperty("ul") PDCPMeasReportPerUe.PktDelayUl ul) {
slowrc153ad92017-08-16 19:47:52 -0700897 this.dl = dl;
898 this.ul = ul;
899 this.timesincelastupdate = new WallClockTimestamp();
900 }
slowr13fa5b02017-08-08 16:32:31 -0700901
slowr577f3222017-08-28 10:49:08 -0700902 /**
903 * Get DL.
904 * @return Dl
905 */
slowr13fa5b02017-08-08 16:32:31 -0700906 public PDCPMeasReportPerUe.PktDelayDl getDl() {
907 return dl;
908 }
909
slowr577f3222017-08-28 10:49:08 -0700910 /**
911 * Set DL.
912 * @param dl DL
913 */
slowr13fa5b02017-08-08 16:32:31 -0700914 public void setDl(PDCPMeasReportPerUe.PktDelayDl dl) {
915 this.dl = dl;
916 }
917
slowr577f3222017-08-28 10:49:08 -0700918 /**
919 * Get UL.
920 * @return Ul
921 */
slowr13fa5b02017-08-08 16:32:31 -0700922 public PDCPMeasReportPerUe.PktDelayUl getUl() {
923 return ul;
924 }
925
slowr577f3222017-08-28 10:49:08 -0700926 /**
927 * Set UL.
928 * @param ul Ul
929 */
slowr13fa5b02017-08-08 16:32:31 -0700930 public void setUl(PDCPMeasReportPerUe.PktDelayUl ul) {
931 this.ul = ul;
932 }
933
slowr577f3222017-08-28 10:49:08 -0700934 /**
935 * Get time since last update.
936 *
937 * @return long Time
938 */
slowrc153ad92017-08-16 19:47:52 -0700939 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -0700940 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -0700941 }
942
slowr577f3222017-08-28 10:49:08 -0700943 /**
944 * Set time since last update.
945 *
946 * @param timesincelastupdate time since last update
947 */
slowrc153ad92017-08-16 19:47:52 -0700948 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
949 this.timesincelastupdate = timesincelastupdate;
950 }
951
slowr13fa5b02017-08-08 16:32:31 -0700952 @Override
953 public String toString() {
slowr577f3222017-08-28 10:49:08 -0700954 return "PdcpPacketdelay{" +
slowr60d4d102017-08-16 18:33:58 -0700955 "dl=" + dl +
956 ", ul=" + ul +
slowr577f3222017-08-28 10:49:08 -0700957 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
958 timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -0700959 '}';
slowr13fa5b02017-08-08 16:32:31 -0700960 }
961 }
962
slowr60d4d102017-08-16 18:33:58 -0700963 @JsonPropertyOrder({
964 "dl",
965 "ul"
966 })
967 @JsonIgnoreProperties(ignoreUnknown = true)
slowrc153ad92017-08-16 19:47:52 -0700968 public static class ResourceUsage {
slowr13fa5b02017-08-08 16:32:31 -0700969 PRBUsage.PrbUsageDl dl;
970 PRBUsage.PrbUsageUl ul;
slowrc153ad92017-08-16 19:47:52 -0700971 WallClockTimestamp timesincelastupdate;
972
973 @JsonCreator
slowr577f3222017-08-28 10:49:08 -0700974 public ResourceUsage(@JsonProperty("dl") PRBUsage.PrbUsageDl dl,
975 @JsonProperty("ul") PRBUsage.PrbUsageUl ul) {
slowrc153ad92017-08-16 19:47:52 -0700976 this.dl = dl;
977 this.ul = ul;
978 this.timesincelastupdate = new WallClockTimestamp();
979 }
slowr13fa5b02017-08-08 16:32:31 -0700980
slowr577f3222017-08-28 10:49:08 -0700981 /**
982 * Get DL.
983 * @return Dl
984 */
slowr13fa5b02017-08-08 16:32:31 -0700985 public PRBUsage.PrbUsageDl getDl() {
986 return dl;
987 }
988
slowr577f3222017-08-28 10:49:08 -0700989 /**
990 * Set DL.
991 * @param dl DL
992 */
slowr13fa5b02017-08-08 16:32:31 -0700993 public void setDl(PRBUsage.PrbUsageDl dl) {
994 this.dl = dl;
995 }
996
slowr577f3222017-08-28 10:49:08 -0700997 /**
998 * Get UL.
999 * @return Ul
1000 */
slowr13fa5b02017-08-08 16:32:31 -07001001 public PRBUsage.PrbUsageUl getUl() {
1002 return ul;
1003 }
1004
slowr577f3222017-08-28 10:49:08 -07001005 /**
1006 * Set UL.
1007 * @param ul Ul
1008 */
slowr13fa5b02017-08-08 16:32:31 -07001009 public void setUl(PRBUsage.PrbUsageUl ul) {
1010 this.ul = ul;
1011 }
1012
slowr577f3222017-08-28 10:49:08 -07001013 /**
1014 * Get time since last update.
1015 *
1016 * @return long Time
1017 */
slowrc153ad92017-08-16 19:47:52 -07001018 public long getTimesincelastupdate() {
slowr7bebd7b2017-08-17 11:46:11 -07001019 return new WallClockTimestamp().unixTimestamp() - timesincelastupdate.unixTimestamp();
slowrc153ad92017-08-16 19:47:52 -07001020 }
1021
slowr577f3222017-08-28 10:49:08 -07001022 /**
1023 * Set time since last update.
1024 *
1025 * @param timesincelastupdate time since last update
1026 */
slowrc153ad92017-08-16 19:47:52 -07001027 public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
1028 this.timesincelastupdate = timesincelastupdate;
1029 }
1030
slowr13fa5b02017-08-08 16:32:31 -07001031 @Override
1032 public String toString() {
slowr60d4d102017-08-16 18:33:58 -07001033 return "ResourceUsage{" +
1034 "dl=" + dl +
1035 ", ul=" + ul +
slowr577f3222017-08-28 10:49:08 -07001036 ", timesincelastupdate=" + (new WallClockTimestamp().unixTimestamp() -
1037 timesincelastupdate.unixTimestamp()) +
slowr60d4d102017-08-16 18:33:58 -07001038 '}';
slowr13fa5b02017-08-08 16:32:31 -07001039 }
1040 }
1041}