Fix some JSON related deprecation and javadoc warnings
Change-Id: If39c0bbe578794c8308b24d9290e269bd14b9219
diff --git a/apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java b/apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java
index d77ff7d..75e3f27 100644
--- a/apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java
+++ b/apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java
@@ -93,8 +93,8 @@
Gauge<Long> gauge = eventMetric.lastEventTimestampGauge();
Meter meter = eventMetric.eventRateMeter();
- objectNode.put(gaugeName, json(mapper, gauge));
- objectNode.put(meterName, json(mapper, meter));
+ objectNode.set(gaugeName, json(mapper, gauge));
+ objectNode.set(meterName, json(mapper, meter));
return objectNode;
}
diff --git a/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsListCommand.java b/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsListCommand.java
index 9634df6..0cd2cfb 100644
--- a/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsListCommand.java
+++ b/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsListCommand.java
@@ -77,7 +77,7 @@
* Produces JSON object for a topology event.
*
* @param mapper the JSON object mapper to use
- * @param topologyEvent the topology event with the data
+ * @param event the topology event with the data
* @return JSON object for the topology event
*/
private ObjectNode json(ObjectMapper mapper, Event event) {
@@ -94,7 +94,7 @@
for (Event reason : topologyEvent.reasons()) {
reasons.add(json(mapper, reason));
}
- result.put("reasons", reasons);
+ result.set("reasons", reasons);
}
return result;
diff --git a/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsMetricsCommand.java b/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsMetricsCommand.java
index 4205dfa..274a14d 100644
--- a/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsMetricsCommand.java
+++ b/apps/metrics/topology/src/main/java/org/onosproject/metrics/topology/cli/TopologyEventsMetricsCommand.java
@@ -85,8 +85,8 @@
Gauge<Long> gauge = eventMetric.lastEventTimestampGauge();
Meter meter = eventMetric.eventRateMeter();
- objectNode.put(gaugeName, json(mapper, gauge));
- objectNode.put(meterName, json(mapper, meter));
+ objectNode.set(gaugeName, json(mapper, gauge));
+ objectNode.set(meterName, json(mapper, meter));
return objectNode;
}
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java b/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
index 3b032c0..c3d3c52 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
@@ -122,8 +122,8 @@
if (outputJson()) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode result = mapper.createObjectNode();
- result.put("routes4", json(routes4));
- result.put("routes6", json(routes6));
+ result.set("routes4", json(routes4));
+ result.set("routes6", json(routes6));
print("%s", result);
} else {
// The IPv4 routes
@@ -248,7 +248,7 @@
result.put("bgpId",
route.getBgpSession().remoteInfo().bgpId().toString());
result.put("origin", Update.Origin.typeToString(route.getOrigin()));
- result.put("asPath", json(mapper, route.getAsPath()));
+ result.set("asPath", json(mapper, route.getAsPath()));
result.put("localPref", route.getLocalPref());
result.put("multiExitDisc", route.getMultiExitDisc());
@@ -273,10 +273,10 @@
for (Long asNumber : pathSegment.getSegmentAsNumbers()) {
segmentAsNumbersJson.add(asNumber);
}
- pathSegmentJson.put("segmentAsNumbers", segmentAsNumbersJson);
+ pathSegmentJson.set("segmentAsNumbers", segmentAsNumbersJson);
pathSegmentsJson.add(pathSegmentJson);
}
- result.put("pathSegments", pathSegmentsJson);
+ result.set("pathSegments", pathSegmentsJson);
return result;
}
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java b/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
index 6c9d688..ab2b91e 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
@@ -92,8 +92,8 @@
if (outputJson()) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode result = mapper.createObjectNode();
- result.put("routes4", json(routes4));
- result.put("routes6", json(routes6));
+ result.set("routes4", json(routes4));
+ result.set("routes6", json(routes6));
print("%s", result);
} else {
// The IPv4 routes
diff --git a/cli/src/main/java/org/onosproject/cli/net/IntentsListCommand.java b/cli/src/main/java/org/onosproject/cli/net/IntentsListCommand.java
index 77a8bd6..992c528 100644
--- a/cli/src/main/java/org/onosproject/cli/net/IntentsListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/IntentsListCommand.java
@@ -180,17 +180,17 @@
ObjectNode json() {
ObjectMapper mapper = new ObjectMapper();
ObjectNode result = mapper.createObjectNode();
- result.put("connectivity", summaryConnectivity.json(mapper));
- result.put("hostToHost", summaryHostToHost.json(mapper));
- result.put("pointToPoint", summaryPointToPoint.json(mapper));
- result.put("multiPointToSinglePoint",
+ result.set("connectivity", summaryConnectivity.json(mapper));
+ result.set("hostToHost", summaryHostToHost.json(mapper));
+ result.set("pointToPoint", summaryPointToPoint.json(mapper));
+ result.set("multiPointToSinglePoint",
summaryMultiPointToSinglePoint.json(mapper));
- result.put("singlePointToMultiPoint",
+ result.set("singlePointToMultiPoint",
summarySinglePointToMultiPoint.json(mapper));
- result.put("path", summaryPath.json(mapper));
- result.put("linkCollection", summaryLinkCollection.json(mapper));
- result.put("unknownType", summaryUnknownType.json(mapper));
- result.put("all", summaryAll.json(mapper));
+ result.set("path", summaryPath.json(mapper));
+ result.set("linkCollection", summaryLinkCollection.json(mapper));
+ result.set("unknownType", summaryUnknownType.json(mapper));
+ result.set("all", summaryAll.json(mapper));
return result;
}