public static Result restApplicationSummariesForUser(String username) {
    JsonArray applicationSummaryArray = new JsonArray();

    List<AppResult> results = null;
    if (username == null || username.isEmpty()) {
      results = getApplications(MAX_APPLICATIONS);
    } else {
      results = getApplications(username, MAX_APPLICATIONS);
    }

    for (AppResult application : results) {
      JsonObject applicationObject = new JsonObject();
      JsonArray heuristicsArray = new JsonArray();
      List<AppHeuristicResult> appHeuristicResult = application.yarnAppHeuristicResults;

      for (AppHeuristicResult heuristic : appHeuristicResult) {
        JsonObject heuristicObject = new JsonObject();
        heuristicObject.addProperty(JsonKeys.NAME, heuristic.heuristicName);
        heuristicObject.addProperty(JsonKeys.SEVERITY, heuristic.severity.getText());
        heuristicsArray.add(heuristicObject);
      }

      applicationObject.addProperty(JsonKeys.ID, application.id);
      applicationObject.addProperty(JsonKeys.USERNAME, application.username);
      applicationObject.addProperty(JsonKeys.JOB_NAME, application.jobName);
      applicationObject.addProperty(JsonKeys.JOB_TYPE, application.jobType);
      applicationObject.addProperty(JsonKeys.START_TIME, application.startTime);
      applicationObject.addProperty(JsonKeys.FINISH_TIME, application.finishTime);
      applicationObject.addProperty(JsonKeys.RUNTIME, application.finishTime - application.startTime);
      applicationObject.addProperty(JsonKeys.WAITTIME, application.totalDelay);
      applicationObject.addProperty(JsonKeys.RESOURCE_USED, application.resourceUsed);
      applicationObject.addProperty(JsonKeys.RESOURCE_WASTED, application.resourceWasted);
      applicationObject.addProperty(JsonKeys.QUEUE, application.queueName);
      applicationObject.addProperty(JsonKeys.SEVERITY, application.severity.getText());

      applicationObject.add(JsonKeys.HEURISTICS_SUMMARY, heuristicsArray);

      applicationSummaryArray.add(applicationObject);
    }

    JsonArray sortedApplicationSummaryArray = getSortedJsonArrayByFinishTime(applicationSummaryArray);

    JsonObject parent = new JsonObject();
    parent.add(JsonKeys.APPLICATION_SUMMARIES, sortedApplicationSummaryArray);
    return ok(new Gson().toJson(parent));
  }
This method returns the json object for the application-summaries based on the username
@param username The username for which application-summaries json must be returned
@return The application-summaries json for the given username
response object:
<pre>
{
 "application-summaries": [
 {
   "id": "sample_app_0000000001",
     "username": "user",
     "starttime": 1471910835628,
     "finishtime": 1471911099238,
     "runtime": 263610,
     "waittime": 46234,
     "resourceused": 101382144,
     "resourcewasted": 15993417,
     "severity": "Moderate",
     "heuristicsummary": [
   {
     "name": "Mapper Data Skew",
       "severity": "None"
   },
   {
     "name": "Mapper GC",
       "severity": "None"
   },
   {
     "name": "Mapper Time",
       "severity": "Moderate"
   },
   {
     "name": "Mapper Speed",
       "severity": "None"
   },
   {
     "name": "Mapper Spill",
       "severity": "None"
   },
   {
     "name": "Mapper Memory",
       "severity": "None"
   },
   {
     "name": "Reducer Data Skew",
       "severity": "None"
   },
   {
     "name": "Reducer GC",
       "severity": "None"
   },
   {
     "name": "Reducer Time",
       "severity": "None"
   },
   {
     "name": "Reducer Memory",
       "severity": "None"
   },
   {
     "name": "Shuffle & Sort",
       "severity": "Low"
   }
   ]
 }
 ]
}
</pre>
app/controllers/api/v1/Web.java