public static Result restAppResult(String id, Boolean prioritize) {

    if (id == null || id.isEmpty()) {
      return badRequest("No job id provided.");
    }
    if (id.contains("job")) {
      id = id.replaceAll("job", "application");
    }

    AppResult result = getAppResultForId(id);

    if (result != null) {
      return ok(Json.toJson(result));
    }
    // If prioritize flag is set, resubmit the job at higher priority and wait for it to complete.
    if (prioritize && DrElephant.getInstance().getElephant().prioritizeExecutionAndWait(id)) {
      // The analysis job has completed. Get the result.
      result = getAppResultForId(id);
    }
    if (result != null) {
      return ok(Json.toJson(result));
    }
    return notFound("Unable to find record on id: " + id);
  }
Rest API for searching a particular job information
E.g, localhost:8080/rest/job?id=xyz&prioritize=true
app/controllers/Application.java