MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / parseLastPointQueryV1

Method parseLastPointQueryV1

src/tsd/HttpJsonSerializer.java:289–301  ·  view source on GitHub ↗

Parses a last data point query @return A LastPointQuery to work with @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed

()

Source from the content-addressed store, hash-verified

287 * @throws BadRequestException if the content was missing or parsing failed
288 */
289 public LastPointQuery parseLastPointQueryV1() {
290 final String json = query.getContent();
291 if (json == null || json.isEmpty()) {
292 throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
293 "Missing message content",
294 "Supply valid JSON formatted data in the body of your request");
295 }
296 try {
297 return JSON.parseToObject(json, LastPointQuery.class);
298 } catch (IllegalArgumentException iae) {
299 throw new BadRequestException("Unable to parse the given JSON", iae);
300 }
301 }
302
303 /**
304 * Parses a single UIDMeta object

Callers

nothing calls this directly

Calls 3

parseToObjectMethod · 0.95
isEmptyMethod · 0.80
getContentMethod · 0.45

Tested by

no test coverage detected