Fix some JSON related deprecation and javadoc warnings
Change-Id: If39c0bbe578794c8308b24d9290e269bd14b9219
Showing
6 changed files
with
22 additions
and
22 deletions
apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java
... | @@ -93,8 +93,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { | ... | @@ -93,8 +93,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { |
93 | Gauge<Long> gauge = eventMetric.lastEventTimestampGauge(); | 93 | Gauge<Long> gauge = eventMetric.lastEventTimestampGauge(); |
94 | Meter meter = eventMetric.eventRateMeter(); | 94 | Meter meter = eventMetric.eventRateMeter(); |
95 | 95 | ||
96 | - objectNode.put(gaugeName, json(mapper, gauge)); | 96 | + objectNode.set(gaugeName, json(mapper, gauge)); |
97 | - objectNode.put(meterName, json(mapper, meter)); | 97 | + objectNode.set(meterName, json(mapper, meter)); |
98 | return objectNode; | 98 | return objectNode; |
99 | } | 99 | } |
100 | 100 | ... | ... |
... | @@ -77,7 +77,7 @@ public class TopologyEventsListCommand extends AbstractShellCommand { | ... | @@ -77,7 +77,7 @@ public class TopologyEventsListCommand extends AbstractShellCommand { |
77 | * Produces JSON object for a topology event. | 77 | * Produces JSON object for a topology event. |
78 | * | 78 | * |
79 | * @param mapper the JSON object mapper to use | 79 | * @param mapper the JSON object mapper to use |
80 | - * @param topologyEvent the topology event with the data | 80 | + * @param event the topology event with the data |
81 | * @return JSON object for the topology event | 81 | * @return JSON object for the topology event |
82 | */ | 82 | */ |
83 | private ObjectNode json(ObjectMapper mapper, Event event) { | 83 | private ObjectNode json(ObjectMapper mapper, Event event) { |
... | @@ -94,7 +94,7 @@ public class TopologyEventsListCommand extends AbstractShellCommand { | ... | @@ -94,7 +94,7 @@ public class TopologyEventsListCommand extends AbstractShellCommand { |
94 | for (Event reason : topologyEvent.reasons()) { | 94 | for (Event reason : topologyEvent.reasons()) { |
95 | reasons.add(json(mapper, reason)); | 95 | reasons.add(json(mapper, reason)); |
96 | } | 96 | } |
97 | - result.put("reasons", reasons); | 97 | + result.set("reasons", reasons); |
98 | } | 98 | } |
99 | 99 | ||
100 | return result; | 100 | return result; | ... | ... |
... | @@ -85,8 +85,8 @@ public class TopologyEventsMetricsCommand extends AbstractShellCommand { | ... | @@ -85,8 +85,8 @@ public class TopologyEventsMetricsCommand extends AbstractShellCommand { |
85 | Gauge<Long> gauge = eventMetric.lastEventTimestampGauge(); | 85 | Gauge<Long> gauge = eventMetric.lastEventTimestampGauge(); |
86 | Meter meter = eventMetric.eventRateMeter(); | 86 | Meter meter = eventMetric.eventRateMeter(); |
87 | 87 | ||
88 | - objectNode.put(gaugeName, json(mapper, gauge)); | 88 | + objectNode.set(gaugeName, json(mapper, gauge)); |
89 | - objectNode.put(meterName, json(mapper, meter)); | 89 | + objectNode.set(meterName, json(mapper, meter)); |
90 | return objectNode; | 90 | return objectNode; |
91 | } | 91 | } |
92 | 92 | ... | ... |
... | @@ -122,8 +122,8 @@ public class BgpRoutesListCommand extends AbstractShellCommand { | ... | @@ -122,8 +122,8 @@ public class BgpRoutesListCommand extends AbstractShellCommand { |
122 | if (outputJson()) { | 122 | if (outputJson()) { |
123 | ObjectMapper mapper = new ObjectMapper(); | 123 | ObjectMapper mapper = new ObjectMapper(); |
124 | ObjectNode result = mapper.createObjectNode(); | 124 | ObjectNode result = mapper.createObjectNode(); |
125 | - result.put("routes4", json(routes4)); | 125 | + result.set("routes4", json(routes4)); |
126 | - result.put("routes6", json(routes6)); | 126 | + result.set("routes6", json(routes6)); |
127 | print("%s", result); | 127 | print("%s", result); |
128 | } else { | 128 | } else { |
129 | // The IPv4 routes | 129 | // The IPv4 routes |
... | @@ -248,7 +248,7 @@ public class BgpRoutesListCommand extends AbstractShellCommand { | ... | @@ -248,7 +248,7 @@ public class BgpRoutesListCommand extends AbstractShellCommand { |
248 | result.put("bgpId", | 248 | result.put("bgpId", |
249 | route.getBgpSession().remoteInfo().bgpId().toString()); | 249 | route.getBgpSession().remoteInfo().bgpId().toString()); |
250 | result.put("origin", Update.Origin.typeToString(route.getOrigin())); | 250 | result.put("origin", Update.Origin.typeToString(route.getOrigin())); |
251 | - result.put("asPath", json(mapper, route.getAsPath())); | 251 | + result.set("asPath", json(mapper, route.getAsPath())); |
252 | result.put("localPref", route.getLocalPref()); | 252 | result.put("localPref", route.getLocalPref()); |
253 | result.put("multiExitDisc", route.getMultiExitDisc()); | 253 | result.put("multiExitDisc", route.getMultiExitDisc()); |
254 | 254 | ||
... | @@ -273,10 +273,10 @@ public class BgpRoutesListCommand extends AbstractShellCommand { | ... | @@ -273,10 +273,10 @@ public class BgpRoutesListCommand extends AbstractShellCommand { |
273 | for (Long asNumber : pathSegment.getSegmentAsNumbers()) { | 273 | for (Long asNumber : pathSegment.getSegmentAsNumbers()) { |
274 | segmentAsNumbersJson.add(asNumber); | 274 | segmentAsNumbersJson.add(asNumber); |
275 | } | 275 | } |
276 | - pathSegmentJson.put("segmentAsNumbers", segmentAsNumbersJson); | 276 | + pathSegmentJson.set("segmentAsNumbers", segmentAsNumbersJson); |
277 | pathSegmentsJson.add(pathSegmentJson); | 277 | pathSegmentsJson.add(pathSegmentJson); |
278 | } | 278 | } |
279 | - result.put("pathSegments", pathSegmentsJson); | 279 | + result.set("pathSegments", pathSegmentsJson); |
280 | 280 | ||
281 | return result; | 281 | return result; |
282 | } | 282 | } | ... | ... |
... | @@ -92,8 +92,8 @@ public class RoutesListCommand extends AbstractShellCommand { | ... | @@ -92,8 +92,8 @@ public class RoutesListCommand extends AbstractShellCommand { |
92 | if (outputJson()) { | 92 | if (outputJson()) { |
93 | ObjectMapper mapper = new ObjectMapper(); | 93 | ObjectMapper mapper = new ObjectMapper(); |
94 | ObjectNode result = mapper.createObjectNode(); | 94 | ObjectNode result = mapper.createObjectNode(); |
95 | - result.put("routes4", json(routes4)); | 95 | + result.set("routes4", json(routes4)); |
96 | - result.put("routes6", json(routes6)); | 96 | + result.set("routes6", json(routes6)); |
97 | print("%s", result); | 97 | print("%s", result); |
98 | } else { | 98 | } else { |
99 | // The IPv4 routes | 99 | // The IPv4 routes | ... | ... |
... | @@ -180,17 +180,17 @@ public class IntentsListCommand extends AbstractShellCommand { | ... | @@ -180,17 +180,17 @@ public class IntentsListCommand extends AbstractShellCommand { |
180 | ObjectNode json() { | 180 | ObjectNode json() { |
181 | ObjectMapper mapper = new ObjectMapper(); | 181 | ObjectMapper mapper = new ObjectMapper(); |
182 | ObjectNode result = mapper.createObjectNode(); | 182 | ObjectNode result = mapper.createObjectNode(); |
183 | - result.put("connectivity", summaryConnectivity.json(mapper)); | 183 | + result.set("connectivity", summaryConnectivity.json(mapper)); |
184 | - result.put("hostToHost", summaryHostToHost.json(mapper)); | 184 | + result.set("hostToHost", summaryHostToHost.json(mapper)); |
185 | - result.put("pointToPoint", summaryPointToPoint.json(mapper)); | 185 | + result.set("pointToPoint", summaryPointToPoint.json(mapper)); |
186 | - result.put("multiPointToSinglePoint", | 186 | + result.set("multiPointToSinglePoint", |
187 | summaryMultiPointToSinglePoint.json(mapper)); | 187 | summaryMultiPointToSinglePoint.json(mapper)); |
188 | - result.put("singlePointToMultiPoint", | 188 | + result.set("singlePointToMultiPoint", |
189 | summarySinglePointToMultiPoint.json(mapper)); | 189 | summarySinglePointToMultiPoint.json(mapper)); |
190 | - result.put("path", summaryPath.json(mapper)); | 190 | + result.set("path", summaryPath.json(mapper)); |
191 | - result.put("linkCollection", summaryLinkCollection.json(mapper)); | 191 | + result.set("linkCollection", summaryLinkCollection.json(mapper)); |
192 | - result.put("unknownType", summaryUnknownType.json(mapper)); | 192 | + result.set("unknownType", summaryUnknownType.json(mapper)); |
193 | - result.put("all", summaryAll.json(mapper)); | 193 | + result.set("all", summaryAll.json(mapper)); |
194 | return result; | 194 | return result; |
195 | } | 195 | } |
196 | 196 | ... | ... |
-
Please register or login to post a comment