Ray Milkey

Fix some JSON related deprecation and javadoc warnings

Change-Id: If39c0bbe578794c8308b24d9290e269bd14b9219
......@@ -93,8 +93,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand {
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;
}
......
......@@ -77,7 +77,7 @@ public class TopologyEventsListCommand extends AbstractShellCommand {
* 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 @@ public class TopologyEventsListCommand extends AbstractShellCommand {
for (Event reason : topologyEvent.reasons()) {
reasons.add(json(mapper, reason));
}
result.put("reasons", reasons);
result.set("reasons", reasons);
}
return result;
......
......@@ -85,8 +85,8 @@ public class TopologyEventsMetricsCommand extends AbstractShellCommand {
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;
}
......
......@@ -122,8 +122,8 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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;
}
......
......@@ -92,8 +92,8 @@ public class RoutesListCommand extends AbstractShellCommand {
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
......
......@@ -180,17 +180,17 @@ public class IntentsListCommand extends AbstractShellCommand {
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;
}
......